|
|
|
@ -231,18 +231,77 @@
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 新增模块 -->
|
|
|
|
|
<el-dialog title="新增订单" :visible.sync="dialogVisible" width="900px" append-to-body :before-close="handleClose">
|
|
|
|
|
<el-dialog title="新增订单" :visible.sync="dialogVisible" width="900px" append-to-body>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
width="800px"
|
|
|
|
|
title="物料选择"
|
|
|
|
|
:visible.sync="innerVisible"
|
|
|
|
|
append-to-body>
|
|
|
|
|
|
|
|
|
|
<el-form :model="materielQueryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
<el-form-item label="物料编码" prop="productCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="materielQueryParams.productCode"
|
|
|
|
|
placeholder="请输入物料编码"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleMaterielQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料名称" prop="productCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="materielQueryParams.productDescZh"
|
|
|
|
|
placeholder="请输入物料名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleMaterielQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleMaterielQuery">搜索</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="materielList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
|
|
|
|
|
<el-table-column label="物料编码" align="center" prop="productCode" />
|
|
|
|
|
<el-table-column label="物料名称" align="center" prop="productDescZh" />
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="materielQueryParams.pageNum"
|
|
|
|
|
:limit.sync="materielQueryParams.pageSize"
|
|
|
|
|
@pagination="getMaterielList"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<el-button @click="subMateriel" class="my-materiel-btn" type="primary">确定</el-button>
|
|
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-form ref="form" :model="form" :rules="addrules" label-width="80px">
|
|
|
|
|
<!-- 第一行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<!-- 第一列 -->
|
|
|
|
|
<el-col :offset="1" :span="8">
|
|
|
|
|
<el-col :offset="1" :span="9">
|
|
|
|
|
<el-form-item label-width="100px" label="物料号" prop="prodCode">
|
|
|
|
|
<el-input v-model="form.prodCode" placeholder="请输入物料号"/>
|
|
|
|
|
<el-input @focus="selectMateriel" readonly v-model="form.prodCode" placeholder="点击选择物料"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- 第二列 -->
|
|
|
|
|
<el-col :offset="2" :span="8">
|
|
|
|
|
<el-col :offset="1" :span="9">
|
|
|
|
|
<el-form-item label-width="100px" label="物料名称" prop="prodDesc">
|
|
|
|
|
<el-input @focus="selectMateriel" readonly v-model="form.prodDesc" placeholder="点击选择物料"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 第二行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<!-- 第一列 -->
|
|
|
|
|
<el-col :offset="1" :span="8">
|
|
|
|
|
<el-form-item label-width="100px" label="计划生产日期" prop="planProDate">
|
|
|
|
|
<el-date-picker clearable
|
|
|
|
|
v-model="form.planProDate"
|
|
|
|
@ -253,15 +312,6 @@
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 第二行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<!-- 第一列 -->
|
|
|
|
|
<el-col :offset="1" :span="8">
|
|
|
|
|
<el-form-item label-width="100px" label="物料名称" prop="prodDesc">
|
|
|
|
|
<el-input v-model="form.prodDesc" placeholder="请输入物料名称"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- 第二列 -->
|
|
|
|
|
<el-col :offset="2" :span="8">
|
|
|
|
|
<el-form-item label-width="100px" label="计划完成日期" prop="planComplete">
|
|
|
|
@ -278,20 +328,21 @@
|
|
|
|
|
<!-- 第三行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<!-- 第一列 -->
|
|
|
|
|
<el-col :offset="1" :span="8">
|
|
|
|
|
<el-col :offset="1" :span="9">
|
|
|
|
|
<el-form-item label-width="100px" label="订单数量" prop="quantity">
|
|
|
|
|
<el-input @change="addQuantity" type="number" v-model="form.quantity" placeholder="请输入订单数量"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- 第二列 -->
|
|
|
|
|
<el-col :offset="2" :span="9">
|
|
|
|
|
<el-col :offset="1" :span="9">
|
|
|
|
|
<el-form-item label-width="100px" label="单位" prop="unit">
|
|
|
|
|
<el-input v-model="form.unit" placeholder="请输入单位"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 第四行 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :offset="1" :span="8">
|
|
|
|
|
<el-col :offset="1" :span="9">
|
|
|
|
|
<el-form-item label-width="100px" label="产品类型" prop="prodType">
|
|
|
|
|
<el-select v-model="form.prodType" placeholder="请选择产品类型">
|
|
|
|
|
<el-option
|
|
|
|
@ -450,12 +501,13 @@ import {
|
|
|
|
|
delOrder,
|
|
|
|
|
addOrder,
|
|
|
|
|
updateOrder,
|
|
|
|
|
syncSAP
|
|
|
|
|
syncSAP, selectMaterielList
|
|
|
|
|
} from '@/api/plan/order'
|
|
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
import moment from 'moment'
|
|
|
|
|
import { getToken } from "@/utils/auth"
|
|
|
|
|
import {listUser} from "@/api/system/user";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'Order',
|
|
|
|
@ -465,6 +517,18 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
materiel: [],
|
|
|
|
|
materielList:[],
|
|
|
|
|
total: 0,
|
|
|
|
|
// 物料查询数据实体
|
|
|
|
|
materielQueryParams: {
|
|
|
|
|
productCode: undefined,
|
|
|
|
|
productDescZh: undefined,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
},
|
|
|
|
|
// 内层弹窗-新增订单
|
|
|
|
|
innerVisible: false,
|
|
|
|
|
// 导入数据
|
|
|
|
|
upload: {
|
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
@ -578,6 +642,43 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 确认选择物料
|
|
|
|
|
subMateriel() {
|
|
|
|
|
if (this.materiel.length > 1) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '物料只能选择一个!',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.form.prodCode = this.materiel[0].productCode;
|
|
|
|
|
this.form.prodDesc = this.materiel[0].productDescZh;
|
|
|
|
|
this.innerVisible = false;
|
|
|
|
|
console.log(this.materiel)
|
|
|
|
|
console.log(12312)
|
|
|
|
|
console.log(this.form)
|
|
|
|
|
},
|
|
|
|
|
// 选中物料信息
|
|
|
|
|
handleSelectionChange(e) {
|
|
|
|
|
console.log("选中了物料信息")
|
|
|
|
|
this.materiel = e;
|
|
|
|
|
},
|
|
|
|
|
// 查询物料列表
|
|
|
|
|
getMaterielList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
selectMaterielList(this.addDateRange(this.materielQueryParams, this.dateRange)).then(response => {
|
|
|
|
|
this.materielList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
// 选择物料
|
|
|
|
|
selectMateriel() {
|
|
|
|
|
console.log("点击了选择物料")
|
|
|
|
|
this.innerVisible = true;
|
|
|
|
|
this.getMaterielList();
|
|
|
|
|
},
|
|
|
|
|
// 选择工艺
|
|
|
|
|
changeRoute(routeCode) {
|
|
|
|
|
getProEquipment(routeCode).then(response => {
|
|
|
|
@ -1097,10 +1198,19 @@ export default {
|
|
|
|
|
batchQuantity: ''
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
// 物料搜索
|
|
|
|
|
handleMaterielQuery() {
|
|
|
|
|
console.log("进行了查询功能")
|
|
|
|
|
this.getMaterielList();
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
// 物料重置
|
|
|
|
|
resetMaterielQuery() {
|
|
|
|
|
console.log("进行了物料重置")
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.queryParams = {
|
|
|
|
@ -1235,4 +1345,8 @@ export default {
|
|
|
|
|
margin-top: 40px;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
.my-materiel-btn{
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
margin-left: 650px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|