From d22fd400356aed04da0da9e3ef93f8469f71eeb5 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期四, 30 十一月 2023 15:07:00 +0800
Subject: [PATCH] 	new file:   src/api/quality/Packaging_ledger.js 	modified:   src/views/quality/Packaging_ledger/index.vue 	new file:   src/views/quality/Packaging_ledger/pack-from.vue 	new file:   src/views/quality/Packaging_ledger/pack-fromadd.vue 	modified:   vue.config.js

---
 src/views/quality/Packaging_ledger/index.vue |  317 ++++++++++++++++++++++++++++++----------------------
 1 files changed, 182 insertions(+), 135 deletions(-)

diff --git a/src/views/quality/Packaging_ledger/index.vue b/src/views/quality/Packaging_ledger/index.vue
index 430bba5..e8f7d18 100644
--- a/src/views/quality/Packaging_ledger/index.vue
+++ b/src/views/quality/Packaging_ledger/index.vue
@@ -4,17 +4,17 @@
         <el-row>
             <el-col :span="11">
             <ttable
-        :table="table"
-        :isShowHide="true"
-        :prelang="prelang"
-        :options="options" 
-        ref="processconfiguration"
-        >
+            :table="table"
+            :isShowHide="true"
+            :prelang="prelang"
+            :ajaxFun="ajaxFun"
+            :options="options" 
+            @handleSelectionChange="handleCurrentChange"
+            ref="processconfiguration"
+            >
         <template #toolbar></template>
             </ttable>
             </el-col>
-
-
             <el-col :span="13" style="padding-left: 10px">
                 <el-card>
                 <div slot="header">
@@ -32,31 +32,21 @@
                     </el-button> -->
                     </el-col>
                     <el-col :span="2">
-                    <!-- <el-button
+                    <el-button
                         style="float: right; padding: 3px 0"
                         type="text"
-                        :disabled="isSubmit"
-                        v-thinclick="`dataFormTestStandardParam`"
-                        v-if="editable"
+                        @click="addpreserve"
                         >淇濆瓨
-                    </el-button> -->
+                    </el-button>
                     </el-col>
                     <el-col :span="2">
-                    <!-- <el-button
+                    <el-button
                         style="float: right; padding: 3px 0"
                         type="text"
                         @click="relateOperationParam()"
-                        v-if="editable"
                         >娣诲姞
-                    </el-button> -->
+                    </el-button>
                     </el-col>
-                </el-row>
-                <el-row>
-                    <!-- <span style="font-weight:500" v-if="testNo.length > 0"
-                    >鎮ㄥ綋鍓嶉�夋嫨鐨勬娴嬫爣鍑嗙紪鍙锋槸锛�<span style="color:#066EFF">{{
-                        testNo
-                    }}</span></span
-                    > -->
                 </el-row>
                 </div>
                 <el-table
@@ -77,80 +67,31 @@
                 align="center"
                 width="50"
               />
-              <!-- <el-table-column
-                label="鏄惁寮曠敤宸ヨ壓鍙傛暟"
-                prop="isReference"
-                align="center"
-              >
-                <template slot-scope="scope">
-                  <el-select
-                    v-model="scope.row.isReference"
-                    placeholder="璇烽�夋嫨"
-                    style="width: 100%;"
-                  >
-                    <el-option
-                      v-for="(item, index) in referenceOptions"
-                      :key="index"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </el-select>
-                </template>
-              </el-table-column>
-              <el-table-column label="鏄惁鎶芥" prop="isCheck" align="center">
-                <template slot-scope="scope">
-                  <el-select
-                    v-model="scope.row.isCheck"
-                    placeholder="璇烽�夋嫨"
-                    style="width: 100%;"
-                  >
-                    <el-option
-                      v-for="(item, index) in isCheckOptions"
-                      :key="index"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </el-select>
-                </template>
-              </el-table-column>
               <el-table-column
-                label="绾胯姱"
-                prop="wireCore"
-                align="center"
-                width="60"
-              >
-                <template slot-scope="scope">
-                  <el-input v-model="scope.row.wireCore"></el-input>
-                </template>
-              </el-table-column> -->
-              <el-table-column label="鍙傛暟缂栧彿" prop="code" align="center" />
-              <el-table-column
-                label="鍙傛暟椤�"
-                prop="parameterItem"
+                label="浜у搧"
+                prop="product"
                 align="center"
               />
               <el-table-column
-                label="瑕佹眰鑼冨洿"
-                prop="referenceValue"
+                label="浜у搧缂栧彿"
+                prop="productNo"
                 align="center"
               >
               </el-table-column>
               <el-table-column
-                label="榛樿鍊�"
-                prop="defaultValue"
+                label="瑙勬牸鍨嬪彿"
+                prop="specs"
                 align="center"
               >
               </el-table-column>
               <el-table-column
-                label="鍙傛暟椤圭被鍨�"
-                prop="paramType"
+                label="鍗曚綅"
+                prop="unit"
                 align="center"
               >
               </el-table-column>
               <el-table-column
-                label="鍙傛暟鏍煎紡"
+                label="鏁伴噺"
                 prop="parameterFormat"
                 align="center"
                 width="80"
@@ -158,36 +99,53 @@
                 <template slot-scope="scope">
                   <el-input v-model="scope.row.parameterFormat"></el-input>
                 </template>
-              </el-table-column><el-table-column
-                label="娴嬭瘯鏂规硶"
-                prop="purpose"
-                align="center"
-                width="80"
-              >
-              </el-table-column>
-              <el-table-column
-                label="娴嬭瘯鐩殑"
-                prop="method"
-                align="center"
-                width="80"
-              >
               </el-table-column>
               <el-table-column label="鍗曚綅" prop="unit" align="center" />
+              <el-table-column
+                fixed="right"
+                label="鎿嶄綔"
+                align="center"
+                width="80">
+                <template slot-scope="scope">
+                  <el-button @click="deleteadd(scope.row)"  size="small">鍒犻櫎</el-button>
+                </template>
+              </el-table-column>
             </el-table>
                 </el-card>
             </el-col>
         </el-row>
+
+        <!-- 鏂板 -->
+        <packfrom
+        :currshowlist.sync="addOrUpdateVisible"
+        >
+        </packfrom>
+        <packfromadd
+        :currshowlist.sync="increase"
+        :packageBoxIddata ="packageBoxId"
+        @handleSelectionChange = "preserve"
+        >
+        </packfromadd>
         </basic-container>
     </div>
 </template>
 
 <script>
+import { pagedata,dropById,list,saveList,deledata} from '@/api/quality/Packaging_ledger'
 import ttable from '@/views/common/ztt-table.vue'
+import packfrom from './pack-from.vue'
+import packfromadd from './pack-fromadd.vue'
 export default {
     data(){
         return {
+          goid:'',
+          testStandardParams: [],
+          packageBoxId:{},
             prelang: 'operation',
             dataListLoading: false,
+            ajaxFun: pagedata,
+            increase:false,
+            addOrUpdateVisible:false,
             options: {
                 height: 300, // 榛樿楂樺害-涓轰簡琛ㄥご鍥哄畾
                 stripe: true, // 鏄惁涓烘枒椹汗 table
@@ -209,49 +167,41 @@
                 data: [],
                 // 鏍囬
                 column: [
+                {
+                  minWidth: 'code',
+                  prop: 'state',
+                  label: '鐘舵��',
+                  sort: true,
+                  isTrue: true,
+                  isSearch: true,
+                  searchInfoType: 'text'
+                },
                   {
                     minWidth: '140',
-                    prop: 'oo',
-                    label: '璁㈠崟缂栧彿',
+                    prop: 'packageNo',
+                    label: '鍖呰缂栧彿',
                     isTrue: true,
                     isSearch: true,
                     searchInfoType: 'text',
                   },{
                     minWidth: '140',
-                    prop: 'materhhooial',
-                    label: '璐ㄩ噺杩芥函鍙�',
+                    prop: 'createUser',
+                    label: '鍒涘缓浜�',
+                    isTrue: true,
+                    isSearch: true,
+                    searchInfoType: 'text',
+                  },{
+                    minWidth: '140',
+                    prop: 'contractNo',
+                    label: '鍚堝悓鍙�',
                     isTrue: true,
                     isSearch: true,
                     searchInfoType: 'text',
                   },
                   {
                     minWidth: '140',
-                    prop: 'mateuurial',
-                    label: '浜у搧鍚嶇О',
-                    isTrue: true,
-                    isSearch: true,
-                    searchInfoType: 'text',
-                  },
-                  {
-                    minWidth: '140',
-                    prop: 'materoiial',
-                    label: '瑙勬牸鍨嬪彿',
-                    isTrue: true,
-                    isSearch: true,
-                    searchInfoType: 'text',
-                  },
-                  {
-                    minWidth: '140',
-                    prop: 'matperoial',
-                    label: '鍗曚綅',
-                    isTrue: true,
-                    isSearch: true,
-                    searchInfoType: 'text',
-                  },
-                  {
-                    minWidth: '140',
-                    prop: 'materpial',
-                    label: '鏁伴噺',
+                    prop: 'updateUser',
+                    label: '鏇存柊浜�',
                     isTrue: true,
                     isSearch: true,
                     searchInfoType: 'text',
@@ -259,8 +209,18 @@
                   {
                     minWidth: '130',
                     width: '150',
-                    prop: 'dealTime',
-                    label: '鍏ュ簱鏃堕棿',
+                    prop: 'updateTime',
+                    label: '鏇存柊鏃ユ湡',
+                    sort: true,
+                    isTrue: true,
+                    isSearch: true,
+                    searchInfoType: 'datetimerange',
+                },
+                {
+                    minWidth: '130',
+                    width: '150',
+                    prop: 'createTime',
+                    label: '鍒涘缓鏃ユ湡',
                     sort: true,
                     isTrue: true,
                     isSearch: true,
@@ -268,20 +228,107 @@
                 },
                 ],
                 toolbar: [
-                  {
-                    text: 'xxx',
-                    type: 'primary',
-                  },
+                    {
+                      text: '鏂板',
+                      type: 'primary',
+                      fun: this.addOrUpdateHandle
+                    },
                 ],
+                operator: [
+                    {
+                      text: '鍒犻櫎',
+                      icon: 'el-icon-delete',
+                      type: 'text',
+                      size: 'small',
+                      fun: this.deleteHandle
+                    },{
+                      text: 'xx',
+                      icon: 'el-icon-delete',
+                      type: 'text',
+                      size: 'small',
+                      // fun: this.deleteHandle
+                    }
+                  ],
+                  operatorConfig: {
+                    fixed: 'right',
+                    label: '鎿嶄綔',
+                    width: 120,
+                    minWidth: 120
+                  }
             },
        }
     },
-    medthods: {},
-//     computed: {
-//     ...mapGetters(['permissions'])
-//   },
     components: {
-    ttable
+        ttable,
+        packfrom,
+        packfromadd
+        },
+        watch: {
+          // renovate() {
+          //   if (this.innerVisible = false) {
+          //     this.$nextTick(() => {
+          //       this.getData()
+          //     })
+          //   }
+          // }
+      },
+    methods: {
+       // 鑾峰彇鏁版嵁鍒楄〃
+      getData() {
+        this.$refs.processconfiguration.refreshData()
+      },
+      //add
+      addOrUpdateHandle(){
+        this.addOrUpdateVisible = true
+      },
+      //鍒犻櫎
+      deleteHandle(row){
+        dropById({id:row.id}).then((res) =>{
+          this.getData()
+          this.$message.error('鍒犻櫎鎴愬姛')
+        })
+      },
+      handleCurrentChange(row){
+        console.log(row,"id");
+        this.packageBoxId = {
+          packageBoxId:row[0].id
+        }
+        this.goid = row[0].id
+        list({packageBoxId:row[0].id}).then((res) =>{
+          console.log(res,"nihaoa");
+          this.testStandardParams = res.data.data
+        })
+      },
+      //璇︽儏娣诲姞
+      relateOperationParam(){
+        this.increase = true
+      },
+      preserve(datalist){
+        console.log(datalist);
+        this.testStandardParams = datalist
+
+      },
+      addpreserve(){
+        console.log(this.testStandardParams,"淇濆瓨鏁版嵁");
+         this.testStandardParams.forEach(el => {
+              el.packageBoxId =this.goid
+         });
+        console.log(this.testStandardParams,"niaho");
+        saveList(this.testStandardParams).then((res) =>{
+          console.log(res,"淇濆瓨鐨�");
+          this.$message.success('淇濆瓨鎴愬姛')
+          this.testStandardParams
+        })
+      },
+      deleteadd(row){
+          console.log(row,"");
+          deledata({id:row.id}).then((res)=>{
+          this.$message.success('鍒犻櫎鎴愬姛')
+          this.testStandardParams
+          })
+      }
     },
+    computed: {
+  },
 }
 </script>
\ No newline at end of file

--
Gitblit v1.9.3