From 0caada6e581e6958cc0a7c44c8479c544e4c2527 Mon Sep 17 00:00:00 2001 From: chenjianan Date: Fri, 23 Nov 2018 13:36:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BA=A4=E6=8D=A2=E4=BB=B6=EF=BC=9A?= =?UTF-8?q?=E4=BA=A4=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Inventory/ExchangePart/index.vue | 154 ++++++++++++--------- 1 file changed, 91 insertions(+), 63 deletions(-) diff --git a/src/views/Inventory/ExchangePart/index.vue b/src/views/Inventory/ExchangePart/index.vue index 064a5477..7f41f690 100644 --- a/src/views/Inventory/ExchangePart/index.vue +++ b/src/views/Inventory/ExchangePart/index.vue @@ -76,17 +76,17 @@ +
+ +
-
- -
@@ -127,7 +127,7 @@
- 交换 + 交换
@@ -167,24 +167,6 @@
- - - - - - - - - - - - - -
+
+ +
-
- -
+ + + + + + + + + + + + + + @@ -265,13 +265,15 @@ import { mapGetters } from 'vuex' export default { data() { return { - ProjectValue: ' ', + count1: 0, + count2: 0, // 清表单验证计数器 + ProjectValue: '', Project: [], ProjectValue_check: 1, - MachineValue: ' ', + MachineValue: '', Machine: [], MachineValue_check: 1, - GroupNumValue: ' ', + GroupNumValue: '', GroupNumValue_check: 1, GroupNum: [], tableDataBasic: [], @@ -302,7 +304,7 @@ export default { rules: { // 表单验证规则 ExchangeNumber: [{ required: true, message: '请输入交换件编号', trigger: 'blur' }], ExchangeNumberx: [{ required: true, message: '请输入交换件数量', trigger: 'blur' }], - ExchangeNote: [{ required: true, message: '请输入交换件备注', trigger: 'change' }] + ExchangeNote: [{ required: true, message: '请输入交换件备注', trigger: 'blur' }] }, PageCurrent: 1, PageSize: 10, @@ -334,7 +336,6 @@ export default { // 获取人员编号 getpeopleid() { this.picikingPeople = this.id - console.log(this.picikingPeople) }, searchMachine() { // 查询机床 if (this.ProjectValue === '') { @@ -362,19 +363,18 @@ export default { searchPartinfo() { this.tableDataPurchase = [] this.tableDataBasic = [] - if (this.ProjectValue === ' ') { + if (this.ProjectValue === '') { this.ProjectValue_check = 0 } - if (this.MachineValue === ' ') { + if (this.MachineValue === '') { this.MachineValue_check = 0 } - if (this.GroupNumValue === ' ') { + if (this.GroupNumValue === '') { this.GroupNumValue_check = 0 } this.listLoading = true searchPurchasePart(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => { this.tableDataPurchase = response.data.rows - console.log(this.tableDataPurchase) this.total = response.data.total }) this.listLoading = false @@ -397,39 +397,66 @@ export default { this.listLoading1 = false }) }, + handleSizeChange1(val) { + this.PageCurrent1 = 1 + this.PageSize1 = val + this.getExchangeTable() + }, + handleCurrentChange1(val) { + this.PageCurrent1 = val + this.getExchangeTable() + }, // 选择领料单 chooseListinfor(row) { this.pickingListNumberx = row.领料单流水号 - console.log(this.pickingListNumberx) this.searchListDetailt() }, // 增加交换件 - addListDetailinfor() { - addExchangepart(this.form.ExchangeNumber, this.tableData1[0].组件零件流水号, this.tableData1[0].物料流水号, this.tableData1[0].采购合同明细流水号, this.tableData2[0].组件零件流水号, this.tableData1[0].物料名称, this.tableData2[0].物料名称, this.tableData2[0].货位流水号, this.form.ExchangeNumberx, this.picikingPeople, this.form.ExchangeNote).then(response => { - if (response.data[0].result === '1') { - this.$message.success('增加成功') - } else { this.$message.error('增加失败') } + addListDetailinfor(form) { + this.$refs[form].validate((valid) => { + if (valid) { + addExchangepart(this.form.ExchangeNumber, this.tableData1[0].组件零件流水号, this.tableData1[0].物料流水号, this.tableData1[0].采购合同明细流水号, this.tableData2[0].组件零件流水号, this.tableData1[0].物料名称, this.tableData2[0].物料名称, this.tableData2[0].货位流水号, this.form.ExchangeNumberx, this.picikingPeople, this.form.ExchangeNote).then(response => { + if (response.data[0].result === '1') { + this.$message.success('增加成功') + } else { this.$message.error('增加失败') } + }).then(() => { + this.dialogFormVisible = false + this.PageCurrent1 = 1 + this.getExchangeTable() + }) + } }) - this.dialogFormVisible = false - this.getExchangeTable() }, // 打开交换表单 - exchange() { - this.title = '交换' - this.dialogFormVisible = true + exchange(form) { + if (this.tableData1.length === 0) { + this.$message.error('请选择交换件') + } else if (this.tableData2.length === 0) { + this.$message.error('请选择交换件') + } else { + this.count1 = this.count1 + 1 + if (this.count1 !== 1) { + this.$refs[form].resetFields() + } + this.title = '交换' + this.form.ExchangeNumber = '' + this.form.ExchangeNumberx = '' + this.form.ExchangeNote = '' + this.dialogFormVisible = true + } }, // 重置表单 - callOff() { + callOff(formName) { this.form.ExchangeNumber = '' this.form.ExchangeNumberx = '' this.form.ExchangeNote = '' this.dialogFormVisible = false + this.$refs[formName].resetFields() }, // 选中零件交换 selecting(row) { const arr = new Array(row) this.tableData1 = arr - console.log(this.tableData1) }, // 选中被零件交换 selected(row) { @@ -448,8 +475,9 @@ export default { dropExchangeList(this.exchangeListNumber, this.eTeamPartNumber).then(response => { if (response.data[0].result === '1') { this.$message.success('删除成功') - this.getExchangeTable().then(response => { - }) + this.dialogFormVisible = false + this.PageCurrent1 = 1 + this.getExchangeTable() } else { this.$message.error('删除失败') } From eca32011fd19b09abad23f81f96cb7578160856c Mon Sep 17 00:00:00 2001 From: liushuai Date: Fri, 23 Nov 2018 13:36:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=9B=98=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Inventory/InventoryCheck/index.vue | 94 ++++++++++++-------- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/src/views/Inventory/InventoryCheck/index.vue b/src/views/Inventory/InventoryCheck/index.vue index eea95a70..0a544c0a 100644 --- a/src/views/Inventory/InventoryCheck/index.vue +++ b/src/views/Inventory/InventoryCheck/index.vue @@ -654,13 +654,13 @@ export default { PurchasePartOut: [], // 外购件出库记录 PurchasePartIn: [], // 外购件入库记录 tableDataStandard: [], // 标准件 - ProjectValue: ' ', + ProjectValue: '', Project: [], ProjectValue_check: 1, - MachineValue: ' ', + MachineValue: '', Machine: [], MachineValue_check: 1, - GroupNumValue: ' ', + GroupNumValue: '', GroupNumValue_check: 1, GroupNum: [], ContractDetailValue: '', @@ -712,23 +712,29 @@ export default { this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称 }, searchMachine() { // 查询机床 - if (this.ProjectValue === ' ') { - this.ProjectValue_check = 0 + this.Machine = [] + this.GroupNum = [] + this.MachineValue = '' + this.GroupNumValue = '' + console.log(this.ProjectValue) + if (this.ProjectValue !== '') { + searchmachine(1, this.ProjectValue).then(response => { + for (let i = 0; i < response.data.length; i++) { + this.Machine.push({ + label: response.data[i].机床图号, + value: response.data[i].机床流水号 + }) + } + }) } - searchmachine(this.ProjectValue_check, this.ProjectValue).then(response => { - for (let i = 0; i < response.data.length; i++) { - this.Machine.push({ - label: response.data[i].机床图号, - value: response.data[i].机床流水号 - }) - } - }) }, searchGroupList() { // 查询组号 + this.GroupNum = [] + this.GroupNumValue = '' searchTeam(this.MachineValue).then(response => { for (let i = 0; i < response.data.length; i++) { this.GroupNum.push({ - label: response.data[i].组件名称, + label: response.data[i].组号, value: response.data[i].组件流水号 }) } @@ -738,23 +744,26 @@ export default { searchPurchasePartinfo() { this.listLoading6 = true this.tableDataPurchase = [] - if (this.ProjectValue === ' ') { + if (this.ProjectValue === '') { this.ProjectValue_check = 0 + } else { + this.ProjectValue_check = 1 } - if (this.MachineValue === ' ') { + if (this.MachineValue === '') { this.MachineValue_check = 0 + } else { + this.MachineValue_check = 1 } - if (this.GroupNumValue === ' ') { + if (this.GroupNumValue === '') { this.GroupNumValue_check = 0 + } else { + this.GroupNumValue_check = 1 } searchPurchasePart(this.PageCurrent2, this.PageSize2, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => { this.tableDataPurchase = response.data.rows this.total2 = response.data.total this.listLoading6 = false }) - this.projectValue = ' ' - this.MachineValue = ' ' - this.GroupNumValue = ' ' }, // 查询外购件记录 searchPurchasePartRecord(row) { @@ -775,14 +784,20 @@ export default { searchStandardPartinfo() { this.listLoading9 = true this.tableDataStandard = [] - if (this.ProjectValue === ' ') { + if (this.ProjectValue === '') { this.ProjectValue_check = 0 + } else { + this.ProjectValue_check = 1 } - if (this.MachineValue === ' ') { + if (this.MachineValue === '') { this.MachineValue_check = 0 + } else { + this.MachineValue_check = 1 } - if (this.GroupNumValue === ' ') { + if (this.GroupNumValue === '') { this.GroupNumValue_check = 0 + } else { + this.GroupNumValue_check = 1 } searchStandardPart(this.PageCurrent3, this.PageSize3, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => { this.tableDataStandard = response.data.rows @@ -790,9 +805,6 @@ export default { this.listLoading9 = false console.log(this.tableDataPurchase) }) - this.projectValue = ' ' - this.MachineValue = ' ' - this.GroupNumValue = ' ' }, standardselecting(row) { this.contractDeatilNumber = row.采购合同明细流水号 @@ -820,45 +832,51 @@ export default { searchGeneralPartinfo() { this.listLoading3 = true this.tableDataGeneral = [] - if (this.ProjectValue === ' ') { + if (this.ProjectValue === '') { this.ProjectValue_check = 0 + } else { + this.ProjectValue_check = 1 } - if (this.MachineValue === ' ') { + if (this.MachineValue === '') { this.MachineValue_check = 0 + } else { + this.MachineValue_check = 1 } - if (this.GroupNumValue === ' ') { + if (this.GroupNumValue === '') { this.GroupNumValue_check = 0 + } else { + this.GroupNumValue_check = 1 } searchGeneralPart(this.PageCurrent1, this.PageSize1, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => { this.tableDataGeneral = response.data.rows this.total1 = response.data.total this.listLoading3 = false }) - this.projectValue = ' ' - this.MachineValue = ' ' - this.GroupNumValue = ' ' }, // 查询基本件 searchBasciPartinfo() { this.listLoading = true this.tableDataBasic = [] - if (this.ProjectValue === ' ') { + if (this.ProjectValue === '') { this.ProjectValue_check = 0 + } else { + this.ProjectValue_check = 1 } - if (this.MachineValue === ' ') { + if (this.MachineValue === '') { this.MachineValue_check = 0 + } else { + this.MachineValue_check = 1 } - if (this.GroupNumValue === ' ') { + if (this.GroupNumValue === '') { this.GroupNumValue_check = 0 + } else { + this.GroupNumValue_check = 1 } searchBasicPart(this.PageCurrent, this.PageSize, this.ProjectValue_check, this.ProjectValue, this.MachineValue_check, this.MachineValue, this.GroupNumValue_check, this.GroupNumValue).then(response => { this.tableDataBasic = response.data.rows this.listLoading = false this.total = response.data.total }) - this.projectValue = ' ' - this.MachineValue = ' ' - this.GroupNumValue = ' ' }, // 查询基本件记录 searchBasicPartRecord(row) { From 57eecde546ff225c62b184e402c9c1a9ad2d8aed Mon Sep 17 00:00:00 2001 From: chenjianan Date: Fri, 23 Nov 2018 13:40:26 +0800 Subject: [PATCH 3/3] request --- src/utils/request.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 13b4ff36..992fa8ac 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -10,14 +10,8 @@ export const name = `OP8888` export const upload = `http://123.56.95.229:8411/submit/uploadFile.ashx` export const download = `http://123.56.95.229:8411/submit/downloadFile.ashx` const service = axios.create({ -<<<<<<< HEAD - // baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`, - baseURL: `http://192.168.1.149:8411/submit/MESCommonBase.ashx`, -======= baseURL: `http://localhost:8411/submit/MESCommonBase.ashx`, - ->>>>>>> 3b215d048bf49b3019c70e80ff7dbd7ebd5869a4 timeout: 1500000 // 请求超时时间 })