From 5d0bbba1946838b83d38455c000cf34cf59de111 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Wed, 17 Jul 2024 18:28:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=97=E6=9D=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/consumable.js | 15 +- .../components/cons_record_detail.vue | 173 +++ .../invoicing/consumable/cons_record copy.vue | 239 +++ .../invoicing/consumable/cons_record.vue | 67 +- .../invoicing/consumable/information.vue | 518 +++++-- .../invoicing/consumable/specifications.vue | 1294 ++++++++++------- src/views/order_manage/order_list.vue | 21 +- 7 files changed, 1716 insertions(+), 611 deletions(-) create mode 100644 src/views/invoicing/components/cons_record_detail.vue create mode 100644 src/views/invoicing/consumable/cons_record copy.vue diff --git a/src/api/consumable.js b/src/api/consumable.js index 8ca3ae3..2e47bd6 100644 --- a/src/api/consumable.js +++ b/src/api/consumable.js @@ -163,4 +163,17 @@ export function gettbConsInfoFlow(params) { method: "get", params }); -} \ No newline at end of file +} +/** + * 分组查询获取耗材流水信息 + */ +export function viewConInfoFlow(data) { + return request({ + url: "/api/viewConInfoFlow", + method: "get", + params: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); + } \ No newline at end of file diff --git a/src/views/invoicing/components/cons_record_detail.vue b/src/views/invoicing/components/cons_record_detail.vue new file mode 100644 index 0000000..86a8799 --- /dev/null +++ b/src/views/invoicing/components/cons_record_detail.vue @@ -0,0 +1,173 @@ + + + + \ No newline at end of file diff --git a/src/views/invoicing/consumable/cons_record copy.vue b/src/views/invoicing/consumable/cons_record copy.vue new file mode 100644 index 0000000..f84313c --- /dev/null +++ b/src/views/invoicing/consumable/cons_record copy.vue @@ -0,0 +1,239 @@ + + + diff --git a/src/views/invoicing/consumable/cons_record.vue b/src/views/invoicing/consumable/cons_record.vue index 1212717..e3f22e3 100644 --- a/src/views/invoicing/consumable/cons_record.vue +++ b/src/views/invoicing/consumable/cons_record.vue @@ -20,20 +20,31 @@ height="66vh" > - + + + + + + + + + + + + + + + - - - - - - - +
+ + + +
+ + + +
+ +
查询 重置
- 导出耗材 - 导入耗材 + 导出耗材 + 导入耗材
- 添加 + 添加
- + @@ -63,10 +130,22 @@ + + +
- - - - + + + + -
+
查询 重置
- + @@ -188,19 +432,30 @@
- +
- + @@ -208,7 +463,10 @@ - + @@ -238,6 +506,18 @@ import Sortable from "sortablejs"; import dayjs from "dayjs"; import settings from "@/settings"; import { upProSort } from "@/api/shop"; + +function returnPromise(index,prosise){ + return new Promise((resolve,reject)=>{ + prosise.then(res=>{ + console.log(res); + resolve({sucees:true}) + }).catch(err=>{ + console.log(err); + resolve({sucees:false}) + }) + }) + } import { gettbConsType, gettbConsInfo, @@ -316,6 +596,7 @@ export default { total: 0 }, ruleFormLoading: false, + ruleForms:[], ruleForm: { conCode: "", conName: "", @@ -336,7 +617,7 @@ export default { { required: true, message: "请输入耗材信息名称", trigger: "blur" } ], conTypeId: [ - { required: true, message: "请选择耗材类型", trigger: "blur" } + { required: true, message: "请选择耗材类型", trigger: "change" } ], price: [{ required: true, message: "请输入耗材价格", trigger: "blur" }], conWarning: [ @@ -362,10 +643,34 @@ export default { }, mounted() { this.resetQuery = { ...this.query } + this.resetRuleForms() this.getTableData(); this.getTableDatatype(); + this.gettbConsType() }, methods: { + //解决selectc值改变后未验证问题 + selectChange($event,ref,type){ + this.$refs[ref][0].validateField(type) + }, + //重置添加耗材表单 + resetRuleForms(){ + this.ruleForms=[{...this.ruleForm}] + this.$refs['refruleForm0']&&this.$refs['refruleForm0'][0].resetFields() + }, + //添加耗材弹窗删除 + ruleFormsReduce(index){ + if(this.ruleForms.length>1){ + this.ruleForms.splice(index,1) + }else{ + this.$message({ type: "error", message: "至少保留一种耗材" }); + } + }, + //添加耗材弹窗增加 + ruleFormsAdd(){ + console.log('add') + this.ruleForms.push({...this.ruleForm}) + }, // 导入耗材 async excelSuccessUpload(file) { try { @@ -509,7 +814,8 @@ export default { this.dialogtitle = "添加"; this.gettbConsType() this.$nextTick(() => { - this.$refs.refruleForm.resetFields(); + // this.$refs.refruleForm.resetFields(); + this.resetRuleForms() }); } else { this.dialogtitle = "编辑"; @@ -523,7 +829,32 @@ export default { } this.dialogshow = true; }, + //添加 + async submitForms() { + let isAllPassForm=0 + for(let i in this.ruleForms){ + const res=await returnPromise(i,this.$refs['refruleForm'+i][0].validate()) + console.log(res) + isAllPassForm+=res.sucees?1:0 + } + //判断验证是否通过 + if(isAllPassForm===this.ruleForms.length){ + await posttbConsInfo( this.ruleForms) + this.$message({ type: "success", message: "添加成功" }); + + // for(let i of this.ruleForms){ + // const res=await posttbConsInfo(i) + // this.$message({ type: "success", message: "添加成功" }); + // } + this.dialogshow = false; + this.resetRuleForms() + this.ruleFormLoading = false; + this.getTableData(); + } + }, + //编辑 submitForm(formName) { + this.$refs[formName].validate(async valid => { if (valid) { this.ruleFormLoading = true; @@ -532,12 +863,17 @@ export default { this.$message({ type: "success", message: "编辑成功" }); this.dialogshow = false; } else { - //添加 - console.log(this.ruleForm, '调试') - await posttbConsInfo({ - ...this.ruleForm - }); - this.$message({ type: "success", message: "添加成功" }); + // //添加 + // console.log(this.ruleForm, '调试') + // for(let i of this.ruleForms){ + // console.log(i) + // await posttbConsInfo({ + // ...i + // }); + // this.$message({ type: "success", message: "添加成功" }); + + // } + } this.dialogshow = false; this.$refs[formName].resetFields(); @@ -590,6 +926,16 @@ export default { \ No newline at end of file diff --git a/src/views/order_manage/order_list.vue b/src/views/order_manage/order_list.vue index 449d30d..dfab934 100644 --- a/src/views/order_manage/order_list.vue +++ b/src/views/order_manage/order_list.vue @@ -54,12 +54,21 @@ > + + + + + 查询 重置 下载中... + +
@@ -218,7 +229,8 @@ export default { status: "", payType: "", orderNo: "", - createdAt: [] + createdAt: [], + productName:'' }, tableData: { data: [], @@ -262,6 +274,9 @@ export default { if(this.$route.query.tableName){ this.query.tableName = this.$route.query.tableName } + if(this.$route.query.orderNo){ + this.query.orderNo = this.$route.query.orderNo + } this.resetQuery = { ...this.query }; this.tbShopPayTypeGet(); this.getTableData(); @@ -320,11 +335,13 @@ export default { this.tableData.loading = true; try { this.payCount(); + const productName=this.query.productName.replace(/\s+/g,'') const res = await tbOrderInfoData({ page: this.tableData.page, pageSize: this.tableData.size, orderType: this.orderType, - ...this.query + ...this.query, + productName }); this.tableData.loading = false; this.tableData.data = res.content;