luobang 6 месяцев назад
Родитель
Сommit
f2ab23bc75

+ 3 - 3
cors.js

@@ -205,7 +205,7 @@ module.exports = {
   },
   // devModules: ['index', 'reportForm','workFlow', 'systemConfig', 'demo', 'taskManagement', 'batchManagement', 'programManagement', 'entrustedManagement', 'screeningTests','sampleManagement', 'sampleManager', 'samplePreparationTask','approveManagement','weightingManagement','testAnalysis','decideManagement','commodityInspection', 'exceptionManagement', 'certificateManagement', 'standardManagement', 'resourceManager']
   //devModules: ['reportForm', 'screeningTests', 'index',  'entrustedManagement','measurementDataManagement', 'approveManagement', 'testAnalysis', 'resourceManager', 'taskManagement']
-//  devModules: ['all']
-//  devModules:['index', 'standardManagement']
- devModules:['all']
+//  devModules: ['all
+ devModules:['index', 'entrustedManagement']
+//  devModules:['all']
 }

+ 104 - 16
src/views/entrustedManagement/components/inspectionMaterials/inspectionMaterials.vue

@@ -68,6 +68,8 @@
                 <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
                 检验委托信息
               </div>
+              <el-button icon="el-icon-search" style="height: 100%;margin-left: -220px;margin-top: 28px;" type="goon"
+                size="mini" @click="countList">物料统计</el-button>
               <div>
                 <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini"
                   v-privilege="activeMenu + 'tempAdd'" @click="addData">新增临时委托</el-button>
@@ -85,6 +87,8 @@
                   v-privilege="activeMenu + 'submit'" @click="disable">停用</el-button>
                 <el-button icon="el-icon-printer" type="goon" size="mini" :loading="printLoading"
                   @click="printQRCode">打印标签</el-button>
+                <el-button icon="el-icon-download" type="goon" size="mini" :loading='exportFileLoading'
+                  @click="exportFile">导出检测委托书</el-button>
               </div>
             </div>
             <div class="common-table-div" style="margin-bottom:0;margin-top:0">
@@ -329,10 +333,11 @@
             </div>
             <div class="common-table-div" style="margin-bottom:0;margin-top:0">
               <el-table v-loading="dataLoading2" ref="dataTable2" border :height="height_bot" @row-click='saveData'
-                highlight-current-row :data="table.list2" :icore-filter-flag="icoreFilterFlag"
-                :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName2"
-                :summary-method="getSummaries" show-summary>
+                @selection-change="selectData" highlight-current-row :data="table.list2"
+                :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle"
+                :cell-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
                 <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
+                <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
                 <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="anlyItemNo"
                   label="分析项目编号" align="center"></el-table-column>
                 <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="anlyItemName"
@@ -447,6 +452,14 @@
     <div is="alertComponets" :showFlag="showFlag" :Params="Params" @refresh='refresh'></div>
     <div is="alertComponets3" :showFlag3="showFlag3" :Params="Params" @refresh='refresh'></div>
     <div is="alertComponets2" :showFlag2="showFlag2" :Params="Params" :Params2="Params2" @refresh='refresh2'></div>
+    <el-dialog @close="closeDialog" :visible.sync="dialogTableCount" width="80%">
+      <el-table id="excelTable3" ref="dataTable3" border :data="tableCount">
+        <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="MAT_NAME" label="物料编号"
+          align="center"></el-table-column>
+        <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="COUNT" label="个数"
+          align="center"></el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -492,6 +505,7 @@ export default {
       icoreFilterFlag: true,
       showFlag3: false,
       printLoading: false,
+      exportFileLoading: false,
       page: {
         pageSize: 200,
         pageNum: 1,
@@ -503,12 +517,15 @@ export default {
         totalPage: 0
       },
       savaDep: {},
+      selectDataList: [],
       list: [],
       entrId: '',
       showFlag: false,
       Params: {},
       showFlag2: false,
       Params2: {},
+      tableCount: [],
+      dialogTableCount: false,
       entrOrgNameType: [],
       entrOrgNameType1: [],
       sampleTypeNameType: [],
@@ -759,6 +776,9 @@ export default {
       this.mainData();
       this.mainData1();
     },
+    selectData(val) {
+      this.selectDataList = val;
+    },
     saveData(row) {
       this.savaDep = Object.assign({}, row)
     },
@@ -776,8 +796,8 @@ export default {
       this.Params = this.saveRow
     },
     deleteData2() {
-      if (JSON.stringify(this.savaDep) === "{}") {
-        this.$message.warning('请点击选中一条检验委托信息数据')
+      if (this.selectDataList.length == 0) {
+        this.$message.warning('请选中计划检验项目信息数据!')
         return
       }
       if (this.saveRow.stateFlag == 1) {
@@ -789,17 +809,19 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        this.axios.post('pass/testManagement/v1/limstestentrustds/deleteLimsTestEntrustD?id=' + this.savaDep.id, { individualType: 'json' }).then(res => {
-          if (res.succeed) {
-            this.dialogTableVisible = false;
-            this.$message.success('删除成功');
-            this.depData(this.entrId)
-          } else {
-            this.$message.error(res.message)
-          }
-        }).catch(e => {
-          this.$message.error(e.message)
-        })
+        for (let i = 0; i < this.selectDataList.length; i++) {
+          this.axios.post('pass/testManagement/v1/limstestentrustds/deleteLimsTestEntrustD?id=' + this.selectDataList[i].id, { individualType: 'json' }).then(res => {
+            if (res.succeed) {
+              this.dialogTableVisible = false;
+              this.$message.success('删除成功');
+              this.depData(this.entrId)
+            } else {
+              this.$message.error(res.message)
+            }
+          }).catch(e => {
+            this.$message.error(e.message)
+          })
+        }
       }).catch(() => { });
     },
     searchData() {
@@ -847,6 +869,34 @@ export default {
         this.$message.error(e.message);
       });
     },
+    closeDialog() {
+      this.dialogTableCount = false;
+      this.tableCount = [];
+    },
+    countList() {
+      let obj = {
+        object: {
+          entrOrgNo: this.search.planCompanyNo, // 委托单位
+          sampleTypeCode: 480101,
+          matName: this.search.matName,
+          suppName: this.search.suppName,
+          carNo: this.search.carNo,
+          contractNo: this.search.contractNo,
+          planNo: this.search.planNo,
+          validFlag: '1',
+          stateFlag: '1'
+        },
+        list: [this.search.testTypeCode],
+        'startTime': this.startTime,
+        'endTime': this.endTime
+      }
+      this.axios.post('pass/testManagement/v1/limstestentrusts/queryLimsTestEntrustCount', obj, { individualType: 'json' }).then(res => {
+        this.tableCount = res.data
+        this.dialogTableCount = true;
+      }).catch(e => {
+        this.$message.error('查询错误!');
+      });
+    },
     mainData() {
       this.saveRow = {}
       this.dataLoading = true;
@@ -1030,6 +1080,7 @@ export default {
       this.axios.post('pass/testManagement/v1/limstestentrusts/cancel', ids, { individualType: 'json' }).then(res => {
         if (res.code == 0 || res.code == 200) {
           this.$message.success(res.message);
+          this.removeNumber();
           this.mainData();
           this.mainData1();
         } else {
@@ -1041,6 +1092,43 @@ export default {
         this.$message.error(e.message)
       })
     },
+    exportFile() {
+      if (this.selectRows.length == 0) {
+        this.$message.warning('请勾选您要导出的一条数据!')
+        return
+      }
+      this.exportFileLoading = true;
+      let str = [];
+      let flag = false
+      this.selectRows.forEach(s => {
+        str.push(s.entrId)
+        if (s.stateFlag == '0') {
+          flag = true
+        }
+      })
+      if (flag) {
+        this.$message.warning('请勾选已提交的数据!')
+        return
+      }
+      this.axios.get('pass/testManagement/v1/limstestentrusts/newJywts/' + str, { responseType: 'blob' }, { headers: { 'content-type': 'application/x-www-form-urlencoded' } }).then(res => {
+        if (res) {
+          let blob = new Blob([res]);
+          let elink = document.createElement('a');
+          elink.download = "BBWXCLJC-4-08-03.docx";
+          elink.style.display = 'none';
+          elink.target = "_blank";
+          elink.href = URL.createObjectURL(blob);
+          document.body.appendChild(elink);
+          elink.click();
+          URL.revokeObjectURL(elink.href); // 释放URL对象
+          document.body.removeChild(elink);
+          this.exportFileLoading = false;
+        }
+      }).catch(e => {
+        this.exportFileLoading = false;
+        return this.$message.error(e.message)
+      })
+    },
     // 打印条形码
     printQRCode() {
       if (this.selectRows.length == 0) {

+ 113 - 19
src/views/entrustedManagement/components/inspectionMaterials/inspectionMaterialsGit.vue

@@ -39,9 +39,16 @@
             style="width: 120px;margin-right: 10px;"></el-input>
         </el-form-item>
         <el-form-item label="委托日期">
-          <el-date-picker v-model="search.entrTime" type="daterange" range-separator="至" start-placeholder="开始日期"
-            end-placeholder="结束日期" size="small" style="width:270px" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
+          <el-date-picker v-model="search.entrTime[0]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
+            placeholder="开始日期" size="mini" style="width: 140px">
+          </el-date-picker>
+          <span>至</span>
+          <el-date-picker v-model="search.entrTime[1]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
+            placeholder="结束日期" size="mini" style="width: 140px">
           </el-date-picker>
+          <!-- <el-date-picker v-model="search.entrTime" type="daterange" range-separator="至" start-placeholder="开始日期"
+            end-placeholder="结束日期" size="small" style="width:270px" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
+          </el-date-picker> -->
         </el-form-item>
         <el-form-item>
           <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData">查询</el-button>
@@ -61,6 +68,8 @@
                 <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
                 检验委托信息
               </div>
+              <el-button icon="el-icon-search" style="height: 100%;margin-left: -220px;margin-top: 28px;" type="goon"
+                size="mini" @click="countList">物料统计</el-button>
               <div>
                 <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini"
                   v-privilege="activeMenu + 'tempAdd'" @click="addData">新增临时委托</el-button>
@@ -78,6 +87,8 @@
                   v-privilege="activeMenu + 'submit'" @click="disable">停用</el-button>
                 <el-button icon="el-icon-printer" type="goon" size="mini" :loading="printLoading"
                   @click="printQRCode">打印标签</el-button>
+                <el-button icon="el-icon-download" type="goon" size="mini" :loading='exportFileLoading'
+                  @click="exportFile">导出检测委托书</el-button>
               </div>
             </div>
             <div class="common-table-div" style="margin-bottom:0;margin-top:0">
@@ -322,10 +333,11 @@
             </div>
             <div class="common-table-div" style="margin-bottom:0;margin-top:0">
               <el-table v-loading="dataLoading2" ref="dataTable2" border :height="height_bot" @row-click='saveData'
-                highlight-current-row :data="table.list2" :icore-filter-flag="icoreFilterFlag"
-                :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName2"
-                :summary-method="getSummaries" show-summary>
+                @selection-change="selectData" highlight-current-row :data="table.list2"
+                :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle"
+                :cell-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
                 <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
+                <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
                 <el-table-column sortable :show-overflow-tooltip="true" min-width="90px" prop="anlyItemNo"
                   label="分析项目编号" align="center"></el-table-column>
                 <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="anlyItemName"
@@ -440,6 +452,14 @@
     <div is="alertComponets" :showFlag="showFlag" :Params="Params" @refresh='refresh'></div>
     <div is="alertComponets3" :showFlag3="showFlag3" :Params="Params" @refresh='refresh'></div>
     <div is="alertComponets2" :showFlag2="showFlag2" :Params="Params" :Params2="Params2" @refresh='refresh2'></div>
+    <el-dialog @close="closeDialog" :visible.sync="dialogTableCount" width="80%">
+      <el-table id="excelTable3" ref="dataTable3" border :data="tableCount">
+        <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="MAT_NAME" label="物料编号"
+          align="center"></el-table-column>
+        <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="COUNT" label="个数"
+          align="center"></el-table-column>
+      </el-table>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -485,6 +505,7 @@ export default {
       icoreFilterFlag: true,
       showFlag3: false,
       printLoading: false,
+      exportFileLoading: false,
       page: {
         pageSize: 200,
         pageNum: 1,
@@ -496,12 +517,15 @@ export default {
         totalPage: 0
       },
       savaDep: {},
+      selectDataList: [],
       list: [],
       entrId: '',
       showFlag: false,
       Params: {},
       showFlag2: false,
       Params2: {},
+      tableCount: [],
+      dialogTableCount: false,
       entrOrgNameType: [],
       entrOrgNameType1: [],
       sampleTypeNameType: [],
@@ -674,7 +698,6 @@ export default {
       this.axios.post("pass/testManagement/v1/api/reflection/removeMapPkALL").then(res => {
         if (res.code == 0 || res.code == 200) {
           this.subLoadingq = false
-          this.$message.success(res.message);
         } else {
           this.subLoadingq = false
           this.$message.error(res.message)
@@ -752,6 +775,9 @@ export default {
       this.mainData();
       this.mainData1();
     },
+    selectData(val) {
+      this.selectDataList = val;
+    },
     saveData(row) {
       this.savaDep = Object.assign({}, row)
     },
@@ -769,8 +795,8 @@ export default {
       this.Params = this.saveRow
     },
     deleteData2() {
-      if (JSON.stringify(this.savaDep) === "{}") {
-        this.$message.warning('请点击选中一条检验委托信息数据')
+      if (this.selectDataList.length == 0) {
+        this.$message.warning('请选中计划检验项目信息数据!')
         return
       }
       if (this.saveRow.stateFlag == 1) {
@@ -782,17 +808,19 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        this.axios.post('pass/testManagement/v1/limstestentrustds/deleteLimsTestEntrustD?id=' + this.savaDep.id, { individualType: 'json' }).then(res => {
-          if (res.succeed) {
-            this.dialogTableVisible = false;
-            this.$message.success('删除成功');
-            this.depData(this.entrId)
-          } else {
-            this.$message.error(res.message)
-          }
-        }).catch(e => {
-          this.$message.error(e.message)
-        })
+        for (let i = 0; i < this.selectDataList.length; i++) {
+          this.axios.post('pass/testManagement/v1/limstestentrustds/deleteLimsTestEntrustD?id=' + this.selectDataList[i].id, { individualType: 'json' }).then(res => {
+            if (res.succeed) {
+              this.dialogTableVisible = false;
+              this.$message.success('删除成功');
+              this.depData(this.entrId)
+            } else {
+              this.$message.error(res.message)
+            }
+          }).catch(e => {
+            this.$message.error(e.message)
+          })
+        }
       }).catch(() => { });
     },
     searchData() {
@@ -840,6 +868,34 @@ export default {
         this.$message.error(e.message);
       });
     },
+    closeDialog() {
+      this.dialogTableCount = false;
+      this.tableCount = [];
+    },
+    countList() {
+      let obj = {
+        object: {
+          entrOrgNo: this.search.planCompanyNo, // 委托单位
+          sampleTypeCode: 480101,
+          matName: this.search.matName,
+          suppName: this.search.suppName,
+          carNo: this.search.carNo,
+          contractNo: this.search.contractNo,
+          planNo: this.search.planNo,
+          validFlag: '1',
+          stateFlag: '1'
+        },
+        list: [this.search.testTypeCode],
+        'startTime': this.startTime,
+        'endTime': this.endTime
+      }
+      this.axios.post('pass/testManagement/v1/limstestentrusts/queryLimsTestEntrustCount', obj, { individualType: 'json' }).then(res => {
+        this.tableCount = res.data
+        this.dialogTableCount = true;
+      }).catch(e => {
+        this.$message.error('查询错误!');
+      });
+    },
     mainData() {
       this.saveRow = {}
       this.dataLoading = true;
@@ -1023,6 +1079,7 @@ export default {
       this.axios.post('pass/testManagement/v1/limstestentrusts/cancel', ids, { individualType: 'json' }).then(res => {
         if (res.code == 0 || res.code == 200) {
           this.$message.success(res.message);
+          this.removeNumber();
           this.mainData();
           this.mainData1();
         } else {
@@ -1034,6 +1091,43 @@ export default {
         this.$message.error(e.message)
       })
     },
+    exportFile() {
+      if (this.selectRows.length == 0) {
+        this.$message.warning('请勾选您要导出的一条数据!')
+        return
+      }
+      this.exportFileLoading = true;
+      let str = [];
+      let flag = false
+      this.selectRows.forEach(s => {
+        str.push(s.entrId)
+        if (s.stateFlag == '0') {
+          flag = true
+        }
+      })
+      if (flag) {
+        this.$message.warning('请勾选已提交的数据!')
+        return
+      }
+      this.axios.get('pass/testManagement/v1/limstestentrusts/newJywts/' + str, { responseType: 'blob' }, { headers: { 'content-type': 'application/x-www-form-urlencoded' } }).then(res => {
+        if (res) {
+          let blob = new Blob([res]);
+          let elink = document.createElement('a');
+          elink.download = "BBWXCLJC-4-08-03.docx";
+          elink.style.display = 'none';
+          elink.target = "_blank";
+          elink.href = URL.createObjectURL(blob);
+          document.body.appendChild(elink);
+          elink.click();
+          URL.revokeObjectURL(elink.href); // 释放URL对象
+          document.body.removeChild(elink);
+          this.exportFileLoading = false;
+        }
+      }).catch(e => {
+        this.exportFileLoading = false;
+        return this.$message.error(e.message)
+      })
+    },
     // 打印条形码
     printQRCode() {
       if (this.selectRows.length == 0) {