From c00e8941aaa8acee4950978071571a5de2679dd1 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 08 四月 2024 14:36:09 +0800
Subject: [PATCH] 保存纤度登记的接口,字段类型调整,处理数据格式+联调获取纤度检验列表的接口,字段调试

---
 src/views/productManage/silkRegisterForm/addPage.vue |  126 +++++++++++++++++++++++++----------------
 1 files changed, 77 insertions(+), 49 deletions(-)

diff --git a/src/views/productManage/silkRegisterForm/addPage.vue b/src/views/productManage/silkRegisterForm/addPage.vue
index db3ef01..8029790 100644
--- a/src/views/productManage/silkRegisterForm/addPage.vue
+++ b/src/views/productManage/silkRegisterForm/addPage.vue
@@ -61,6 +61,7 @@
                                     :value="item.ID">
                                 </el-option>
                             </el-select>
+                            
                         </el-form-item>
                         <el-form-item label="鍥炴暟" prop='circle' class="form-item">
                             <el-row>
@@ -125,8 +126,8 @@
                         </el-form-item>
                         <el-form-item label="缁勫埆" prop="workshopGroup" class="form-item">
                             <el-select v-model="form.workshopGroup" placeholder="璇烽�夋嫨" class="select-width">
-                                <el-option v-for="item in workshopGroupList" :key="item.ID" :label="item.name"
-                                    :value="item.ID">
+                                <el-option v-for="item in workshopGroupList" :key="item.ID" :label="item.workshopNumber"
+                                    :value="item.workshopNumber">
                                 </el-option>
                             </el-select>
                         </el-form-item>
@@ -246,6 +247,7 @@
   
 <script>
 import { getRegisterList,saveRegister,getDictList,getWorkshopManageList,getRegisterDetails } from "@/api/productManage/silkRegisterForm.js"
+import {getCheckDetails,saveCheck,} from "@/api/productManage/silkInspectForm.js"
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 import CommonFormTableView from "@/components/makepager/CommonFormTableView"
 export default {
@@ -261,8 +263,7 @@
             loading: false,
             activeName: "first",
             searchOptions: [],
-            search_map: {},
-            is_public: true,
+            keyword: '',
             marketList:[], //搴勫彛
             nameList:[], //杞﹂棿
             workshopGroupList:[], //缁勫埆
@@ -364,17 +365,17 @@
                 tableData: [
                     {
                         productId:1,
-                        position: '',
-                        fineness: 0,
-                        quantity: 0,
-                        sum: "",
+                        position: null,
+                        fineness: null,
+                        quantity: null,
+                        sum: null,
                     }
                 ],
                 tableColumn:[
-                    { label: "杞﹀彿", prop: "position", input: true }, // 瀹㈡埛鍚嶇О
+                    { label: "杞﹀彿", prop: "position", inputNumber: true,isRequird: true, }, // 瀹㈡埛鍚嶇О
                     { label: "绾ゅ害鍊�", prop: "fineness", inputNumber: true, isRequird: true, }, // 閿�鍞礋璐d汉
                     { label: "鏁伴噺", prop: "quantity", inputNumber: true , isRequird: true,}, // 閲嶈绾у埆
-                    { label: "绾ゅ害鍚堣", prop: "sum", inputNumber: true}, // 涓嬫鍥炶鏃ユ湡
+                    { label: "绾ゅ害鍚堣", prop: "sum", inputNumber: true,isRequird: true,}, // 涓嬫鍥炶鏃ユ湡
                 ],
             },
             tableData:[],
@@ -388,25 +389,33 @@
             this.registerId= query.id ? query.id : "";
         }
         this.getSelectDataList()
-        this.search_map = {
-            is_public: this.is_public
-        }
+        this.keyword=''
         this.getDetailsData()
         this.getData()
     },
     methods: {
         getDetailsData(){
             if(this.registerId){
-                getRegisterDetails({ id: this.registerId }).then((response) => {
-                    if (response.code === 200) {
-                    let config=JSON.parse(JSON.stringify(response.data?response.data:{}));
-                    this.form=config;
-                    this.tableList.tableData=config.finenessList?config.finenessList:[]
-                    this.tableData=config.finenessList?config.finenessList:[]
-                    } 
-                })
+                if(this.activeName=='first'){
+                    getRegisterDetails({ id: this.registerId }).then((response) => {
+                        if (response.code === 200) {
+                        let config=JSON.parse(JSON.stringify(response.data?response.data:{}));
+                        this.form=config;
+                        this.tableList.tableData=config.finenessList?config.finenessList:[]
+                        this.tableData=config.finenessList?config.finenessList:[]
+                        } 
+                    })
+                }else{
+                    getCheckDetails({ id: this.registerId }).then((response) => {
+                        if (response.code === 200) {
+                        let config=JSON.parse(JSON.stringify(response.data?response.data:{}));
+                        this.form=config;
+                        this.tableList.tableData=config.finenessList?config.finenessList:[]
+                        this.tableData=config.finenessList?config.finenessList:[]
+                        } 
+                    })
+                }
             }
-            
         },
         getSelectDataList(){
             //杞﹂棿
@@ -469,7 +478,7 @@
         async getData() {
             this.loading = true
             await getRegisterList({
-                search_map: this.search_map,
+                keyword: this.keyword?this.keyword:'',
                 page: this.pagerOptions.currPage,
                 pageSize: this.pagerOptions.pageSize
             })
@@ -525,24 +534,21 @@
                 })
         },
         tabsClick(tab) {
-            console.log(tab.name)
-            if (tab.name === "first") {
-                this.is_public = true
-            } else {
-                this.is_public = false
-            }
-            this.search_map = {
-                is_public: this.is_public
-            }
+            // if (tab.name === "first") {
+            //     this.is_public = true
+            // } else {
+            //     this.is_public = false
+            // }
+            this.$router.push({
+                path:"/productManage/silkRegisterForm/addPage?activeName="+tab.name,
+            });
+            this.keyword = ''
             this.pagerOptions.currPage = 1
             this.getData()
         },
         // 鎼滅储
         onFilterSearch(searchText) {
-            this.search_map = {
-                is_public: this.is_public,
-                name: searchText
-            }
+            this.keyword=searchText||''
             this.pagerOptions.currPage = 1
             this.getData()
         },
@@ -587,20 +593,42 @@
                         finenessList:finenessList,
                         ...form
                     }
+                    // 缂栬緫
+                    if(this.registerId){
+                        params.id=this.registerId
+                    }
+                    // params.workshopGroup=Number(params.workshopGroup)
                     this.isAddloading=true
-                    saveRegister(params).then((res) => {
-                        if (res.code == 200) {
-                            this.$message({
-                                message: "淇濆瓨鎴愬姛锛�",
-                                type: "success",
-                            });
-                        }
-                        this.isAddloading=false
-                    }).catch(() => {
-                        setTimeout(() => {
-                            this.isAddloading = false;
-                            }, 3000);
-                    })
+                    if(this.activeName=='first'){
+                        saveRegister(params).then((res) => {
+                            if (res.code == 200) {
+                                this.$message({
+                                    message: "淇濆瓨鎴愬姛锛�",
+                                    type: "success",
+                                });
+                            }
+                            this.isAddloading=false
+                        }).catch(() => {
+                            setTimeout(() => {
+                                this.isAddloading = false;
+                                }, 3000);
+                        })
+                    }else{
+                        saveCheck(params).then((res) => {
+                            if (res.code == 200) {
+                                this.$message({
+                                    message: "淇濆瓨鎴愬姛锛�",
+                                    type: "success",
+                                });
+                            }
+                            this.isAddloading=false
+                        }).catch(() => {
+                            setTimeout(() => {
+                                this.isAddloading = false;
+                                }, 3000);
+                        })
+                    }
+                    
                 } else {
                     console.log('error submit!!');
                     

--
Gitblit v1.8.0