diff --git a/pages/materialManagement/recordInbound/index.vue b/pages/materialManagement/recordInbound/index.vue index d40b4cc..408cf53 100644 --- a/pages/materialManagement/recordInbound/index.vue +++ b/pages/materialManagement/recordInbound/index.vue @@ -14,18 +14,24 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + + @@ -119,88 +126,100 @@ export default { return { // 基础表单数据 baseFormData: { - name: "", - age: "", - introduction: "", - sex: 2, - hobby: [5], - datetimesingle: 1627529992399, + materialCode: "", + materialName: "", + type: "", + transportType: "", + supplierName: "", + locationCode: "", + locationName: "", + warehouseCode: "", + quantity: null, + batchNo: "", + stoveCode: "", + operator: "", }, // 校验表单数据 valiFormData: { - name: "", - age: "", - introduction: "", + materialCode: "", + locationCode: "", + warehouseCode: "", + transportType: "", + quantity: "", + batchNo: "", }, // 校验规则 rules: { - name: { + materialCode: { rules: [ { required: true, - errorMessage: "姓名不能为空", + errorMessage: "物料编码不能为空", }, ], }, - age: { + locationCode: { rules: [ { required: true, - errorMessage: "年龄不能为空", + errorMessage: "库位编码不能为空", + }, + ], + }, + warehouseCode: { + rules: [ + { + required: true, + errorMessage: "仓库编码不能为空", + }, + ], + }, + transportType: { + rules: [ + { + required: true, + errorMessage: "入库类型不能为空", + }, + ], + }, + quantity: { + rules: [ + { + required: true, + errorMessage: "入库数量不能为空", }, { format: "number", - errorMessage: "年龄只能输入数字", + errorMessage: "入库数量只能输入数字", + }, + ], + }, + batchNo: { + rules: [ + { + required: true, + errorMessage: "批次号不能为空", }, ], }, }, - candidates: ['北京', '南京', '东京', '武汉', '天津', '上海', '海口'], + // candidates: ['北京', '南京', '东京', '武汉', '天津', '上海', '海口'], }; }, - computed: { - // 处理表单排列切换 - alignment() { - if (this.current === 0) return "left"; - if (this.current === 1) return "top"; - return "left"; - }, - }, + computed: {}, onLoad() {}, onReady() {}, methods: { - onClickItem(e) { - console.log(e); - this.current = e.currentIndex; - }, - add() { - this.dynamicLists.push({ - label: "域名", - rules: [ - { - required: true, - errorMessage: "域名项必填", - }, - ], - id: Date.now(), - }); - }, - del(id) { - let index = this.dynamicLists.findIndex((v) => v.id === id); - this.dynamicLists.splice(index, 1); - }, + // 提交表单 submit(ref) { - this.$refs[ref] + this.$refs.baseForm .validate() .then((res) => { - console.log("success", res); - uni.showToast({ - title: `校验通过`, - }); + console.log("表单数据信息:", res); }) .catch((err) => { - console.log("err", err); + console.log("表单错误信息:", err); }); }, },