From b46bc2dba51a3885a68e4c58316b41a31ea16bb2 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 14 二月 2023 13:35:03 +0800
Subject: [PATCH] 1.存货档案修改

---
 src/views/zzmx/wlqd.vue |  131 +++++++++++++++++++++++++------------------
 1 files changed, 77 insertions(+), 54 deletions(-)

diff --git a/src/views/zzmx/wlqd.vue b/src/views/zzmx/wlqd.vue
index ff35bc9..f9acc99 100644
--- a/src/views/zzmx/wlqd.vue
+++ b/src/views/zzmx/wlqd.vue
@@ -2,8 +2,8 @@
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
       <div class="bodyTopButtonGroup" style="justify-content: space-between">
-        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <!--        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
+        <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+        <el-button v-waves icon="el-icon-download" @click="upload">瀵煎叆</el-button>
       </div>
 
       <div class="bodyTopFormGroup">
@@ -12,10 +12,10 @@
           :model="form"
           label-width="100px"
           inline
-          style="display: flex;justify-content: space-between"
+          style="display: flex;"
         >
           <div class="elForm">
-            <el-form-item label-width="70px" label="姣嶄欢缂栫爜" style=" display: flex;">
+            <el-form-item label="姣嶄欢缂栫爜" style=" display: flex;">
               <el-input v-model="form.parentpartcode" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
             <el-form-item label="姣嶄欢鍚嶇О" style=" display: flex;">
@@ -34,7 +34,7 @@
                 />
               </el-select>
             </el-form-item>
-            <el-form-item v-show="isExpandForm" label-width="70px" label="鐗堟湰缂栧彿" style=" display: flex;">
+            <el-form-item v-show="isExpandForm" label="鐗堟湰缂栧彿" style=" display: flex;">
               <el-input v-model="form.version" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
             <el-form-item v-show="isExpandForm" label="鍒涘缓浜哄憳" style=" display: flex;">
@@ -64,9 +64,9 @@
               </el-select>
             </el-form-item>
           </div>
-          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened?'5%':'10%'}">
-            <el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
-            <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}">
+            <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
+            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
         </el-form>
         <div
@@ -159,11 +159,11 @@
           >
             <template slot-scope="{row}">
               <div v-if="row.status==='Y'">
-                <svg-icon icon-class="circleYes" style="margin-right: 2px" />
+                <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
                 鏄�
               </div>
               <div v-if="row.status==='N'">
-                <svg-icon icon-class="circleNo" style="margin-right: 2px" />
+                <i class="el-icon-info" style="margin-right: 2px" />
                 鍚�
               </div>
             </template>
@@ -172,6 +172,7 @@
             prop="startdate"
             label="鍚敤鏃ユ湡"
             width="110"
+            show-tooltip-when-overflow
             sortable="custom"
           >
             <template slot-scope="{row}">
@@ -196,6 +197,7 @@
           <el-table-column
             prop="lm_date"
             label="鍒涘缓鏃堕棿"
+            show-tooltip-when-overflow
             width="110"
             sortable="custom"
           >
@@ -212,15 +214,16 @@
             <template slot-scope="{row}">
               <div class="operationClass">
                 <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
-                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+                  <i :style="{color:$store.state.settings.theme}" class="el-icon-edit-outline" @click="edit('edit',row)" />
                 </el-tooltip>
                 <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
-                  <i class="el-icon-delete" @click="del(row)" />
+                  <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
                 </el-tooltip>
                 <el-tooltip class="item" effect="dark" content="棰勮" placement="top">
                   <i
                     class="el-icon-view"
-                    style="margin-left:15px;cursor: pointer;color:#42b983  "
+                    :style="{color:$store.state.settings.theme}"
+                    style="margin-left:15px;cursor: pointer;"
                     @click="edit('preview',row)"
                   />
                 </el-tooltip>
@@ -242,6 +245,7 @@
     </div>
 
     <el-dialog
+      v-el-drag-dialog
       :title="operation==='add'?'鏂板':(operation==='edit'?'缂栬緫':'棰勮')"
       :visible.sync="dialogVisible"
       width="1100px"
@@ -251,7 +255,7 @@
       @close="handleClose"
     >
       <div>
-        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 20px 0" />姣嶄欢淇℃伅锛�
+        <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 20px 0" />姣嶄欢淇℃伅锛�
       </div>
       <div style="width: 800px;">
         <el-form
@@ -269,6 +273,7 @@
               placeholder="璇烽�夋嫨"
               :popper-append-to-body="false"
               :disabled="operation!=='add'"
+              filterable
               @change="partSelectChange"
             >
               <el-option
@@ -284,6 +289,7 @@
               v-model="dialogForm.parentpartname"
               style="width: 200px"
               placeholder="璇烽�夋嫨"
+              filterable
               :disabled="operation!=='add'"
               :popper-append-to-body="false"
               @change="partSelectChange"
@@ -312,24 +318,10 @@
             <!--            />-->
             <!--          </el-select>-->
           </el-form-item>
-          <el-form-item label="璁¢噺鍗曚綅" prop="uomcode">
-            <el-select
-              v-model="dialogForm.uomcode"
-              disabled
-              style="width: 200px"
-              placeholder="璇烽�夋嫨"
-              :popper-append-to-body="false"
-            >
-              <el-option
-                v-for="item in openTypeArr"
-                :key="item.partcode"
-                :label="item.uom_code"
-                :value="item.partcode"
-              />
-            </el-select>
-            <!--            <el-input v-model="dialogForm.uomcode" readonly style="width: 200px" />-->
+          <el-form-item label="璁¢噺鍗曚綅">
+            <el-input v-model="dialogForm.uomname" disabled style="width: 200px" />
           </el-form-item>
-          <!--          <el-form-item label="瀛樿揣绫诲瀷" prop="uomcode">-->
+          <!--          <el-form-item label="瀛樿揣绫诲瀷">-->
           <!--            <el-input v-model="dialogForm.chlx" readonly style="width: 200px" />-->
           <!--          </el-form-item>-->
           <el-form-item label="鍩虹鏁伴噺" prop="quantity">
@@ -344,6 +336,7 @@
             <el-select
               v-model="dialogForm.status"
               style="width: 200px"
+              filterable
               placeholder="璇烽�夋嫨"
               :disabled="operation==='preview'"
               :popper-append-to-body="false"
@@ -374,10 +367,11 @@
       </div>
 
       <div>
-        <i class="el-icon-s-operation" style="color:#42b983;margin: -20px 10px 10px 0" />瀛愪欢淇℃伅锛�
+        <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" style="margin: -20px 10px 10px 0" />瀛愪欢淇℃伅锛�
       </div>
       <el-button
         v-if="operation!=='preview'"
+        v-waves
         type="primary"
         style="margin-left: 20px;margin-bottom: 10px;"
         icon="el-icon-circle-plus-outline"
@@ -412,6 +406,7 @@
             <el-select
               v-if="row.isVisible===1"
               v-model="row.SMATERIRL_CODE"
+              filterable
               placeholder="璇烽�夋嫨"
               @change="val=>tableChange(val,row)"
             >
@@ -428,7 +423,7 @@
         <el-table-column
           prop="SMATERIRL_NAME"
           label="瀛愪欢鍚嶇О"
-
+          filterable
           show-tooltip-when-overflow
         >
 
@@ -456,14 +451,16 @@
           show-tooltip-when-overflow
         />
         <el-table-column
-          prop="uomcode"
+          prop="uomname"
           label="璁¢噺鍗曚綅"
           width="110"
+          show-tooltip-when-overflow
         />
         <el-table-column
           prop="BASE_QUANTITY"
           label="鍩烘湰鐢ㄩ噺"
           width="110"
+          show-tooltip-when-overflow
         >
           <template slot-scope="{row}">
             <el-input
@@ -479,6 +476,7 @@
         <el-table-column
           prop="LOSS_QUANTITY"
           label="鎹熻�楃巼%"
+          show-tooltip-when-overflow
           width="110"
         >
           <template slot-scope="{row}">
@@ -495,15 +493,23 @@
         <el-table-column
           prop="TOTAL_QUANTITY"
           label="瀹為檯鐢ㄩ噺"
+          show-tooltip-when-overflow
           width="110"
         />
         <el-table-column
           prop="PN_TYPE"
           label="灞炴��"
+          show-tooltip-when-overflow
           width="110"
         >
           <template slot-scope="{row}">
-            <el-select v-if="row.isVisible===1" v-model="row.PN_TYPE" placeholder="璇烽�夋嫨">
+            <el-select
+              v-if="row.isVisible===1"
+              v-model="row.PN_TYPE"
+              :disabled="row.PN_TYPE==='Z'"
+              placeholder="璇烽�夋嫨"
+              @change="val=>changeType(val,row)"
+            >
               <el-option
                 v-for="item in sxArr"
                 :key="item.code"
@@ -522,10 +528,10 @@
         >
           <template slot-scope="{row}">
             <div class="operationClass">
-              <el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">淇濆瓨</el-button>
-              <el-button v-if="row.isVisible===1" type="text" @click="cancelRow(row)">鍙栨秷</el-button>
-              <el-button v-if="row.isVisible===0" type="text" @click="editRow(row)">缂栬緫</el-button>
-              <el-button v-if="row.isVisible===0" type="text" @click="delRow(row)">鍒犻櫎</el-button>
+              <el-button v-if="row.isVisible===1" v-waves type="text" @click="saveRow(row)">纭畾</el-button>
+              <el-button v-if="row.isVisible===1" v-waves type="text" @click="cancelRow(row)">鍙栨秷</el-button>
+              <el-button v-if="row.isVisible===0" v-waves type="text" @click="editRow(row)">缂栬緫</el-button>
+              <el-button v-if="row.isVisible===0" v-waves type="text" @click="delRow(row)">鍒犻櫎</el-button>
             </div>
           </template>
         </el-table-column>
@@ -533,15 +539,16 @@
 
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
-          <el-button v-if="operation==='preview'" @click="dialogVisibleCancel">杩� 鍥�</el-button>
-          <el-button v-if="operation!=='preview'" @click="dialogVisibleCancel">鍙� 娑�</el-button>
+          <el-button v-if="operation==='preview'" v-waves @click="dialogVisibleCancel">杩� 鍥�</el-button>
+          <el-button v-if="operation!=='preview'" v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
           <el-button
             v-if="operation!=='preview'"
+            v-waves
             :loading="$store.state.app.buttonIsDisabled"
             :disabled="$store.state.app.buttonIsDisabled"
             type="primary"
             @click="dialogVisibleConfirm"
-          >纭� 瀹�</el-button>
+          >淇濆瓨</el-button>
         </div>
       </span>
     </el-dialog>
@@ -571,12 +578,15 @@
   PartSelect,
   StockTypeSelect
 } from '@/api/zzmx'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
 
 export default {
   name: 'Zzjg',
   components: {
     Pagination, ImportPicker
   },
+  directives: { elDragDialog, waves },
   data() {
     return {
       mouseHoverType: 'mouseout',
@@ -612,6 +622,7 @@
         parentpartname: '',
         parentpartspec: '',
         uomcode: '',
+        uomname: '',
         // chlx: '',
         quantity: '',
         status: '',
@@ -635,9 +646,6 @@
         quantity: [
           { required: true, message: '璇疯緭鍏ュ熀纭�鏁伴噺', trigger: ['blur', 'change'] }
         ],
-        // uomcode: [
-        //   { required: true, message: '璇疯緭鍏ヨ閲忓崟浣�', trigger: ['blur', 'change'] }
-        // ],
         // version: [
         //   { required: true, message: '璇疯緭鍏ョ増鏈彿', trigger: ['blur', 'change'] }
         // ],
@@ -654,8 +662,8 @@
         { code: 'F', name: '杈呮枡' }
       ],
 
-      title_value: '鏁版嵁瀵煎叆 / 鐐规閮ㄤ綅',
-      code: '4',
+      title_value: '鏁版嵁瀵煎叆 / 鐗╂枡娓呭崟',
+      code: '21',
       shows: false
 
     }
@@ -678,7 +686,6 @@
     handleRequest() {
       this.getBoIventorySelect().then(res => {
         if (res.code === '200') {
-          // this.getPartSelect()
           this.getStockTypeSelect()
         }
       })
@@ -726,7 +733,8 @@
       this.dialogForm.parentpartcode = res.partcode
       this.dialogForm.parentpartname = res.partname
       this.dialogForm.parentpartspec = res.partspec
-      this.dialogForm.uomcode = res.uom_code
+      // this.dialogForm.uomcode = res.uom_code
+      this.dialogForm.uomname = res.uom_name
 
       if (this.PartSelectArrTemp.length > 0) {
         this.PartSelectArr.unshift(this.PartSelectArrTemp[0])
@@ -790,7 +798,6 @@
       this.getPartSelect()
 
       this.dialogForm.startdate = handleDatetime(new Date())
-      console.log(this.dialogForm.startdate, 7)
     },
     // 淇敼鎸夐挳
     async edit(operation, row) {
@@ -816,7 +823,8 @@
             SMATERIRL_CODE: item.partcode,
             SMATERIRL_NAME: item.partname,
             SMATERIRL_SPEC: item.partspec,
-            uomcode: item.uom_name,
+            uomcode: item.uom_code,
+            uomname: item.uom_name,
             BASE_QUANTITY: item.base_quantity,
             LOSS_QUANTITY: item.loss_quantity,
             TOTAL_QUANTITY: item.total_quantity,
@@ -831,6 +839,7 @@
           this.dialogForm.parentpartname = row.partname
           this.dialogForm.parentpartspec = row.partspec
           this.dialogForm.uomcode = row.uom_code
+          this.dialogForm.uomname = row.uom_name
           this.dialogForm.startdate = row.startdate
           this.dialogForm.status = row.status
           this.dialogForm.quantity = row.quantity
@@ -854,10 +863,17 @@
       row.SMATERIRL_NAME = res.partname
       row.SMATERIRL_SPEC = res.partspec
       row.uomcode = res.uom_code
+      row.uomname = res.uom_name
 
       // this.PartSelectArr.forEach((item, index) => {
       //   this.PartSelectArr.splice(index, 1)
       // })
+    },
+    // 鐗╂枡娓呭崟灞炴�х被鍨嬪�兼敼鍙樻椂瑙﹀彂
+    changeType(val, row) {
+      this.dialogTableDataArr.forEach(item => {
+        item.PN_TYPE = item.SMATERIRL_CODE === row.SMATERIRL_CODE ? 'Z' : 'F'
+      })
     },
     addDialog() {
       if (this.dialogTableDataArr.find(item => item.isVisible === 1)) {
@@ -874,10 +890,11 @@
         SMATERIRL_NAME: '',
         SMATERIRL_SPEC: '',
         uomcode: '',
+        uomname: '',
         BASE_QUANTITY: '',
         LOSS_QUANTITY: '',
         TOTAL_QUANTITY: '',
-        PN_TYPE: ''
+        PN_TYPE: this.dialogTableDataArr.length === 0 ? 'Z' : 'F'
       })
     },
     saveRow(row) {
@@ -906,6 +923,10 @@
       })
     },
     delRow(row) {
+      if (row.PN_TYPE === 'Z') {
+        return this.$message.info('涓绘枡涓嶅彲鍒犻櫎锛�')
+      }
+
       this.PartSelectArrAll.forEach(item => {
         if (item.partcode === row.SMATERIRL_CODE) {
           this.PartSelectArr.unshift(item)
@@ -946,6 +967,7 @@
       this.dialogForm.parentpartname = ''
       this.dialogForm.parentpartspec = ''
       this.dialogForm.uomcode = ''
+      this.dialogForm.uomname = ''
       // this.dialogForm.chlx = ''
       this.dialogForm.quantity = ''
       this.dialogForm.status = ''
@@ -974,7 +996,7 @@
             parentpartcode: this.dialogForm.parentpartcode,
             parentpartname: this.dialogForm.parentpartname,
             parentpartspec: this.dialogForm.parentpartspec,
-            uomcode: this.dialogForm.uomcode,
+            uomcode: this.PartSelectArrTemp.length > 0 ? this.PartSelectArrTemp[0].uom_code : this.dialogForm.uomcode,
             quantity: this.dialogForm.quantity,
             status: this.dialogForm.status,
             startdate: this.dialogForm.startdate,
@@ -982,7 +1004,8 @@
             worklist: this.dialogTableDataArr,
             opertype: this.operation === 'add' ? 'Add' : 'Update'
           }
-          console.log(data, 89)
+          // console.log(data)
+
           this.$store.state.app.buttonIsDisabled = true
           AddUpdateBoIventory(data).then(res => {
             if (res.code === '200') {

--
Gitblit v1.9.3