diff --git a/src/api/plan/order.js b/src/api/plan/order.js index d35e7521..087ef90f 100644 --- a/src/api/plan/order.js +++ b/src/api/plan/order.js @@ -1,10 +1,11 @@ import request from '@/utils/request' // 获取物料list -export function selectMaterielList() { +export function selectMaterielList(query) { return request({ url: '/plan/product/list', - method: 'get' + method: 'get', + params: query }) } diff --git a/src/views/plan/order/index.vue b/src/views/plan/order/index.vue index f0f070a8..db2d600f 100644 --- a/src/views/plan/order/index.vue +++ b/src/views/plan/order/index.vue @@ -87,7 +87,7 @@ plain icon="el-icon-plus" size="mini" - @click="dialogVisible = true" + @click="setUp" v-hasPermi="['mes:pro:order:add']" >新增 @@ -642,8 +642,22 @@ export default { }) }, methods: { + // 新增按钮操作 + setUp() { + this.dialogVisible = true; + // 清空缓存 + this.form.prodCode = null; + this.form.prodDesc = null; + }, // 确认选择物料 subMateriel() { + if (this.materiel.length == 0) { + this.$message({ + message: '请选择物料!', + type: 'warning' + }) + return + } if (this.materiel.length > 1) { this.$message({ message: '物料只能选择一个!', @@ -654,19 +668,15 @@ export default { 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 => { + selectMaterielList(this.materielQueryParams).then(response => { this.materielList = response.rows; this.total = response.total; this.loading = false; @@ -675,7 +685,6 @@ export default { }, // 选择物料 selectMateriel() { - console.log("点击了选择物料") this.innerVisible = true; this.getMaterielList(); }, @@ -1200,7 +1209,7 @@ export default { }, // 物料搜索 handleMaterielQuery() { - console.log("进行了查询功能") + this.materielQueryParams.pageNum = 1; this.getMaterielList(); }, /** 搜索按钮操作 */ @@ -1209,6 +1218,7 @@ export default { }, // 物料重置 resetMaterielQuery() { + // TODO 待优化 console.log("进行了物料重置") }, /** 重置按钮操作 */