yusheng 1 week geleden
bovenliggende
commit
594d797cfd

+ 20 - 9
src/api/classifyManage/index.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request';
 
-export async function getSubPage (data) {
+export async function getSubPage(data) {
   const res = await request.get('/main/categoryLevel/getSubPage', {
     params: data
   });
@@ -9,7 +9,7 @@ export async function getSubPage (data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
-export async function saveOrUpdate (data) {
+export async function saveOrUpdate(data) {
   const res = await request.post('/main/categoryLevel/saveOrUpdate', data);
   if (res.data.code == 0) {
     return res.data;
@@ -18,15 +18,26 @@ export async function saveOrUpdate (data) {
 }
 
 // 根据父级id查分类树
-export async function getTreeByPid (parentId) {
+export async function getTreeByPid(parentId) {
   const res = await request.get(`/main/categoryLevel/getTreeByPid/${parentId}`);
   if (res.data.code == 0) {
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
+export async function getProduceTreeByCode(code) {
+  const res = await request.get(
+    `/main/categoryLevel/getProduceTreeByPid?code=${code}`,
+    {}
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 根据类型查分类树
-export async function getTreeByType (type) {
+export async function getTreeByType(type) {
   const res = await request.get(`/main/categoryLevel/getTreeByType/${type}`);
   if (res.data.code == 0) {
     return res.data;
@@ -35,7 +46,7 @@ export async function getTreeByType (type) {
 }
 
 // 删除分类
-export async function deleteCategory (id) {
+export async function deleteCategory(id) {
   const res = await request.get(`/main/categoryLevel/delete/${id}`);
   if (res.data.code == 0) {
     return res.data;
@@ -43,7 +54,7 @@ export async function deleteCategory (id) {
   return Promise.reject(new Error(res.data.message));
 }
 //根据单个ID查询分类详情系信息
-export async function getInfoById (id) {
+export async function getInfoById(id) {
   const res = await request.get(`/main/categoryLevel/getById/${id}`);
   if (res.data.code == 0) {
     return res.data;
@@ -51,7 +62,7 @@ export async function getInfoById (id) {
   return Promise.reject(new Error(res.data.message));
 }
 //根据多个ID查询分类详情系信息
-export async function getInfoByIds (id) {
+export async function getInfoByIds(id) {
   const res = await request.get(`/main/categoryLevel/getByIds/${id}`);
   if (res.data.code == 0) {
     return res.data;
@@ -59,7 +70,7 @@ export async function getInfoByIds (id) {
   return Promise.reject(new Error(res.data.message));
 }
 //根据多个ID查询分类详情系信息
-export async function getPcTreeByPids (id) {
+export async function getPcTreeByPids(id) {
   const res = await request.get(`/main/categoryLevel/getPcTreeByPids/${id}`);
   if (res.data.code == 0) {
     return res.data;
@@ -75,4 +86,4 @@ export async function getTreeByIds(data) {
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 7 - 2
src/components/orderListDialog/orderListDialog.vue

@@ -191,16 +191,18 @@
           }
         ],
 
-        radio: null
+        radio: null,
+        sourceType: ''
       };
     },
 
     methods: {
-      open(partbId) {
+      open(partbId, sourceType) {
         this.radio = null;
         this.current = null;
         this.visible = true;
         this.partbId = partbId;
+        this.sourceType = sourceType;
         this.$nextTick(() => {
           this.$refs.table.reload({
             pageNum: 1
@@ -210,6 +212,9 @@
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
+        if (this.sourceType) {
+          where['sourceType'] = this.sourceType;
+        }
         return getTableList({
           pageNum: page,
           size: limit,

+ 86 - 0
src/views/HaulSlag/index.vue

@@ -0,0 +1,86 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <div class="switch">
+        <div class="switch_left">
+          <ul>
+            <li
+              v-for="item in tabOptions"
+              :key="item.key"
+              :class="{ active: activeComp == item.key }"
+              @click="handleClick(item)"
+            >
+              {{ item.name }}
+            </li>
+          </ul>
+        </div>
+        <!-- <div class="right" style="padding: 10px">
+          <el-button @click="$router.go(-1)">返回</el-button>
+        </div> -->
+      </div>
+      <div class="main">
+        <div v-if="activeComp == 'plan'">
+          <plan ref="tableRef" :pageName="'HaulSlag'"></plan>
+        </div>
+        <div v-if="activeComp == 'workOrder'">
+          <workOrder ref="tableRef" :pageName="'HaulSlag'"></workOrder>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import plan from '@/views/recordComponents/plan.vue';
+  import workOrder from '@/views/recordComponents//workOrder.vue';
+
+  export default {
+    components: {
+      plan,
+      workOrder
+    },
+    data() {
+      return {
+        activeComp: 'plan',
+        tabOptions: [
+          { key: 'plan', name: '计划' },
+          { key: 'workOrder', name: '工单' }
+        ],
+        // 加载状态
+        loading: false
+      };
+    },
+    mounted() {
+      console.log(this.$route.query);
+      switch (this.$route.query.title) {
+        case '计划':
+          this.activeComp = 'plan';
+          break;
+        case '工单':
+          this.activeComp = 'workOrder';
+          break;
+        default:
+          break;
+      }
+    },
+    methods: {
+      handleClick(val) {
+        this.activeComp = val.key;
+        this.$refs.tableRef && this.$refs.tableRef.reload();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep .el-card__body {
+    padding-top: 0;
+    padding-left: 0;
+  }
+  .main {
+    padding-left: 17px;
+    .plan {
+      padding-top: 15px;
+    }
+  }
+</style>

+ 86 - 0
src/views/TransportAsh/index.vue

@@ -0,0 +1,86 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <div class="switch">
+        <div class="switch_left">
+          <ul>
+            <li
+              v-for="item in tabOptions"
+              :key="item.key"
+              :class="{ active: activeComp == item.key }"
+              @click="handleClick(item)"
+            >
+              {{ item.name }}
+            </li>
+          </ul>
+        </div>
+        <!-- <div class="right" style="padding: 10px">
+          <el-button @click="$router.go(-1)">返回</el-button>
+        </div> -->
+      </div>
+      <div class="main">
+        <div v-if="activeComp == 'plan'">
+          <plan ref="tableRef" :pageName="'TransportAsh'"></plan>
+        </div>
+        <div v-if="activeComp == 'workOrder'">
+          <workOrder ref="tableRef" :pageName="'TransportAsh'"></workOrder>
+        </div>
+      </div>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import plan from '@/views/recordComponents/plan.vue';
+  import workOrder from '@/views/recordComponents//workOrder.vue';
+
+  export default {
+    components: {
+      plan,
+      workOrder
+    },
+    data() {
+      return {
+        activeComp: 'plan',
+        tabOptions: [
+          { key: 'plan', name: '计划' },
+          { key: 'workOrder', name: '工单' }
+        ],
+        // 加载状态
+        loading: false
+      };
+    },
+    mounted() {
+      console.log(this.$route.query);
+      switch (this.$route.query.title) {
+        case '计划':
+          this.activeComp = 'plan';
+          break;
+        case '工单':
+          this.activeComp = 'workOrder';
+          break;
+        default:
+          break;
+      }
+    },
+    methods: {
+      handleClick(val) {
+        this.activeComp = val.key;
+        this.$refs.tableRef && this.$refs.tableRef.reload();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep .el-card__body {
+    padding-top: 0;
+    padding-left: 0;
+  }
+  .main {
+    padding-left: 17px;
+    .plan {
+      padding-top: 15px;
+    }
+  }
+</style>

+ 7 - 1
src/views/recordComponents/plan.vue

@@ -121,7 +121,9 @@
           solidWasteRecord: 4,
           qualityTestRecords: 5,
           boilerOperationRecord: 6,
-          QualityInspection: 7
+          QualityInspection: 7,
+          HaulSlag: 8,
+          TransportAsh: 9
         },
 
         columns: [
@@ -392,6 +394,10 @@
               ? '质量检查检测记录'
               : this.pageName == 'QualityInspection'
               ? '来煤质检记录'
+              : this.pageName == 'HaulSlag'
+              ? '拉渣记录'
+              : this.pageName == 'TransportAsh'
+              ? '拉灰记录'
               : '锅炉运行记录'
           )
         );

+ 14 - 13
src/views/recordComponents/workOrder.vue

@@ -91,7 +91,9 @@
           solidWasteRecord: 4,
           qualityTestRecords: 5,
           QualityInspection: 7,
-          boilerOperationRecord: 6
+          boilerOperationRecord: 6,
+          HaulSlag: 8,
+          TransportAsh: 9
         },
         columns: [
           {
@@ -198,27 +200,26 @@
           },
           {
             prop: 'contactName',
-            label: '甲方检查人',
+            label: '客户',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110,
-            isNone: this.pageName != 'steamInjectionInspectionRecord'
+            isNone:
+              !['productionRecords', 'qualityTestRecords'].includes(
+                this.pageName
+              ) || this.pageName == 'boilerOperationRecord'
           },
           {
             prop: 'supplierName',
-            label: '处理方',
+            label: '供应商',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110,
-            isNone: this.pageName != 'solidWasteRecord'
-          },
-          {
-            prop: 'contactName',
-            label: '联合站检查人',
-            align: 'center',
-            showOverflowTooltip: true,
-            isNone: this.pageName != 'qualityTestRecords',
-            minWidth: 110
+            isNone: [
+              'productionRecords',
+              'qualityTestRecords',
+              'boilerOperationRecord'
+            ].includes(this.pageName)
           },
 
           {

+ 135 - 114
src/views/recordComponents/workOrderReport.vue

@@ -153,8 +153,13 @@
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="pageName == 'steamInjectionInspectionRecord'">
-          <el-form-item label="甲方检查人" required prop="contactName">
+        <el-col
+          :span="8"
+          v-if="
+            pageName == 'productionRecords' || pageName == 'qualityTestRecords'
+          "
+        >
+          <el-form-item label="客户" required prop="contactName">
             <el-input
               clearable
               v-model="addForm.contactName"
@@ -164,22 +169,11 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="pageName == 'solidWasteRecord'">
-          <el-form-item label="处理方" required prop="supplierName">
-            <el-input
-              clearable
-              v-model="addForm.supplierName"
-              @click.native="handParent"
-              placeholder="请选择"
-              readonly
-            />
-          </el-form-item>
-        </el-col>
 
         <el-col
           :span="8"
           v-if="
-            pageName == 'productionRecords' || pageName == 'QualityInspection'
+            ['QualityInspection', 'TransportAsh', 'HaulSlag'].includes(pageName)
           "
         >
           <el-form-item label="供应商" required prop="supplierName">
@@ -192,7 +186,12 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="pageName == 'QualityInspection'">
+        <el-col
+          :span="8"
+          v-if="
+            ['QualityInspection', 'TransportAsh', 'HaulSlag'].includes(pageName)
+          "
+        >
           <el-form-item label="采购订单" required prop="purchaseOrderNo">
             <el-input
               clearable
@@ -224,17 +223,6 @@
             ></WithView>
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="pageName == 'qualityTestRecords'">
-          <el-form-item label="联合站检查人" required prop="contactName">
-            <el-input
-              clearable
-              v-model="addForm.contactName"
-              @click.native="handParent"
-              placeholder="请选择"
-              readonly
-            />
-          </el-form-item>
-        </el-col>
       </el-row>
 
       <header-title title="记录数据" :style="`margin-top: 20px`"></header-title>
@@ -250,13 +238,29 @@
       >
         <template v-slot:toolkit>
           <el-button
-            v-if="pageName != 'productionRecords'"
+            v-if="
+              ![
+                'qualityTestRecords',
+                'productionRecords',
+                'QualityInspection',
+                'HaulSlag',
+                'TransportAsh'
+              ].includes(pageName)
+            "
             type="primary"
             @click="batchCheck"
             >批量检查</el-button
           >
           <el-button
-            v-if="pageName != 'productionRecords'"
+            v-if="
+              ![
+                'qualityTestRecords',
+                'productionRecords',
+                'QualityInspection',
+                'HaulSlag',
+                'TransportAsh'
+              ].includes(pageName)
+            "
             type="primary"
             @click="batchQualified"
             >批量合格</el-button
@@ -345,20 +349,16 @@
 
     <parentList
       :classType="
-        pageName == 'solidWasteRecord' ||
-        pageName == 'QualityInspection' ||
-        pageName == 'productionRecords'
-          ? '2'
-          : '1'
+        pageName == 'productionRecords' || pageName == 'qualityTestRecords'
+          ? '1'
+          : '2'
       "
       :type="
-        pageName == 'solidWasteRecord' ||
-        pageName == 'QualityInspection' ||
-        pageName == 'productionRecords'
-          ? '19'
-          : '17'
+        pageName == 'productionRecords' || pageName == 'qualityTestRecords'
+          ? '17'
+          : '19'
       "
-      :code="pageName == 'QualityInspection' ? '06mei' : ''"
+      :code="getCode()"
       ref="parentListRef"
       @changeParent="changeParent"
     >
@@ -565,11 +565,6 @@
             { required: true, message: '请选择', trigger: 'blur' },
             { required: true, message: '请选择', trigger: 'change' }
           ]
-
-          // productLineId: [
-          //   { required: true, message: '请选择场站', trigger: 'blur' },
-          //   { required: true, message: '请选择场站', trigger: 'change' }
-          // ]
         },
         loading: false,
         butLoading: false,
@@ -584,16 +579,6 @@
       };
     },
     computed: {
-      // title() {
-      //   if (this.addForm.recordRulesClassify) {
-      //     const dictValue = this.getDictValue(
-      //       '记录规则类型',
-      //       this.addForm.recordRulesClassify
-      //     );
-      //     return dictValue + '记录表';
-      //   }
-      //   return '记录表';
-      // },
       activeTeamUserList() {
         return this.teamUserList.filter((user) =>
           this.addForm.executeUsersIds.includes(user.id)
@@ -638,30 +623,32 @@
             slot: 'checkUsersIds',
             isNone: this.pageName != 'qualityTestRecords'
           },
-          // {
-          //   label: '描述',
-          //   prop: 'errorMsg',
-          //   minWidth: 120,
-          //   slot: 'errorMsg',
-          //   isNone: this.pageName != 'qualityTestRecords'
-          // },
+
           {
             label: '检查情况',
             prop: 'checkStatus',
             minWidth: 120,
             slot: 'checkStatus',
-            isNone:
-              this.pageName == 'productionRecords' ||
-              this.pageName == 'QualityInspection'
+            isNone: [
+              'qualityTestRecords',
+              'productionRecords',
+              'QualityInspection',
+              'HaulSlag',
+              'TransportAsh'
+            ].includes(this.pageName)
           },
 
           {
             label: '检查结果',
             prop: 'checkResult',
             minWidth: 120,
-            isNone:
-              this.pageName == 'productionRecords' ||
-              this.pageName == 'QualityInspection',
+            isNone: [
+              'qualityTestRecords',
+              'productionRecords',
+              'QualityInspection',
+              'HaulSlag',
+              'TransportAsh'
+            ].includes(this.pageName),
             slot: 'checkResult'
           }
         ];
@@ -717,6 +704,19 @@
           });
         }
       },
+      getCode() {
+        if (this.$store.state.user.info.clientEnvironmentId == 10) {
+          return this.pageName == 'QualityInspection'
+            ? '06mei'
+            : this.pageName == 'TransportAsh'
+            ? '07lafei'
+            : this.pageName == 'HaulSlag'
+            ? '08lazha'
+            : '';
+        } else {
+          return '';
+        }
+      },
       // 获取工单详情
       async getOrderDetials(id) {
         try {
@@ -750,38 +750,7 @@
             }
             return i;
           });
-          //      <el-col :span="8">
-          //   <el-form-item label="检查时间" required prop="checkStartTime">
-          //     <el-date-picker
-          //       v-model="addForm.checkStartTime"
-          //       type="datetime"
-          //       format="yyyy-MM-dd HH:mm:ss"
-          //       value-format="yyyy-MM-dd HH:mm:ss"
-          //       placeholder="选择日期"
-          //       style="width: 100%"
-          //       :picker-options="{
-          //         disabledDate: (time) => time.getTime() > Date.now()
-          //       }"
-          //     >
-          //     </el-date-picker>
-          //   </el-form-item>
-          // </el-col>
-          // <el-col :span="8">
-          //   <el-form-item label="报工时间" required prop="checkFinishTime">
-          //     <el-date-picker
-          //       v-model="addForm.checkFinishTime"
-          //       type="datetime"
-          //       format="yyyy-MM-dd HH:mm:ss"
-          //       value-format="yyyy-MM-dd HH:mm:ss"
-          //       placeholder="选择日期"
-          //       style="width: 100%"
-          //       :picker-options="{
-          //         disabledDate: (time) => time.getTime() > Date.now()
-          //       }"
-          //     >
-          //     </el-date-picker>
-          //   </el-form-item>
-          // </el-col>
+
           Object.assign(this.addForm, data);
           this.addForm.unloadCheckStatus = this.addForm.unloadCheckStatus || 1;
 
@@ -844,6 +813,24 @@
             console.log('this.teamUserList', this.teamUserList);
           }
 
+          //宇信
+          if (
+            this.$store.state.user.info.clientEnvironmentId == 10 &&
+            ['productionRecords', 'qualityTestRecords'].includes(this.pageName)
+          ) {
+            //客户:5#和6#默认是重油公司7#默认是红山 2008389016775864321==7#
+            if (this.addForm.productLineId == '2008389016775864321') {
+              this.addForm.contactId =
+                this.addForm.contactId || '2008562263580520449';
+              this.addForm.contactName =
+                this.addForm.contactName || '克拉玛依红山油田有限责任公司';
+            } else {
+              this.addForm.contactId =
+                this.addForm.contactId || '2008383566202318850';
+              this.addForm.contactName =
+                this.addForm.contactName || '中国石油新疆油田分公司(重油公司)';
+            }
+          }
           this.setValue();
           this.$nextTick(() => {
             this.$refs.formRef.clearValidate();
@@ -860,7 +847,13 @@
           this.$message.warning('请先选择供应商!');
           return;
         }
-        this.$refs.orderListDialogRef.open(this.addForm.supplierId);
+        this.$refs.orderListDialogRef.open(
+          this.addForm.supplierId,
+          //渣和灰拿委外订单
+          ['TransportAsh', 'HaulSlag'].includes(this.pageName)
+            ? '3,4,5,6,7'
+            : ''
+        );
       },
       orderListDialogSuccess(data) {
         this.addForm.purchaseOrderId = data.id;
@@ -888,24 +881,47 @@
               }
             }
             if (this.pageName == 'qualityTestRecords') {
-              if (item.paramValue == '检测干度值-干度') {
-                let num1 = this.addForm.detailList.find(
-                  (item1) => item1.paramValue == '检测干度值-给水'
-                )?.num;
-                let num2 = this.addForm.detailList.find(
-                  (item1) => item1.paramValue == '检测干度值-炉水'
-                )?.num;
-                let num = 0;
-                if (num1 && num2) {
-                  num = (num2 - num1) / num2;
-                }
-
+              let num1 = this.addForm.detailList.find(
+                (item1) => item1.paramValue == '给水量'
+              )?.num;
+              let num2 = this.addForm.detailList.find(
+                (item1) => item1.paramValue == '炉水量'
+              )?.num;
+              let num = 0;
+              if (num1 && num2) {
+                num = (num2 - num1) / num2;
+              }
+              if (item.paramValue == '干度') {
                 this.$set(
                   this.addForm.detailList[index],
                   'num',
                   parseFloat(num.toFixed(5)) * 100
                 );
               }
+              if (item.paramValue == '是否合格' && num1) {
+                this.$set(
+                  this.addForm.detailList[index],
+                  'num',
+                  parseFloat(num.toFixed(5)) * 100 >= 90 ? '合格' : '不合格'
+                );
+              }
+            }
+            if (this.pageName == 'productionRecords') {
+              let num1 = this.addForm.detailList.find(
+                (item1) => item1.paramValue == '日用水量'
+              )?.num;
+
+              let num = 0;
+              if (num1) {
+                num = num1 * 0.1034;
+              }
+              if (item.paramValue == '日用煤量') {
+                this.$set(
+                  this.addForm.detailList[index],
+                  'num',
+                  parseFloat(num.toFixed(5))
+                );
+              }
             }
           });
         }
@@ -931,8 +947,13 @@
 
             // 报工需要验证 缓存不验证 排除 recordTemplateStyle ==3 物料添加 == 4生产统计 模板
             if (
-              this.pageName != 'productionRecords' &&
-              this.pageName != 'QualityInspection'
+              ![
+                'qualityTestRecords',
+                'productionRecords',
+                'QualityInspection',
+                'HaulSlag',
+                'TransportAsh'
+              ].includes(this.pageName)
             ) {
               // 验证检查项目
               const detailRequired = this.addForm.detailList.some((i) => {