From 7a5de6ba2d6a750f09d6c0b558b8d05afcb1c633 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 07 六月 2024 16:47:08 +0800
Subject: [PATCH] 优化功能

---
 src/components/do/b1-ins-order/add.vue                             |   44 +++++++++++++-
 src/main.js                                                        |    4 
 src/components/do/b1-inspect-order-plan/Inspection.vue             |    6 +
 src/components/do/b3-work-time-management/work-time-management.vue |   55 +++++++++++++++++-
 src/components/do/b3-work-time-management/work-time-statistics.vue |   22 ++++++
 5 files changed, 119 insertions(+), 12 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 64dbde7..f366463 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -451,7 +451,7 @@
           <el-col class="search_thing" :span="22">
             <div class="search_label"><span class="required-span" v-if="addObj.type == 2">* </span>鎸囨淳浜哄憳锛�</div>
             <div class="search_input">
-              <el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+              <el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" filterable  style="width: 100%;">
                 <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
@@ -521,9 +521,29 @@
           </el-col>
           <el-col style="margin-top: 6px;">
             <el-col v-for="(a,ai) in bsm2Val2" :key="ai">
-              <el-col :span="10" class="pairing">{{a[0]}}</el-col>
+              <el-col :span="10">
+                <el-select v-model="a[0]" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+                  <el-option
+                    v-for="(item,index) in sampleList"
+                    :key="index"
+                    :label="index+1"
+                    :value="index+1">
+                  </el-option>
+                </el-select>
+              </el-col>
+              <!-- <el-col :span="10" class="pairing">{{a[0]}}</el-col> -->
               <el-col :span="4" class="pairing" style="border: 0;color: rgba(0, 0, 0, 0.2);">鈥斺��</el-col>
-              <el-col :span="10" class="pairing">{{a[1]}}</el-col>
+              <el-col :span="10">
+                <el-select v-model="a[1]" placeholder="璇烽�夋嫨" size="small" style="width: 100%;">
+                  <el-option
+                    v-for="(item,index) in sampleList"
+                    :key="index"
+                    :label="index+1"
+                    :value="index+1">
+                  </el-option>
+                </el-select>
+              </el-col>
+              <!-- <el-col :span="10" class="pairing">{{a[1]}}</el-col> -->
             </el-col>
           </el-col>
         </el-row>
@@ -1105,6 +1125,8 @@
           this.sampleList.push(this.HaveJson(this.sample))
           this.count++
         }
+        this.computationalPairing(this.sampleList.length)
+        this.bsm2Val2 = this.HaveJson(this.bsm2Val3)
       },
       selectSample(val) {
         this.sampleIds = []
@@ -1576,6 +1598,22 @@
             this.$message.error('鐗规畩椤圭洰蹇呴』澶勭悊')
             return
           }
+          let set = new Set()
+          for (let i=0;i<this.bsm2Val2.length;i++){
+            let num0 = set.size
+            set.add(JSON.stringify(this.bsm2Val2[i]))
+            let num1 = set.size
+            if(num1==num0){
+              this.$message.error('鍏宠仈椤圭洰涓嶈兘閲嶅')
+              return
+            }
+            set.add(JSON.stringify(this.bsm2Val2[i].reverse()))
+            let num2 = set.size
+            if(num1==num2){
+              this.$message.error('鍏宠仈椤圭洰涓嶈兘閲嶅')
+              return
+            }
+          }
         }
         done()
       },
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 0385916..d97b387 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -359,6 +359,7 @@
       v-show="state==1&&fileAdd"
       :on-success="handleSuccessUp" :show-file-list="false"
         accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' :headers="headers" :on-change="beforeUpload"
+        style="width: 80px !important;"
         :on-error="onError" ref='upload'>
         <el-button size="small" type="primary">闄勪欢涓婁紶</el-button></el-upload>
       <ValueTable class="value-table" ref="fileList" :url="$api.insOrderPlan.getFileList"
@@ -636,6 +637,10 @@
               this.insOrder.typeName = m.label
             }
           })
+          this.loading = false
+          if(!res.data.sampleProduct||res.data.sampleProduct.length==0){
+            return this.$message.error('璇ヤ换鍔℃病鏈夋牱鍝佷俊鎭�')
+          }
           this.sampleProduct = res.data.sampleProduct
           this.currentSample = this.HaveJson(this.sampleProduct[0])
           let list = await this.getCurrentProduct(this.currentSample.id,0)
@@ -652,7 +657,6 @@
           })
           if (this.currentSample.index == undefined) this.currentSample['index'] = 1
           let bushing = this.currentSample.bushing
-          this.loading = false
           // this.handleTableData()
           this.getTableLists();
           this.componentData.currentId = val;
diff --git a/src/components/do/b3-work-time-management/work-time-management.vue b/src/components/do/b3-work-time-management/work-time-management.vue
index 86d3e07..1ebdf62 100644
--- a/src/components/do/b3-work-time-management/work-time-management.vue
+++ b/src/components/do/b3-work-time-management/work-time-management.vue
@@ -63,10 +63,12 @@
       </el-radio-group>
       <div style="display: flex;align-items: center;">
         <p style="font-size: 14px;margin-right: 30px;">
-          鎬诲伐鏃舵眹鎬伙細<span style="font-size: 16px;color: #3A7BFA;">{{ (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��'])? (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��']):0 }}</span>&nbsp;&nbsp;&nbsp;&nbsp;浜ч噺宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;">{{totalInfo['浜ч噺宸ユ椂姹囨��']?totalInfo['浜ч噺宸ユ椂姹囨��']:0}}</span>&nbsp;&nbsp;&nbsp;&nbsp;杈呭姪宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;">{{totalInfo['杈呭姪宸ユ椂姹囨��']?totalInfo['杈呭姪宸ユ椂姹囨��']:0}}</span>
+          鎬诲伐鏃舵眹鎬伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{ (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��'])? (totalInfo['浜ч噺宸ユ椂姹囨��']+totalInfo['杈呭姪宸ユ椂姹囨��']):0 }}</span>&nbsp;&nbsp;&nbsp;&nbsp;浜ч噺宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['浜ч噺宸ユ椂姹囨��']?totalInfo['浜ч噺宸ユ椂姹囨��']:0}}</span>&nbsp;&nbsp;&nbsp;&nbsp;杈呭姪宸ユ椂姹囨�伙細<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['杈呭姪宸ユ椂姹囨��']?totalInfo['杈呭姪宸ユ椂姹囨��']:0}}</span>
         </p>
-        <el-button size="small" type="primary" style="margin-right: 16px;" @click="openAdd" v-show="currentTable == 'ValueTable0'">褰曞叆鏁版嵁</el-button>
-        <el-button size="small" type="primary" @click="handleOut" :loading="outLoading">瀵� 鍑�</el-button>
+        <el-button size="small" type="primary" style="margin-right: 16px;" @click="openAdd" v-show="currentTable == 'ValueTable0'&&add">褰曞叆鏁版嵁</el-button>
+        <el-button size="small" type="primary"
+        v-if="down"
+        @click="handleOut" :loading="outLoading">瀵� 鍑�</el-button>
       </div>
     </div>
     <div class="table">
@@ -216,6 +218,8 @@
   data () {
     return{
       entity:{},
+      down:false,
+      add:false,
       componentData: {
 					entity: {
 						week: null,
@@ -394,7 +398,7 @@
           label:'宸叉壒鍑�'
         },
       ],
-      totalInfo:{},
+      totalInfo:null,
       auxiliaryWorking:null,
       outLoading:false
     }
@@ -461,6 +465,49 @@
     this.componentData.selectField.weekDay.select = this.weekList
   },
   methods:{
+    getPower(){
+      let power = JSON.parse(sessionStorage.getItem('power'))
+        let del = false
+        let down = false
+        let add = false
+        let up = false
+        let check = false
+        let ratify = false
+        for (var i = 0; i < power.length; i++) {
+					if (power[i].menuMethod == 'exportWorkingHours') {
+						down = true
+					}
+					if (power[i].menuMethod == 'deleteAuxiliaryWorkingHoursDay') {
+						del = true
+					}
+          if (power[i].menuMethod == 'insertAuxiliaryWorkingHoursDay') {
+						add = true
+					}
+          if (power[i].menuMethod == 'updateAuxiliaryWorkingHoursDay') {
+						up = true
+					}
+          if (power[i].menuMethod == 'check') {
+						check = true
+					}
+          if (power[i].menuMethod == 'approve') {
+						ratify = true
+					}
+				}
+        if (!approve) {
+					this.componentData.do.splice(3, 1)
+				}
+        if (!check) {
+					this.componentData.do.splice(2, 1)
+				}
+        if (!up) {
+					this.componentData.do.splice(1, 1)
+				}
+        if (!del) {
+					this.componentData.do.splice(0, 1)
+				}
+        this.down = down
+        this.add = add
+    },
     getYearAndMonthAndDays(date){
       return getYearAndMonthAndDays(date)
     },
diff --git a/src/components/do/b3-work-time-management/work-time-statistics.vue b/src/components/do/b3-work-time-management/work-time-statistics.vue
index 380987a..710d6f7 100644
--- a/src/components/do/b3-work-time-management/work-time-statistics.vue
+++ b/src/components/do/b3-work-time-management/work-time-statistics.vue
@@ -40,8 +40,8 @@
 				<el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
 			</div>
       <div class="search_thing">
-        <el-button size="small" type="primary"  @click="handleDown" v-show="currentTable == 'value0'" :loading="outLoading">瀵� 鍑�</el-button>
-        <el-button size="small" type="primary"  @click="handleUp" v-show="currentTable == 'value1'">瀵� 鍏�</el-button>
+        <el-button size="small" type="primary"  @click="handleDown" v-show="currentTable == 'value0'&&down" :loading="outLoading">瀵� 鍑�</el-button>
+        <el-button size="small" type="primary"  @click="handleUp" v-show="currentTable == 'value1'&&up">瀵� 鍏�</el-button>
       </div>
 		</div>
     <el-radio-group v-model="currentTable" size="small" :key="'111'" style="margin-top: 10px;">
@@ -78,6 +78,8 @@
   },
   data () {
     return{
+      down:false,
+      up:false,
       componentData: {
 					entity: {
 						month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
@@ -139,6 +141,7 @@
     this.getUsers()
     this.entityCopy = this.HaveJson(this.componentData.entity);
     this.entityCopy0 = this.HaveJson(this.componentData0.entity);
+    this.getPower()
   },
   methods: {
     refresh(){
@@ -207,6 +210,21 @@
     },
     handleUp(){
       this.$refs.ValueTable1.openUpload()
+    },
+    getPower(){
+      let power = JSON.parse(sessionStorage.getItem('power'))
+        let up = false
+        let down = false
+        for (var i = 0; i < power.length; i++) {
+					if (power[i].menuMethod == 'exportOriginalHours') {
+						down = true
+					}
+					if (power[i].menuMethod == 'upload') {
+						up = true
+					}
+				}
+        this.down = down
+        this.up = up
     }
   }
 }
diff --git a/src/main.js b/src/main.js
index bc6ea8f..799f9b5 100644
--- a/src/main.js
+++ b/src/main.js
@@ -15,8 +15,8 @@
 Vue.prototype.PROJECT = '妫�娴嬩腑蹇�' //椤圭洰鍚嶇О锛氭娴嬩腑蹇冦�佽澶囩數缂�
 //鏈湴
 Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
-const javaApi = 'http://192.168.11.200:8001';//鏉�
-// const javaApi = 'http://192.168.144.249:8001';//寮�
+const javaApi = 'http://192.168.144.200:8001';//鏉�
+// const javaApi = 'http://192.168.11.249:8001';//寮�
 // const javaApi = 'http://192.168.11.2:8001';//鏌�
 //  const javaApi = 'http://127.0.0.1:8001';//鏅�
 // const javaApi = 'http://114.132.189.42:1234';//娴嬭瘯鏈�

--
Gitblit v1.9.3