diff --git a/README.md b/README.md index 7433d48d..21f99bd4 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ - 报错 - npm install -g cnpm --registry=https://registry.npm.taobao.org 安装cnmp - cnpm install node-sass 安装node-sass -- 直接启动 +- npm run dev 直接启动 - 成功安装 ``` ### ERP project diff --git a/config/index.js b/config/index.js index 422df978..7ab2bd76 100644 --- a/config/index.js +++ b/config/index.js @@ -15,7 +15,7 @@ module.exports = { // can be overwritten by process.env.HOST // if you want dev by ip, please set host: '0.0.0.0' - host: '192.168.1.38', + host: '192.168.1.45', port: 9527, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: true, errorOverlay: true, diff --git a/src/views/CheckReport/AddCheckReport.vue b/src/views/CheckReport/AddCheckReport.vue index ccec4b12..ac2fbc40 100644 --- a/src/views/CheckReport/AddCheckReport.vue +++ b/src/views/CheckReport/AddCheckReport.vue @@ -162,7 +162,7 @@ - + @@ -197,7 +197,7 @@

质检报告单明细

- 添加 + 添加 删除
@@ -271,6 +271,14 @@ export default { callback() } } + const validatePass2 = (rule, value, callback) => { + console.log(this.supplierId) + if (this.personalForm.productCode === undefined || this.personalForm.productCode === null || this.personalForm.productCode === '') { + callback(new Error('请选择抽检商品')) + } else { + callback() + } + } return { // 控制报检部门是否可以编辑 IsInspectionDeptId: false, @@ -351,7 +359,7 @@ export default { countryId: 1, repositoryId: 438, regionId: 2, - isVat: 1, + isRecheck: 1, sourceType: '4' }, // 采购申请单规则数据 @@ -366,7 +374,7 @@ export default { { required: true, validator: validatePass, trigger: 'focus' } ], productCode: [ - { required: true, validator: validatePass, trigger: 'focus' } + { required: true, validator: validatePass2, trigger: 'change' } ], checkDate: [ { required: true, message: '请选择检验日期', trigger: 'change' } @@ -391,12 +399,30 @@ export default { ], sampleQuantity: [ { required: true, message: '请输入抽样数量', trigger: 'blur' } + ], + passQuantity: [ + { required: true, message: '请输入合格数量', trigger: 'blur' } ] }, // 采购申请单明细数据 list2: [], // 采购申请单明细列表规则 validRules: { + chectResult: [ + { required: true, message: '请输入检验结果', trigger: 'blur' } + ], + checkQuantity: [ + { required: true, message: '请输入检验结果', trigger: 'blur' } + ], + passQuantity: [ + { required: true, message: '请输入合格数量', trigger: 'blur' } + ], + checkPersonname: [ + { required: true, message: '请选择检验人员', trigger: 'blur' } + ], + checkDeptId: [ + { required: true, message: '请选择检验部门', trigger: 'blur' } + ] } } }, @@ -404,6 +430,18 @@ export default { this.getTypes() }, methods: { + + handleAdd() { + if (this.personalForm.sampleQuantity === '' || this.personalForm.sampleQuantity === null || this.personalForm.sampleQuantity === undefined) { + this.$notify.error({ + title: '错误', + message: '抽样数量为空', + offset: 100 + }) + return false + } + this.$refs.editable.insert(-1) + }, chooseType(val) { if (this.personalForm.sourceType === '1') { this.IsProduceManagerId = false @@ -702,29 +740,55 @@ export default { const parms = JSON.stringify(Data) this.$refs.personalForm.validate((valid) => { if (valid) { - addqualitycheck(parms, parms2, this.personalForm).then(res => { - console.log(res) - if (res.data.ret === 200) { - this.$notify({ - title: '成功', - message: '保存成功', - type: 'success', - offset: 100 + this.$refs.personalForm2.validate((valid) => { + if (valid) { + this.$refs.personalForm3.validate((valid) => { + if (valid) { + this.$refs.editable.validate().then(valid => { + addqualitycheck(parms, parms2, this.personalForm).then(res => { + console.log(res) + if (res.data.ret === 200) { + this.$notify({ + title: '成功', + message: '保存成功', + type: 'success', + offset: 100 + }) + this.restAllForm() + this.$refs.editable.clear() + this.$refs.personalForm.clearValidate() + this.$refs.personalForm.resetFields() + this.$refs.personalForm2.clearValidate() + this.$refs.personalForm2.resetFields() + this.$refs.personalForm3.clearValidate() + this.$refs.personalForm3.resetFields() + } else { + this.$notify.error({ + title: '错误', + message: res.data.msg, + offset: 100 + }) + } + }) + }).catch(valid => { + console.log('error submit!!') + }) + } else { + this.$notify.error({ + title: '错误', + message: '信息未填完整', + offset: 100 + }) + return false + } }) - this.restAllForm() - this.$refs.editable.clear() - this.$refs.personalForm.clearValidate() - this.$refs.personalForm.resetFields() - this.$refs.personalForm2.clearValidate() - this.$refs.personalForm2.resetFields() - this.$refs.personalForm3.clearValidate() - this.$refs.personalForm3.resetFields() } else { this.$notify.error({ title: '错误', - message: res.data.msg, + message: '信息未填完整', offset: 100 }) + return false } }) } else {