You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

196 lines
6.2 KiB
Vue

11 months ago
<template>
<el-dialog title="生产订单号选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="105px" align="left">
<el-form-item label="物料名称">
11 months ago
<el-input
v-model="queryParams.materialName"
placeholder="物料名称"
clearable
8 months ago
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料编码">
<el-input
v-model="queryParams.materialCode"
placeholder="物料编码"
11 months ago
clearable
8 months ago
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
8 months ago
<!--
8 months ago
<el-form-item label="订单号">
<el-input
8 months ago
v-model="queryParams.workorderCodeSap"
8 months ago
placeholder="订单号"
clearable
style="width: 150px"
11 months ago
@keyup.enter.native="handleQuery"
/>
8 months ago
</el-form-item>
-->
<el-form-item label="入库时间">
<el-date-picker
v-model="queryParams.incomeTimeArray"
format="yyyy-MM-dd"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
11 months ago
</el-form-item>
8 months ago
<el-form-item label="仓库名称">
<el-select v-model="queryParams.supplierCode" placeholder="请选择仓库" width="50%" clearable>
<el-option v-for="work in cwarehouseList"
:key="work.supplierCode"
:label="work.supplierName"
:value="work.supplierCode"></el-option>
</el-select>
</el-form-item>
11 months ago
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="itemList" @selection-change="handleBomSelectionChange" ref="myTable" >
<el-table-column width="50" align="center" type="selection"/>
8 months ago
<!--<el-table-column label="订单号" align="left" prop="workorderCodeSap" width="100"/>-->
<el-table-column label="唯一单号" align="left" prop="orderNo" width="130"/>
<el-table-column label="物料编码" align="left" prop="materialCode" width="180" />
<el-table-column label="物料名称" align="left" prop="materialName" width="180"/>
11 months ago
<el-table-column label="数量" align="left" prop="quality" width="100" />
<el-table-column label="仓库编码" align="left" prop="supplierCode"/>
<el-table-column label="仓库编名称" align="left" prop="supplierName" width="120"/>
<el-table-column label="入库日期" align="left" prop="incomeTime" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.incomeTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="left" prop="status" width="90"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitPutInOrderForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
</template>
<script>
8 months ago
import moment from "moment/moment";
8 months ago
import { getPutInOrder,getWarehouseList } from "@/api/quality/income";
11 months ago
export default {
name: "itemPutInOrder",
data() {
return {
showFlag:false,
// 选中数组
selectedRows: {},
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// BOM产品表格数据
itemList: null,
//树名称
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
8 months ago
workorderCode: '',
incomeTimeArray: [],
11 months ago
},
8 months ago
selectionRow:{},
cwarehouseList: [],
11 months ago
};
},
created() {
this.getList();
8 months ago
this.getWarehouseList();
11 months ago
},
methods: {
/** 查询表格列表*/
getList() {
8 months ago
debugger
11 months ago
this.loading = true;
8 months ago
if (this.queryParams.incomeTimeArray.length > 0) {
this.queryParams.incomeTimeStart = moment(this.queryParams.incomeTimeArray[0]).format("YYYY-MM-DD");
this.queryParams.incomeTimeEnd = moment(this.queryParams.incomeTimeArray[1]).format("YYYY-MM-DD");
}
11 months ago
getPutInOrder(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
8 months ago
//获取报工物料损耗仓库下拉列表
getWarehouseList() {
getWarehouseList({}).then((data) => {
this.cwarehouseList = data;
});
},
11 months ago
// 多选框选中数据
handleBomSelectionChange(selection) {
if(selection.length>1){
this.$modal.msgSuccess("只能选一个");
}
this.selectionRow = selection[0]
},
submitPutInOrderForm() {
this.$emit('onSelected', this.selectionRow);
this.showFlag = false;
}
}
};
</script>