yusheng 1 неделя назад
Родитель
Сommit
f7dd64eb21

+ 127 - 0
src/components/upload/WithViewNew.vue

@@ -0,0 +1,127 @@
+<template>
+  <div>
+    <div class="img-view" v-if="dialogImageUrl">
+      <img :src="dialogImageUrl" alt="" srcset="" />
+    </div>
+    <div class="placeholder-box" v-else>
+      <img src="~@/assets/upload-placeholder.svg" alt="" />
+    </div>
+    <div class="btn-box">
+      <el-upload
+        class="avatar-div"
+        action="#"
+        accept="image/png,image/jpeg"
+        :show-file-list="false"
+        ref="uploadRef"
+        :on-exceed="handleExceed"
+        :limit="1"
+        :http-request="handlSuccess"
+        :multiple="false"
+      >
+        <el-button type="text" v-if="!disabled"
+          >上传{{ assetName }}图片</el-button
+        >
+      </el-upload>
+      <el-button type="text" v-if="!disabled" @click="clearImg"
+        >清除图片</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<script>
+  import { uploadFile, removeFile } from '@/api/system/file/index.js';
+  import { getImageUrl } from '@/utils/file';
+  export default {
+    props: {
+      assetName: {
+        type: String,
+        default: ' '
+      },
+      value: {
+        type: String,
+        default: ''
+      },
+      disabled: {
+        type: Boolean,
+        default: false
+      },
+      // 所属模块
+      module: {
+        type: String,
+        default: 'main'
+      }
+    },
+    data() {
+      return {};
+    },
+    computed: {
+      dialogImageUrl() {
+        return this.value;
+      }
+    },
+    methods: {
+      // 清空已上传的文件列表
+      clearUploadFiles() {},
+      //图片添加
+      async handlSuccess(params) {
+        let res = await uploadFile({
+          multiPartFile: params.file,
+          module: this.module
+        });
+        if (res?.data) {
+          this.$emit('input', res.data.url);
+        }
+      },
+      async clearImg() {
+        // await removeFile({ fileId: this.value.id });
+        this.$emit('input', '');
+        this.$refs.uploadRef.clearFiles();
+      },
+      // 限制上传的数量
+      handleExceed(files, fileList) {
+        this.$message.warning(`最多允许上传一张图片!`);
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .img-view {
+    width: 280px;
+    height: 342px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    border-width: 1px;
+    border-style: solid;
+    border-color: rgba(215, 215, 215, 1);
+
+    img {
+      max-width: 100%;
+      max-height: 100%;
+    }
+  }
+
+  .placeholder-box {
+    width: 250px;
+    height: 200px;
+    text-align: center;
+
+    background-color: rgba(242, 242, 242, 1);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    border-color: rgba(215, 215, 215, 1);
+    padding-top: 60px;
+
+    img {
+      width: 100px;
+      height: 100px;
+    }
+  }
+
+  .btn-box {
+    display: flex;
+    justify-content: space-around;
+  }
+</style>

+ 86 - 0
src/views/QualityInspection/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="'QualityInspection'"></plan>
+        </div>
+        <div v-if="activeComp == 'workOrder'">
+          <workOrder ref="tableRef" :pageName="'QualityInspection'"></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>

+ 3 - 1
src/views/home/index.vue

@@ -689,10 +689,12 @@
                     color:
                       item.level == 1
                         ? '#ef4444'
-                        : item.level == 2
+                        : item.level == 4
                         ? '#dc2626'
                         : item.level == 3
                         ? '#3b82f6'
+                        : item.level == 5
+                        ? '#c10000'
                         : '#f59e0b'
                   }
                 };

+ 5 - 2
src/views/recordComponents/plan.vue

@@ -15,7 +15,7 @@
         :datasource="datasource"
         @columns-change="handleColumnChange"
         :cache-key="cacheKeyUrl"
-         height="calc(100vh - 420px)"
+        height="calc(100vh - 420px)"
         :page-size="defPageSize"
       >
         <template v-slot:toolbar>
@@ -120,7 +120,8 @@
           steamInjectionInspectionRecord: 3,
           solidWasteRecord: 4,
           qualityTestRecords: 5,
-          boilerOperationRecord: 6
+          boilerOperationRecord: 6,
+          QualityInspection: 7
         },
 
         columns: [
@@ -389,6 +390,8 @@
               ? '固废记录'
               : this.pageName == 'qualityTestRecords'
               ? '质量检查检测记录'
+              : this.pageName == 'QualityInspection'
+              ? '来煤质检记录'
               : '锅炉运行记录'
           )
         );

+ 3 - 2
src/views/recordComponents/workOrder.vue

@@ -13,8 +13,8 @@
         :columns="columns"
         :datasource="datasource"
         :cache-key="cacheKeyUrl"
-         height="calc(100vh - 420px)"
-        @columns-change="handleColumnChange" 
+        height="calc(100vh - 420px)"
+        @columns-change="handleColumnChange"
         autoAmendPage
         :page-size="defPageSize"
       >
@@ -90,6 +90,7 @@
           steamInjectionInspectionRecord: 3,
           solidWasteRecord: 4,
           qualityTestRecords: 5,
+          QualityInspection: 7,
           boilerOperationRecord: 6
         },
         columns: [

+ 74 - 6
src/views/recordComponents/workOrderReport.vue

@@ -14,7 +14,7 @@
       ref="formRef"
       :model="addForm"
       :rules="rules"
-      label-width="120px"
+      label-width="150px"
       v-loading="loading"
       :disabled="type == 'detail'"
     >
@@ -175,6 +175,39 @@
             />
           </el-form-item>
         </el-col>
+        <el-col :span="8" v-if="pageName == 'QualityInspection'||pageName == 'productionRecords'">
+          <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 == 'QualityInspection'">
+          <el-form-item
+            label="检查卸车是否到位"
+            required
+            prop="unloadCheckStatus"
+          >
+            <el-radio-group v-model="addForm.unloadCheckStatus">
+              <el-radio :label="1">已到位</el-radio>
+              <el-radio :label="2">未到位</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-col>
+        <el-col :span="9" v-if="pageName == 'QualityInspection'">
+          <el-form-item label="车辆照片" prop="vehiclePhotoUrl">
+            <WithView
+              :assetName="''"
+              v-model="addForm.vehiclePhotoUrl"
+              style="max-height: 370px"
+              v-if="type != 'detail'"
+            ></WithView>
+          </el-form-item>
+        </el-col>
         <el-col :span="8" v-if="pageName == 'qualityTestRecords'">
           <el-form-item label="联合站检查人" required prop="contactName">
             <el-input
@@ -271,7 +304,12 @@
         > -->
         <template v-slot:num="{ row }">
           <div>
-            <el-input type="text" placeholder="请输入" v-model="row.num">
+            <el-input
+              type="text"
+              placeholder="请输入"
+              v-model="row.num"
+              @input="setValue"
+            >
               <template v-if="row.unitName" slot="append">
                 <div>{{ row.unitName }}</div>
               </template>
@@ -319,12 +357,14 @@
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import { getUserPage } from '@/api/system/organization';
   import { getteampage, getTeam } from '@/api/main/index.js';
+  import WithView from '@/components/upload/WithViewNew.vue';
 
   export default {
     mixins: [dictMixins],
     components: {
       deptSelect,
-      parentList
+      parentList,
+      WithView
     },
     props: {
       pageName: {
@@ -359,6 +399,8 @@
         checkValidityUnit: '',
         conclusion: null,
         isTempRecord: this.isTempRecord,
+        unloadCheckStatus: '',
+        vehiclePhotoUrl: '',
         detailList: [],
         deviceId: 0,
         deviceName: '',
@@ -561,14 +603,18 @@
             prop: 'checkStatus',
             minWidth: 120,
             slot: 'checkStatus',
-            isNone: this.pageName == 'productionRecords'
+            isNone:
+              this.pageName == 'productionRecords' ||
+              this.pageName == 'QualityInspection'
           },
 
           {
             label: '检查结果',
             prop: 'checkResult',
             minWidth: 120,
-            isNone: this.pageName == 'productionRecords',
+            isNone:
+              this.pageName == 'productionRecords' ||
+              this.pageName == 'QualityInspection',
             slot: 'checkResult'
           }
         ];
@@ -695,6 +741,7 @@
             console.log('this.teamUserList', this.teamUserList);
           }
 
+          this.setValue();
           this.$nextTick(() => {
             this.$refs.formRef.clearValidate();
 
@@ -705,6 +752,24 @@
           this.loading = false;
         }
       },
+      setValue() {
+        if (this.pageName == 'productionRecords' && this.title == '报工') {
+          this.addForm.detailList.forEach((item, index) => {
+            if (item.paramValue == '用煤量') {
+              let num1 = this.addForm.detailList.find(
+                (item1) => item1.paramValue == '用水量'
+              )?.num;
+              console.log(num1, 'num1');
+              let num = 0;
+              if (num1) {
+                num = (62 / 600) * num1;
+              }
+
+              this.$set(this.addForm.detailList[index], 'num', parseFloat(num.toFixed(5)));
+            }
+          });
+        }
+      },
       // 关闭时清理表单
       handleClose() {
         this.addForm = JSON.parse(JSON.stringify(this.formBaseData));
@@ -725,7 +790,10 @@
             }
 
             // 报工需要验证 缓存不验证 排除 recordTemplateStyle ==3 物料添加 == 4生产统计 模板
-            if (this.pageName != 'productionRecords') {
+            if (
+              this.pageName != 'productionRecords' &&
+              this.pageName != 'QualityInspection'
+            ) {
               // 验证检查项目
               const detailRequired = this.addForm.detailList.some((i) => {
                 return i.checkResult == null || i.checkStatus == null;

+ 1 - 1
vue.config.js

@@ -36,7 +36,7 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.1.3:18086', //开发
+        target: 'http://192.168.1.102:18086', //开发
         // target: 'http://192.168.1.251:18186', //测试
         // target: 'http://192.168.1.23:18086',//罗
         // target: 'http://192.168.1.144:18086',//付