From 67517b477cbb05cd9dbe467b16192d95b9e2695f Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 17 四月 2024 16:50:51 +0800
Subject: [PATCH] 月度统计报表模块 前端开发+列表的接口联调
---
src/views/productManage/product/AddProductDialog.vue | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 153 insertions(+), 5 deletions(-)
diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue
index 3be77ba..fd0e079 100644
--- a/src/views/productManage/product/AddProductDialog.vue
+++ b/src/views/productManage/product/AddProductDialog.vue
@@ -86,6 +86,7 @@
<el-input
style="width: 85%"
:disabled="!showFooter"
+ clearable
v-model="editConfig.infomation.specs"
placeholder="璇疯緭鍏�"
></el-input>
@@ -95,6 +96,7 @@
v-model="editConfig.infomation.productType"
placeholder="璇烽�夋嫨"
size="mini"
+ clearable
style="width: 85%"
:disabled="!showFooter"
>
@@ -146,8 +148,9 @@
placeholder="鍗曚綅"
filterable
@change="Gtechange"
- style="width: 85%"
+ style="width: calc(85% - 0px)"
>
+ <!-- style="width: calc(85% - 110px)" -->
<el-option
v-for="ele in unitList"
:key="ele.id"
@@ -160,6 +163,14 @@
style="font-size: 20px; color: gray"
@click="handleUnitShow"
></i>
+ <!-- <el-checkbox
+ class="margin_left_10px"
+ :disabled="editConfig.infomation.unit&&showFooter?false:true"
+ v-model="editConfig.infomation.moreUnit"
+ @change="moreUnitChange"
+ ></el-checkbox
+ > -->
+ <!-- <span class="margin_left_10px cursor_pointer" @click="handleUnitMore">鍚敤澶氬崟浣�</span> -->
</el-form-item>
<el-form-item label="浜у搧鏍囩" prop="productTagName">
@@ -219,6 +230,7 @@
v-model="editConfig.infomation.categoryId"
placeholder="璇烽�夋嫨"
size="mini"
+ clearable
style="width: 85%"
:disabled="!showFooter"
>
@@ -318,7 +330,7 @@
</el-option>
</el-select>
</el-form-item>
- <el-form-item label="閲嶉噺" prop="weight" label-width="80px">
+ <!-- <el-form-item label="閲嶉噺" prop="weight" label-width="80px">
<el-input-number
v-model="editConfig.infomation.weight"
placeholder="璇疯緭鍏�"
@@ -329,7 +341,63 @@
:disabled="!showFooter"
></el-input-number>
<span> kg</span>
- </el-form-item>
+ </el-form-item> -->
+ <el-form-item label="姣涢噸" prop="grossWeight">
+ <el-col :span="15"
+ >
+ <el-input
+ v-model="editConfig.infomation.grossWeight"
+ placeholder="璇疯緭鍏�"
+ :disabled="!showFooter"
+ ></el-input>
+ </el-col>
+ <el-col :span="1"> </el-col>
+ <el-col :span="4">
+ <el-select
+ v-model="editConfig.infomation.grossUnit"
+ placeholder="鍗曚綅"
+ filterable
+ :disabled="!showFooter"
+ style="width: 100%; float: right"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="ele in grossUnitList"
+ :key="ele.id"
+ :label="ele.name"
+ :value="ele.name"
+ ></el-option>
+ </el-select>
+ </el-col>
+ </el-form-item>
+ <el-form-item label="鍑�閲�" prop="netWeight">
+ <el-col :span="15"
+ >
+ <el-input
+ v-model="editConfig.infomation.netWeight"
+ :disabled="!showFooter"
+ placeholder="璇疯緭鍏�"
+ ></el-input>
+ </el-col>
+ <el-col :span="1"> </el-col>
+ <el-col :span="4">
+ <el-select
+ v-model="editConfig.infomation.netUnit"
+ placeholder="鍗曚綅"
+ filterable
+ :disabled="!showFooter"
+ style="width: 100%; float: right"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="ele in grossUnitList"
+ :key="ele.id"
+ :label="ele.name"
+ :value="ele.name"
+ ></el-option>
+ </el-select>
+ </el-col>
+ </el-form-item>
<el-form-item label="浣撶Н" prop="volume" label-width="80px">
<el-input-number
v-model="editConfig.infomation.volume"
@@ -542,6 +610,13 @@
:workList="unitList"
title="璁¢噺鍗曚綅"
></BomDialog>
+ <UnitMoreDialog
+ ref="unitMoreDialog"
+ @saveUnitMore="saveUnitMore"
+ :workList="unitList"
+ :dataList="editConfig.infomation.moreUnitList"
+ title="鍚敤澶氬崟浣�"
+ ></UnitMoreDialog>
</div>
</template>
@@ -555,7 +630,7 @@
import BomDialog from "./components/bomDialog";
import {getUnitInfo, } from "@/api/basic/standard";
// import { postGetSaveSUnitDict } from "@/api/basic/standard";
-
+import UnitMoreDialog from "./components/UnitMoreDialog";
export default {
mixins: [codeMixin],
@@ -576,6 +651,7 @@
components: {
IconCropper,
BomDialog,
+ UnitMoreDialog,
},
computed: {
modalTitle() {
@@ -599,7 +675,29 @@
// salePrice: [{ required: true, message: "璇疯緭鍏ラ攢鍞环鏍�", trigger: "blur" }],
unit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: ["blur"] }],
// 閲囪喘绫诲瀷
- purchaseTypeList: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }]
+ purchaseTypeList: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }],
+ netWeight: [
+ {
+ required: false,
+ message: "璇峰~鍐�",
+ trigger: "change",
+ },
+ {
+ validator: this.validatorNumFour,
+ trigger: "blur",
+ },
+ ],
+ grossWeight: [
+ {
+ required: false,
+ message: "璇峰~鍐�",
+ trigger: "change",
+ },
+ {
+ validator: this.validatorNumFour,
+ trigger: "blur",
+ },
+ ],
},
memberOptions: [],
productCategoryOptions: [], // 浜у搧绫诲埆
@@ -657,6 +755,7 @@
isView: false,
fileFormdata: null, // 涓婁紶鍥剧墖鍏ュ弬
bomPurchaseTypeList: getDataByType("purchaseType"),
+ grossUnitList:getDataByType("grossUnit"),
unitList: [],
editRow:{
editDialogVisible:false,
@@ -685,9 +784,53 @@
this.getUnitInfo()
},
methods: {
+ validatorNumFour(rule, value, callback) {
+ if (value != "") {
+ if (value == undefined || value == null) {
+ callback(new Error("璇疯緭鍏ユ湁鏁堟暟瀛�"));
+ } else {
+ let reg2 =
+ /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
+ if (!reg2.test(value) || value == 0) {
+ callback(new Error("璇峰~鍐欏ぇ浜庨浂鐨�2浣嶅皬鏁扮殑鏁板瓧"));
+ } else {
+ callback();
+ }
+ }
+ } else {
+ callback();
+ }
+ },
// 鍗曚綅
handleUnitShow() {
this.editRow.editDialogVisible = true;
+ },
+ // 鍚敤澶氬崟浣�
+ handleUnitMore(){
+ if(this.editConfig.infomation.unit){
+ this.$refs.unitMoreDialog.editDialogVisible = true;
+ }else{
+ this.$message.error('璇峰厛閫夋嫨鍗曚綅锛�')
+ }
+ },
+ saveUnitMore(list){
+ this.editConfig.infomation.moreUnitList=list
+ },
+ // 鍚敤澶氬崟浣嶇殑寮�鍏�
+ moreUnitChange(){
+ let string=false;
+ if(this.editConfig.infomation.moreUnitList&&this.editConfig.infomation.moreUnitList.length>0){
+ for(let i in this.editConfig.infomation.moreUnitList){
+ if(this.editConfig.infomation.moreUnitList[i].unit&&this.editConfig.infomation.moreUnitList[i].amount){
+ string=true;
+ break;
+ }
+ }
+ }
+ if(!string){
+ this.editConfig.infomation.moreUnit=false
+ this.$message.error('璇峰厛閰嶇疆澶氬崟浣嶏紒')
+ }
},
handleConfirmSave(dataList) {
saveUnitDict({ data: dataList }).then((res) => {
@@ -839,6 +982,11 @@
params.codeStandardID = this.autoCodeObj.codeStandardID
params.autoIncr = this.autoCodeObj.maxAutoIncr
}
+ if(params.moreUnitList.length>0){
+ for(let i in params.moreUnitList){
+ params.moreUnitList[i].amount=Number(params.moreUnitList[i].amount)
+ }
+ }
requestUrl(params).then((res) => {
console.log(res)
this.editConfig.visible = false
--
Gitblit v1.8.0