yusheng 6 dagen geleden
bovenliggende
commit
a6d17c0d7e

+ 4 - 0
src/components/addDoc/file-edit.vue

@@ -293,6 +293,10 @@
             });
         });
       },
+      setDirectoryId(directoryId) {
+        // console.log(directoryId,'directoryId')
+        this.form.directoryId = directoryId;
+      },
 
       cancel() {
         this.form = { ...this.defaultForm, directoryId: this.form.directoryId };

+ 2 - 1
src/components/addDoc/index.vue

@@ -20,7 +20,7 @@
       >
     </el-badge>
 
-    <file-upload @success="getFiles" ref="fileUploadRef" :lcyStatus="lcyStatus"></file-upload>
+    <file-upload @success="getFiles" ref="fileUploadRef" :lcyStatus="lcyStatus" :directoryId="directoryId"></file-upload>
   </div>
 </template>
 
@@ -37,6 +37,7 @@
 
     props: {
       lcyStatus: '',
+      directoryId:'',
       type: {
         type: String,
         default: ''

+ 5 - 1
src/components/addDoc/main.vue

@@ -93,7 +93,8 @@
     components: { doc_template, fileEdit, browse },
     mixins: [tabMixins],
     props: {
-      lcyStatus: ''
+      lcyStatus: '',
+      directoryId: ''
     },
     data() {
       return {
@@ -187,6 +188,9 @@
         this.init();
       },
       fileEditOpen() {
+        if (this.directoryId) {
+          this.$refs.fileEditRef.setDirectoryId(this.directoryId);
+        }
         this.$refs.fileEditRef.open();
       },
       remove(row) {

+ 508 - 0
src/components/rule-cycle.vue

@@ -0,0 +1,508 @@
+<template>
+  <div>
+    <el-row :gutter="24" v-if="pageType">
+      <el-col :span="4">
+        <el-input
+          @input="
+            (value) =>
+              (formData.cycleValue = value.replace(/^(0+)|[^\d]+/g, ''))
+          "
+          class="cycle_value"
+          size="small"
+          v-model.number="formData.cycleValue"
+          @change="cycleValueChange"
+          placeholder="请输入"
+          :disabled="isBindPlan"
+          maxlength="3"
+        ></el-input>
+      </el-col>
+      <el-col :span="4">
+        <el-select
+          v-model="formData.cycleType"
+          size="small"
+          @change="handleCycleTypeChange"
+          :disabled="isBindPlan"
+        >
+          <el-option
+            v-for="item in cycleOpt"
+            :key="item.code"
+            :label="item.label"
+            :value="item.code"
+          ></el-option>
+        </el-select>
+      </el-col>
+
+      <el-col :span="8" v-if="[1, 2, 3, 4, 5].includes(formData.cycleType)">
+        <div
+          v-for="(item, index) in recordRulesCycleList"
+          :key="index"
+          class="cycle01_box"
+        >
+          <el-input
+            v-model.number="item.month"
+            size="small"
+            oninput="value = value.replace(/^(0+)|[^\d]+/g,'')"
+            @input="(e) => inputMonth(e, index)"
+            v-if="[5].includes(formData.cycleType)"
+            :disabled="isBindPlan"
+          >
+            <template #suffix>月</template>
+          </el-input>
+
+          <el-input
+            v-model.number="item.day"
+            size="small"
+            oninput="value = value.replace(/^(0+)|[^\d]+/g,'')"
+            @input="(e) => inputDay(e, index)"
+            v-if="[4, 5].includes(formData.cycleType)"
+            :disabled="isBindPlan"
+          >
+            <template #suffix>日</template>
+          </el-input>
+
+          <div
+            v-if="[3].includes(formData.cycleType)"
+            style="display: flex"
+          >
+            <el-select
+              v-model.number="item.week"
+              size="small"
+              placeholder="周"
+              :disabled="isBindPlan"
+            >
+              <el-option
+                v-for="item in weekList"
+                :key="item.value"
+                :value="item.value"
+                :label="item.label"
+              ></el-option>
+            </el-select>
+          </div>
+
+          <el-input
+            v-model.number="item.hour"
+            size="small"
+            oninput="value = value.replace(/^0+(\d)|[^\d]+/g,'')"
+            @input="(e) => inputHour(e, index)"
+            v-if="[2, 3, 4, 5].includes(formData.cycleType)"
+            :disabled="isBindPlan"
+          >
+            <template #suffix>时</template>
+          </el-input>
+
+          <el-input
+            v-model.number="item.minute"
+            size="small"
+            oninput="value = value.replace(/^0+(\d)|[^\d]+/g,'')"
+            @input="(e) => inputMinute(e, index)"
+            :disabled="isBindPlan"
+          >
+            <template #suffix>分</template>
+          </el-input>
+        </div>
+      </el-col>
+    </el-row>
+    <el-row v-else>
+      <el-col :span="24" class="cycle_time_column">
+        <span style="margin-right: 20px"
+          >{{ formData.cycleValue
+          }}{{ cycleOptObj[formData.cycleType] }}</span
+        >
+        <div v-if="[1, 2, 4, 5].includes(formData.cycleType)">
+          <span v-if="[5].includes(formData.cycleType)"
+            >{{ recordRulesCycleList[0].month }}月</span
+          >
+          <span v-if="[4, 5].includes(formData.cycleType)"
+            >{{ recordRulesCycleList[0].day }}日</span
+          >
+          <span v-if="[2, 4, 5].includes(formData.cycleType)"
+            >{{ recordRulesCycleList[0].hour }}时</span
+          >
+          <span>{{ recordRulesCycleList[0].minute }}分</span>
+        </div>
+      </el-col>
+    </el-row>
+
+    <!-- 根据周期类型展示时间组件 11,12,13,14 -->
+    <div>
+      <!-- 次/天 -->
+      <el-row :gutter="20" v-if="formData.cycleType === 11">
+        <el-col
+          v-for="(item, index) in recordRulesCycleList"
+          :key="index"
+          :span="6"
+          class="cycle_item"
+        >
+          <span>第{{ index + 1 }}次</span>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-input
+              v-model.number="item.hour"
+              size="small"
+              placeholder="时"
+              oninput="value = value.replace(/^0+(\d)|[^\d]+/g,'')"
+              @input="(e) => inputHour(e, index)"
+              :disabled="isBindPlan"
+            >
+              <template #suffix>时</template>
+            </el-input>
+          </div>
+          <div v-else>{{ item.hour }}时</div>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-input
+              v-model.number="item.minute"
+              size="small"
+              oninput="value = value.replace(/^0+(\d)|[^\d]+/g,'')"
+              @input="(e) => inputMinute(e, index)"
+              placeholder="分"
+              :disabled="isBindPlan"
+            >
+              <template #suffix>分</template>
+            </el-input>
+          </div>
+          <div v-else>
+            {{ item.minute > 9 ? item.minute : '0' + item.minute }}分
+          </div>
+        </el-col>
+      </el-row>
+      <!-- 次/周 -->
+      <el-row :gutter="20" v-else-if="formData.cycleType === 12">
+        <el-col
+          v-for="(item, index) in recordRulesCycleList"
+          :key="index"
+          :span="6"
+          class="cycle_item"
+        >
+          <span>第{{ index + 1 }}次</span>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-select
+              v-model.number="item.week"
+              size="small"
+              placeholder="周"
+              :disabled="isBindPlan"
+            >
+              <el-option
+                v-for="item in weekList"
+                :key="item.value"
+                :value="item.value"
+                :label="item.label"
+              ></el-option>
+            </el-select>
+          </div>
+          <div v-else>{{ item.week }}</div>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-input
+              v-model.number="item.hour"
+              size="small"
+              placeholder="时"
+              oninput="value = value.replace(/^0+(\d)|[^\d]+/g,'')"
+              @input="(e) => inputHour(e, index)"
+              :disabled="isBindPlan"
+            >
+              <template #suffix>时</template>
+            </el-input>
+          </div>
+          <div v-else>{{ item.hour }}时</div>
+        </el-col>
+      </el-row>
+      <!-- 次/月 -->
+      <el-row :gutter="20" v-else-if="formData.cycleType === 13">
+        <el-col
+          v-for="(item, index) in recordRulesCycleList"
+          :key="index"
+          :span="6"
+          class="cycle_item"
+        >
+          <span>第{{ index + 1 }}次</span>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-input
+              v-model.number="item.day"
+              size="small"
+              placeholder="日"
+              oninput="value = value.replace(/^(0+)|[^\d]+/g,'')"
+              @input="(e) => inputDay(e, index)"
+              :disabled="isBindPlan"
+            >
+              <template #suffix>日</template>
+            </el-input>
+          </div>
+          <div v-else>{{ item.day }}日</div>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-input
+              v-model.number="item.hour"
+              size="small"
+              placeholder="时"
+              oninput="value = value.replace(/^0+(\d)|[^\d]+/g,'')"
+              @input="(e) => inputHour(e, index)"
+              :disabled="isBindPlan"
+            >
+              <template #suffix>时</template>
+            </el-input>
+          </div>
+          <div v-else>{{ item.hour }}</div>
+        </el-col>
+      </el-row>
+      <!-- 次/年 -->
+      <el-row :gutter="20" v-else-if="formData.cycleType === 14">
+        <el-col
+          v-for="(item, index) in recordRulesCycleList"
+          :key="index"
+          :span="6"
+          class="cycle_item"
+        >
+          <span>第{{ index + 1 }}次</span>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-input
+              v-model.number="item.month"
+              size="small"
+              placeholder="月"
+              oninput="value = value.replace(/^(0+)|[^\d]+/g,'')"
+              @input="(e) => inputMonth(e, index)"
+              :disabled="isBindPlan"
+            >
+              <template #suffix>月</template>
+            </el-input>
+          </div>
+          <div v-else>{{ item.month }}月</div>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-input
+              v-model.number="item.day"
+              size="small"
+              placeholder="日"
+              oninput="value = value.replace(/^(0+)|[^\d]+/g,'')"
+              @input="(e) => inputDay(e, index)"
+              :disabled="isBindPlan"
+            >
+              <template #suffix>日</template>
+            </el-input>
+          </div>
+          <div v-else>{{ item.day }}日</div>
+          <div class="cycle_sub_item" v-if="pageType">
+            <el-input
+              v-model.number="item.hour"
+              size="small"
+              placeholder="时"
+              oninput="value = value.replace(/^0+(\d)|[^\d]+/g,'')"
+              @input="(e) => inputHour(e, index)"
+              :disabled="isBindPlan"
+            >
+              <template #suffix>时</template>
+            </el-input>
+          </div>
+          <div v-else>{{ item.hour }}时</div>
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    props: {
+      formData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      // 编辑edit和新增add
+      pageType: {
+        type: String,
+        default: ''
+      },
+
+      isBindPlan: {
+        type: Boolean,
+        default: () => {
+          return false;
+        }
+      }
+    },
+    data() {
+      return {
+        // {
+        //   year: '', // 周期年
+        //   month: '', // 周期月
+        //   week: '', // 周期周
+        //   day: '', // 周期日
+        //   hour: '', // 周期时
+        //   minute: '', // 周期分
+        //   second: '' // 周期秒
+        // }
+        recordRulesCycleList: [],
+        weekList: [
+          { value: 1, label: '周一' },
+          { value: 2, label: '周二' },
+          { value: 3, label: '周三' },
+          { value: 4, label: '周四' },
+          { value: 5, label: '周五' },
+          { value: 6, label: '周六' },
+          { value: 7, label: '周日' }
+        ],
+        cycleOptObj: {
+          0: '次数',
+          6: '分/次',
+          1: '时/次',
+          2: '天/次',
+          3: '周/次',
+          4: '月/次',
+          5: '年/次',
+          11: '次/天',
+          12: '次/周',
+          13: '次/月',
+          14: '次/年'
+        },
+        cycleOpt: [
+          { code: 0, label: '次数' },
+          { code: 6, label: '分/次' },
+          { code: 1, label: '时/次' },
+          { code: 2, label: '天/次' },
+          { code: 3, label: '周/次' },
+          { code: 4, label: '月/次' },
+          { code: 5, label: '年/次' },
+          { code: 11, label: '次/天' },
+          { code: 12, label: '次/周' },
+          { code: 13, label: '次/月' },
+          { code: 14, label: '次/年' }
+        ]
+      };
+    },
+    methods: {
+      setRecordRulesCycleList(list) {
+        console.log('list', list);
+        this.recordRulesCycleList = list;
+      },
+      // 巡点检周期输入数量
+      cycleValueChange(val) {
+        console.log(val);
+        console.log(this.formData.cycleType);
+        const cycleType01 = [1, 2, 3, 4, 5];
+        const cycleType02 = [11, 12, 13, 14];
+        this.recordRulesCycleList = [];
+
+        // 次在后
+        console.log(cycleType01.includes(this.formData.cycleType));
+        if (cycleType01.includes(this.formData.cycleType)) {
+          this.recordRulesCycleList.push({
+            month: 1, // 周期月
+            day: 1, // 周期日
+            hour: 0, // 周期时
+            minute: 0, // 周期分
+            week: 1 // 周期周
+          });
+          console.log(this.recordRulesCycleList);
+        }
+
+        // 次在前
+        if (cycleType02.includes(this.formData.cycleType)) {
+          for (let i = 0; i < val; i++) {
+            this.recordRulesCycleList.push({
+              month: 1, // 周期月
+              day: 1, // 周期日
+              hour: 0, // 周期时
+              minute: 0, // 周期分
+              week: 1 // 周期周
+            });
+          }
+        }
+
+        // 时/次
+        if (this.formData.cycleType === 1) {
+          this.recordRulesCycleList.forEach((item) => {
+            delete item.month;
+            delete item.day;
+            delete item.hour;
+            delete item.week;
+          });
+        }
+
+        console.log(this.recordRulesCycleList);
+        // 天/次、次/天
+        if ([2, 11].includes(this.formData.cycleType)) {
+          this.recordRulesCycleList.forEach((item) => {
+            delete item.month;
+            delete item.day;
+            delete item.week;
+          });
+        }
+
+        // 周/次  次/周
+        if ([3, 12].includes(this.formData.cycleType)) {
+          this.recordRulesCycleList.forEach((item) => {
+            delete item.month;
+            delete item.day;
+          });
+        }
+
+        // 月/次、次/月
+        if ([4, 13].includes(this.formData.cycleType)) {
+          this.recordRulesCycleList.forEach((item) => {
+            delete item.month;
+            delete item.week;
+          });
+        }
+      },
+
+      // 周期类型选择
+      handleCycleTypeChange() {
+        this.cycleValueChange(this.formData.cycleValue);
+      },
+
+      // 输入月
+      inputMonth(e, index) {
+        if (e > 12) {
+          this.recordRulesCycleList[index].month = 1;
+          return this.$message.warning('月份最大值为12月');
+        }
+      },
+      // 输入日
+      inputDay(e, index) {
+        if (e > 31) {
+          this.recordRulesCycleList[index].day = 1;
+          return this.$message.warning('日期最大值为31日');
+        }
+      },
+      // 输入时
+      inputHour(e, index) {
+        if (e > 23) {
+          this.recordRulesCycleList[index].hour = 0;
+          return this.$message.warning('时间最大值为23时');
+        }
+      },
+      // 输入时
+      inputMinute(e, index) {
+        if (e > 59) {
+          this.recordRulesCycleList[index].minute = 0;
+          return this.$message.warning('分钟最大值为59分');
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  :deep(.el-input) {
+    // width:100px;
+  }
+  .cycle_item {
+    display: flex;
+    align-items: center;
+    color: #666;
+    > span {
+      width: 50px;
+    }
+    .cycle_sub_item {
+      flex: 1;
+      display: flex;
+      align-items: center;
+    }
+  }
+  .cycle01_box {
+    display: flex;
+    ::v-deep .el-input {
+      width: 80px;
+    }
+  }
+  .cycle_time_column {
+    display: flex;
+  }
+</style>

+ 123 - 36
src/views/inspectionPlan/components/new-baseInfo.vue

@@ -31,12 +31,6 @@
           </el-select>
         </el-form-item>
       </el-col>
-      <!-- <el-col :span="6">
-        <el-form-item label="名称:" prop="name">
-          <el-input clearable v-model="form.name" placeholder="请输入"
-            :disabled="btnType == 'detail' || btnType == 'issued'" />
-        </el-form-item>
-      </el-col>-->
       <el-col :span="6">
         <el-form-item label="检验方式:" prop="qualityMode">
           <DictSelection
@@ -70,18 +64,6 @@
               :key="item.value"
             ></el-option>
           </el-select>
-
-          <!-- <el-input
-            clearable
-            v-model="form.inspectionStandards"
-            placeholder="请输入"
-            :disabled="
-              btnType == 'detail' ||
-              btnType == 'issued' ||
-              btnType == 'add' ||
-              btnType == 'edit'
-            "
-          /> -->
         </el-form-item>
       </el-col>
     </el-row>
@@ -106,16 +88,57 @@
           />
         </el-form-item>
       </el-col>
-      <!-- <el-col :span="6">
-        <el-form-item label="自动派单:" prop="autoOrder">
-          <el-select v-model="form.autoOrder" placeholder="请选择" style="width: 100%"
-            :disabled="btnType == 'detail' || btnType == 'issued'" clearable>
-            <el-option label="是" :value="1" />
-            <el-option label="否" :value="0" />
+      <el-col :span="6" style="height: 58px">
+        <el-form-item label="班组/个人" prop="assignType">
+          <el-select
+            v-model="form.assignType"
+            size="small"
+            @change="typeChange"
+            style="width: 100%"
+            :disabled="btnType == 'detail' || btnType == 'issued'"
+          >
+            <el-option :value="1" label="班组"></el-option>
+            <el-option :value="0" label="个人"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="6" v-if="form.assignType == 1">
+        <el-form-item label="班组" prop="teamId">
+          <el-select
+            v-model="form.teamId"
+            size="small"
+            @change="teamChange()"
+            style="width: 100%"
+          >
+            <el-option
+              :value="i.id"
+              :label="i.name"
+              v-for="i in teamAllList"
+              :key="i.id"
+            ></el-option>
           </el-select>
         </el-form-item>
-      </el-col>-->
-      <el-col :span="6">
+      </el-col>
+      <el-col :span="6" v-if="form.assignType == 1">
+        <el-form-item label="场站" prop="productLineId">
+          <el-select
+            v-model="form.productLineId"
+            placeholder="请选择场站"
+            filterable
+            style="width: 100%"
+          >
+            <el-option
+              v-for="item in productLineList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+              @click.native="form.productLineName = item.name"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="6" v-if="!form.assignType">
         <el-form-item label="接收部门:" prop="groupId">
           <deptSelect
             :disabled="btnType == 'detail'"
@@ -124,7 +147,7 @@
           />
         </el-form-item>
       </el-col>
-      <el-col :span="6">
+      <el-col :span="6" v-if="!form.assignType">
         <el-form-item label="接收人:" prop="executeId">
           <el-select
             :disabled="btnType == 'detail'"
@@ -142,6 +165,16 @@
           </el-select>
         </el-form-item>
       </el-col>
+      <el-col :span="18">
+        <el-form-item label="周期:" prop="frequencyValue">
+          <rule-cycle
+            ref="cycleMultipleRef"
+            :formData="form"
+            :pageType="btnType"
+            :isBindPlan="btnType == 'detail'"
+          />
+        </el-form-item>
+      </el-col>
     </el-row>
     <div style="text-align: right; margin-bottom: 22px">
       <div @click="toggleExpand">
@@ -250,7 +283,7 @@
             <el-input
               type="number"
               v-model="form.productNumber"
-              disabled
+              :disabled="form.planSource != 7"
               @input="changeProductNumber"
               @change="changeProductNumber"
             >
@@ -416,12 +449,12 @@
     <workOrder ref="workOrderRef" @choose="handleChoose" />
     <!-- 生产工单 -->
     <produceOrder ref="produceOrderRef" @choose="handleChoose" />
-    <!-- <EquipmentDialog
+    <EquipmentDialog
       ref="equipmentRefs"
       @choose="handleMainChoose"
       :type="2"
       :treeIds="['9']"
-    /> -->
+    />
     <!-- 成品检验 -->
     <stokledger ref="stokledgerRef" @choose="handleStokledgerChoose" />
     <ProductionVersion ref="versionRefs" @changeProduct="changeProduct" />
@@ -445,8 +478,9 @@
   import productionPlan from './productionPlan';
   import workOrder from './workOrder';
   import produceOrder from './produceOrder';
-  // import EquipmentDialog from './equipmentDialog';
+  import EquipmentDialog from './equipmentDialog';
   import stokledger from './stokledger';
+  import RuleCycle from '@/components/rule-cycle.vue';
 
   //接口
   import { getUserPage } from '@/api/system/organization';
@@ -454,12 +488,13 @@
   import { rules } from 'eslint-config-prettier';
 
   import { getDetailInfo } from '@/api/inspectionPlan/index.js';
+  import { getteampage } from '@/api/main/index.js';
 
   import { getQualityTemplateList } from '@/api/inspectionPlan/index.js';
   import { getProduceTaskList } from '@/api/aps';
   export default {
     components: {
-      // EquipmentDialog,
+      EquipmentDialog,
       produceOrder,
       workOrder,
       productionPlan,
@@ -468,6 +503,7 @@
       fileUpload,
       stokledger,
       ProductionVersion,
+      RuleCycle,
       entrustedDialog
     },
     props: {
@@ -534,6 +570,8 @@
         executorList: [],
         sourceList: [],
         inspectionStandardsList: [],
+        teamAllList: [],
+        productLineList: [],
         rules: {
           name: [{ required: true, message: '请输入', trigger: 'blur' }],
           // qualityMode: [
@@ -551,7 +589,9 @@
           ],
           planSource: [
             { required: true, message: '请选择计划来源', trigger: 'blur' }
-          ]
+          ],
+          teamId: [{ required: true, message: '请选择班组', trigger: 'blur' }],
+          productLineId: [{ required: true, message: '请选择场站', trigger: 'blur' }],
         },
         isExpanded: false, // 控制展开/收起状态
         categoryInfo: {},
@@ -567,6 +607,7 @@
     created() {
       // this.getDictListIqoCode('iqo_code');
       this.getDictListIqoCode('measurement_type');
+      this.getAllTeamList();
     },
     methods: {
       clearData() {
@@ -585,7 +626,22 @@
         this.form.totalWeight = '';
         this.form.sampleNumber = '';
       },
-
+      setRecordRulesCycleList() {
+        this.$refs.cycleMultipleRef?.setRecordRulesCycleList(
+          this.form.cycleList
+        );
+      },
+      recordRulesCycleList() {
+        this.$refs.cycleMultipleRef?.recordRulesCycleList(this.form.cycleList);
+      },
+      async getAllTeamList() {
+        const { list } = await getteampage({
+          pageNum: 1,
+          size: -1
+        });
+        this.teamAllList = list;
+        return;
+      },
       // 打开工艺路线弹窗
       openVersion() {
         this.$refs.versionRefs.open();
@@ -704,8 +760,36 @@
         } else if (this.form.planSource == 6) {
           //库存台账
           this.$refs.stokledgerRef.open();
+        } else if (this.form.planSource == 7) {
+          //主数据
+          this.$refs.equipmentRefs.open();
         }
       },
+      async teamChange(init) {
+        if (!this.teamAllList.length) {
+          await this.getAllTeamList();
+        }
+        // 当前班组
+        const currentTeam = this.teamAllList.find(
+          (item) => item.id === this.form.teamId
+        );
+        this.form.teamName = currentTeam.name;
+        if (!init) {
+          this.form.productLineName = '';
+          this.form.productLineId = '';
+        }
+        this.productLineList = [];
+        currentTeam.factoryWorkstationVOList.forEach((item) => {
+          if (
+            !this.productLineList.find((p) => p.id === item.productionLineId)
+          ) {
+            this.productLineList.push({
+              name: item.productionLineName,
+              id: item.productionLineId
+            });
+          }
+        });
+      },
       // 受托收货单选择
       async entrustedChoose(val) {
         this.fieldAssig(val);
@@ -778,12 +862,12 @@
           ];
         } else if (val == 3) {
           this.sourceList = [
-            // { label: '主数据', value: '5' },
+            { label: '主数据', value: '7' },
             { label: '库存台账', value: '6' }
           ];
         }
         if (!type || type != 'select') {
-          console.log('执行 1')
+          console.log('执行 1');
           this.$emit('changeType');
         }
       },
@@ -803,11 +887,14 @@
         this.form.isConsumable = val.isConsumable; //0 单件 1 批量
         this.form.productId = val.id;
         this.form.netWeight = val.netWeight; //净重
+        this.form.productNumber = 1;
         console.log(this.form, '00000000000000000');
         // console.log(this.form.type)
         console.log('----------------->>>>');
         this.getProductDetails(this.form.productId);
         this.$emit('changesMainNumberModal', this.form.productNumber);
+        this.changeProductNumber(1);
+
         if (this.form.type != 3) {
           this.$emit('getQualityTemplate', val.code);
         }

+ 44 - 11
src/views/inspectionPlan/components/new-edit.vue

@@ -383,7 +383,6 @@
               </template>
             </el-table-column>
           </el-table>
-       
         </el-tab-pane>
       </el-tabs>
     </el-row>
@@ -425,7 +424,8 @@
     save,
     update,
     planIssued,
-    checkTemplateById
+    checkTemplateById,
+    planDetails
   } from '@/api/inspectionPlan';
   import {
     getQualityTemplateList,
@@ -453,7 +453,11 @@
           code: '',
           name: '',
           type: '',
-          qualityMode: '',
+          assignType: 0,
+          teamId: '',
+          productLineId: '',
+          productLineName: '',
+          qualityMode: 2,
           inspectionStandards: '',
           autoOrder: '',
           groupId: '',
@@ -482,6 +486,9 @@
           supplierMark: '',
           remark: '',
           accessory: [],
+          cycleList: [],
+          cycleType: '',
+          cycleValue: '',
           conditionType: 1
         };
       };
@@ -1021,6 +1028,7 @@
           const code = await getCode('qms_plan_code');
           this.baseForm.code = code;
           this.rowIds = '';
+
           return;
         } else {
           await this.handleEditOrDetail(row);
@@ -1049,12 +1057,12 @@
       async handleEditOrDetail(row) {
         console.log('row====', row);
         row.accessory = row.accessory || [];
-
         this.baseForm = {
           ...JSON.parse(JSON.stringify(row)),
           groupId: row.groupId,
           qualityMode: row.qualityMode
         };
+        this.baseForm.assignType = this.baseForm.assignType || 0;
 
         this.$nextTick(() => {
           if (this.$refs.baseInfoRefs) {
@@ -1073,6 +1081,10 @@
                 this.baseForm.productId
               );
             }
+            this.$refs.baseInfoRefs.setRecordRulesCycleList();
+            if (this.baseForm.teamId) {
+              this.$refs.baseInfoRefs.teamChange(true);
+            }
           }
         });
 
@@ -1535,7 +1547,7 @@
 
       //更新样品清单数据
       async updatePackingList(list) {
-        return
+        return;
         console.log('进来了没有 pppppp');
         // 计量类型1是数量,2是重量
         // if (this.baseForm.inspectionStandards == 1) {
@@ -2075,12 +2087,31 @@
           }
           this.baseForm.conditionType =
             this.conditionType ?? this.kkconditionType;
-          // isSampleList: true,
-          // isPackingList: true,
+          let cycleList =
+            this.$refs.baseInfoRefs.$refs.cycleMultipleRef.recordRulesCycleList
+              .map((i) => {
+                // 根据月日时分排序计算权重排序
+                let sortNum = 0;
+                if (i.month) {
+                  sortNum += i.month * 60 * 24 * 30;
+                }
+                if (i.day) {
+                  sortNum += i.day * 60 * 24;
+                }
+                if (i.hour) {
+                  sortNum += i.hour * 60;
+                }
+
+                if (i.minute) {
+                  sortNum += i.minute * 1;
+                }
 
-          console.log(this.isSampleList);
-          console.log(this.isPackingList);
-          console.log(this.$refs.table12.getData());
+                return { ...i, sortNum };
+              })
+              .sort((a, b) => a.sortNum - b.sortNum)
+              .map((i, index) => {
+                return { ...i, sortNum: index + 1 };
+              });
 
           const qualityListData =
             this.btnType == 'add'
@@ -2098,7 +2129,8 @@
             ...this.baseForm,
             qualityInventoryList: qualityListData,
             sampleList: sampleListData,
-            planTemplateList: this.schemeList
+            planTemplateList: this.schemeList,
+            cycleList
           };
 
           console.log(params, 'params');
@@ -2124,6 +2156,7 @@
             });
         });
       },
+
       handleIssued() {
         // if (this.sampleList.length == 0) {
         //   this.$message.warning('样品清单为空!先进行修改操作再下发!');

+ 12 - 2
src/views/inspectionWork/components/baseInfo.vue

@@ -113,7 +113,7 @@
           <el-form-item
             label="执行部门"
             prop="executeDeptId"
-            v-if="form.qualityType != 2"
+            v-if="form.qualityType != 2 && form.assignType != 1"
           >
             <deptSelect
               :disabled="btnType == 'detail'"
@@ -122,7 +122,7 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="6" v-if="form.qualityType == 2">
+        <el-col :span="6" v-if="form.qualityType == 2 || form.assignType == 1">
           <el-form-item label="执行班组" prop="executeJobId">
             <el-select
               :disabled="btnType == 'detail'"
@@ -140,6 +140,7 @@
             </el-select>
           </el-form-item>
         </el-col>
+
         <el-col :span="6">
           <el-form-item label="执行人" prop="executeUserId">
             <el-select
@@ -163,6 +164,11 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6" v-if="form.assignType == 1">
+          <el-form-item label="场站" prop="productLineId">
+          <input v-model="form.productLineName" disabled></input>
+          </el-form-item>
+        </el-col>
         <el-col :span="6">
           <el-form-item label="检测时间:" prop="qualityTime">
             <el-date-picker
@@ -849,6 +855,10 @@
         if (this.form.qualityMode == 2) {
           this.$emit('quantityAssignment');
         }
+      },
+      setQualityResults(val) {
+        this.form.qualityResults = val;
+        this.selectResult();
       }
     }
   };

+ 18 - 4
src/views/inspectionWork/components/newQualityContentTabs.vue

@@ -252,6 +252,18 @@
               </template>
             </el-table-column>
           </template>
+          <el-table-column
+            label="图片"
+            prop="imgUrl"
+            align="center"
+            :show-overflow-tooltip="true"
+          >
+            <template slot-scope="scope">
+              <span
+                ><fileMain v-model="scope.row.imgUrl" type="view"></fileMain
+              ></span>
+            </template>
+          </el-table-column>
           <!-- *** fixed="right"  -->
           <el-table-column
             label="处置状态"
@@ -513,10 +525,12 @@
                   {{ scope.row.minValue }}-{{ scope.row.maxValue }}
                 </span>
                 <span v-else-if="scope.row.textType == 8">
-                  标准值:{{ scope.row.defaultValue }}{{ scope.row.unitName||'' }} 下限:{{
-                    scope.row.minValue||0
-                  }}{{ scope.row.unitName||'' }}
-                  上限:{{ scope.row.maxValue||0 }}{{ scope.row.unitName||'' }}
+                  标准值:{{ scope.row.defaultValue
+                  }}{{ scope.row.unitName || '' }} 下限:{{
+                    scope.row.minValue || 0
+                  }}{{ scope.row.unitName || '' }} 上限:{{
+                    scope.row.maxValue || 0
+                  }}{{ scope.row.unitName || '' }}
                 </span>
                 <span v-else>
                   <span>{{ scope.row.defaultValue }}</span>

+ 43 - 8
src/views/inspectionWork/components/sampleListDialog.vue

@@ -99,9 +99,9 @@
                     <span v-else-if="scope.row.textType == 8">
                       标准值:{{ scope.row.defaultValue
                       }}{{ scope.row.unitName || '' }} 下限:{{
-                        scope.row.minValue||0
+                        scope.row.minValue || 0
                       }}{{ scope.row.unitName || '' }} 上限:{{
-                        scope.row.maxValue||0
+                        scope.row.maxValue || 0
                       }}{{ scope.row.unitName || '' }}
                     </span>
                     <span v-else>
@@ -142,11 +142,16 @@
                       type == 'detail' || (!pageName && props.row.correlationId)
                     "
                     @input="
-                      handleInput(
-                        scope.row,
-                        scope.row.qualityResultContent,
-                        tableData
-                      )
+                      clientEnvironmentId == 10
+                        ? newHandleInput(
+                            props.row.qualitySampleTemplateList,
+                            props.$index
+                          )
+                        : handleInput(
+                            scope.row,
+                            scope.row.qualityResultContent,
+                            tableData
+                          )
                     "
                   >
                     <template slot="append" v-if="scope.row.unitName">
@@ -168,7 +173,11 @@
                     style="width: 100%"
                     @change="qualityResultsListChange(tableData)"
                     :disabled="
-                      type == 'detail' || (!pageName && props.row.correlationId)
+                      type == 'detail' ||
+                      (!pageName && props.row.correlationId) ||
+                      ['炉水电导率', '给水电导率'].includes(
+                        scope.row.inspectionName
+                      )
                     "
                   >
                     <el-option
@@ -340,6 +349,8 @@
     created() {},
     methods: {
       async openDia(index, row, type, list, isStatus, sList, pageName) {
+        this.clientEnvironmentId =
+          this.$store.state.user.info.clientEnvironmentId;
         this.tableData = [];
         this.rowIndex = index;
         this.type = type;
@@ -383,6 +394,30 @@
       handleDispose(index, row, type) {
         this.$emit('handleDispose', index, row, type);
       },
+      //宇信特殊处理
+      newHandleInput(arr, index) {
+        let num = arr.find(
+          (item) => item.inspectionName == '给水电导率'
+        )?.qualityResultContent;
+        let num1 = arr.find(
+          (item) => item.inspectionName == '炉水电导率'
+        )?.qualityResultContent;
+
+        arr.forEach((item, i) => {
+          if (num && num1 && item.inspectionName == '干度') {
+            let val = parseFloat(
+              (((num - num1 / 1000) / num) * 100).toFixed(5)
+            );
+            this.$set(
+              this.tableData[index].qualitySampleTemplateList[i],
+              'qualityResultContent',
+              val
+            );
+
+            this.handleInput(item, val, this.tableData);
+          }
+        });
+      },
 
       //选择检测工具
       openToolList(index, row) {

+ 18 - 13
src/views/inspectionWork/details.vue

@@ -66,12 +66,15 @@
                 <el-form-item
                   label="执行部门"
                   prop="executeDeptName"
-                  v-if="form.qualityType != 2"
+                  v-if="form.qualityType != 2 && form.assignType != 1"
                 >
                   <el-input :value="form.executeDeptName" disabled />
                 </el-form-item>
               </el-col>
-              <el-col :span="6" v-if="form.qualityType == 2">
+              <el-col
+                :span="6"
+                v-if="form.qualityType == 2 || form.assignType == 1"
+              >
                 <el-form-item label="执行班组" prop="executeJobName">
                   <el-input :value="form.executeJobName" disabled />
                 </el-form-item>
@@ -81,7 +84,11 @@
                   <el-input :value="form.executeUserName" disabled />
                 </el-form-item>
               </el-col>
-
+        <el-col :span="6" v-if="form.assignType == 1">
+          <el-form-item label="场站" prop="productLineId">
+          <input v-model="form.productLineName" disabled></input>
+          </el-form-item>
+        </el-col>
               <el-col :span="6">
                 <el-form-item label="检测时间">
                   <el-input :value="qualityTime" disabled />
@@ -335,15 +342,13 @@
                     {{ row.categoryCode }}
                   </el-link>
                 </template>
-                <!-- <template v-if="column.prop === 'categoryCode'">
-                  <el-link
-                    type="primary"
-                    :underline="false"
-                    @click="handleDetail(scope.$index, scope.row, 'detail')"
+                <template v-slot:imgUrl="{ row, $index }">
+                  <fileMian
+                    type="view"
+                   v-model="row.imgUrl"
                   >
-                    {{ scope.row.categoryCode }}
-                  </el-link>
-                </template> -->
+                  </fileMian>
+                </template>
               </ele-pro-table></el-tab-pane
             >
             <el-tab-pane label="检测方案" name="3">
@@ -371,8 +376,8 @@
                     </span>
                     <span v-else-if="row.textType == 8">
                       标准值:{{ row.defaultValue
-                      }}{{ row.unitName || '' }} 下限:{{ row.minValue||0
-                      }}{{ row.unitName || '' }} 上限:{{ row.maxValue||0
+                      }}{{ row.unitName || '' }} 下限:{{ row.minValue || 0
+                      }}{{ row.unitName || '' }} 上限:{{ row.maxValue || 0
                       }}{{ row.unitName || '' }}
                     </span>
                     <span v-else>

+ 15 - 21
src/views/inspectionWork/edit.vue

@@ -432,14 +432,11 @@
           if (key == 'sampleNoQualifiedNumber') {
             let total = num + this.form.sampleQualifiedNumber;
             if (total) {
-              this.form.sampleNoQualificationRate = (
-                (num / total) *
-                100
-              ).toFixed(2)+'%';
-              this.form.sampleQualificationRate = (
-                (this.form.sampleQualifiedNumber / total) *
-                100
-              ).toFixed(2)+'%';
+              this.form.sampleNoQualificationRate =
+                ((num / total) * 100).toFixed(2) + '%';
+              this.form.sampleQualificationRate =
+                ((this.form.sampleQualifiedNumber / total) * 100).toFixed(2) +
+                '%';
             }
           }
           this.quantityAssignment();
@@ -1583,7 +1580,7 @@
         let addStatus = res.list.map((item) => {
           item.isValid = true;
           item.status = item.status || 1;
-          item.qualityStatus = 1
+          item.qualityStatus = 1;
           // item.disposeTime = item.disposeTime
           //   ? item.disposeTime.split(' ')[0]
           //   : null;
@@ -1660,7 +1657,7 @@
             // qualityInventoryList: this.$refs.tabsRef.$refs.sourceTable.getData()
             qualityInventoryList: this.inventoryList
           };
-          console.log(params,'params')
+          console.log(params, 'params');
 
           URL(params)
             .then((msg) => {
@@ -1902,17 +1899,8 @@
       },
       //确认检测
       handleConfirm(list, index) {
-        // 检查有效性
-        // for (const item of list) {
-        //   for (const child of item.qualitySampleTemplateList) {
-        //
-        //     console.log(child, 'child')
-        //     if (!child.qualityResultContent || !child.qualityResults) {
-        //       this.$message.error('请完善报工内容!');
-        //       return;
-        //     }
-        //   }
-        // }
+        let qualityResults = '';
+
         list.forEach((item) => {
           if (item.correlationId) {
             return;
@@ -1951,6 +1939,8 @@
             }
           }
           item.qualityStatus = 1;
+
+          qualityResults = item.qualityResults;
         });
         if (index != null) {
           this.$set(this.sampleList, index, list[0]);
@@ -1971,6 +1961,10 @@
           console.log(this.sampleList, 'this.sampleList');
         }
         this.activeName = '2';
+        if (this.$store.state.user.info.clientEnvironmentId == 10) {
+          this.$refs.baseInfoRefs.setQualityResults(qualityResults);
+        }
+
         // *** 选完批量检测调用
         // this.countQualityResults();
         // this.$refs.baseInfoRefs.quantityCalculation(

+ 19 - 3
src/views/inspectionWork/mixins/detailMixins.js

@@ -141,6 +141,14 @@ export default {
           prop: 'executeJobName',
           label: '执行班组'
         },
+        {
+          prop: 'productLineName',
+          label: '场站'
+        },
+        {
+          prop: 'assignType',
+          label: '执行人类型'
+        },
         {
           prop: 'executeUserName',
           label: '执行人'
@@ -562,7 +570,7 @@ export default {
         },
         {
           prop: 'code',
-          slot:'code',
+          slot: 'code',
           label: '请托单号',
           showOverflowTooltip: true,
           align: 'center',
@@ -704,7 +712,7 @@ export default {
         },
         {
           prop: 'code',
-          slot:'code',
+          slot: 'code',
           label: '检测任务单号',
           showOverflowTooltip: true,
           align: 'center',
@@ -870,6 +878,14 @@ export default {
           width: '150',
           showOverflowTooltip: true
         },
+        {
+          label: '图片',
+          prop: 'imgUrl',
+          align: 'center',
+          width: '150',
+          showOverflowTooltip: true
+        },
+
         {
           label: '批次号',
           prop: 'batchNo',
@@ -1072,7 +1088,7 @@ export default {
           prop: 'defaultValue',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth:300,
+          minWidth: 300,
           slot: 'defaultValue'
         },
 

+ 31 - 4
src/views/sample/sampleRecord/components/addSample.vue

@@ -285,7 +285,19 @@
         :needPage="false"
         height="400px"
         full-height="calc(100vh - 120px)"
-      ></ele-pro-table>
+      >
+        <!-- <template>imgUrl</template> -->
+        <template v-slot:imgUrl="{ row, $index }">
+          <fileMain
+            v-model="row.imgUrl"
+            :directoryId="
+              $store.state.user.info.clientEnvironmentId == 10
+                ? '2065608790337171458'
+                : ''
+            "
+          ></fileMain>
+        </template>
+      </ele-pro-table>
     </el-form>
     <bpmDetail
       v-if="activeComp == 'bpm' && form.processInstanceId"
@@ -424,6 +436,12 @@
             prop: 'categoryName',
             align: 'center'
           },
+          {
+            label: '照片',
+            prop: 'imgUrl',
+            slot: 'imgUrl',
+            align: 'center'
+          },
           { label: '批次号', prop: 'batchNo', align: 'center' },
           { label: '发货条码', prop: 'barcodes', align: 'center' },
           { label: '包装编码', prop: 'packageNo', align: 'center' },
@@ -680,6 +698,15 @@
           await this.queryQualityTempleContent(
             !list1.length && row.qualityMode == 1
           );
+          if (this.$store.state.user.info.clientEnvironmentId == 10&&this.form.qualityType==3) {
+            this.form.qualityMode = 2;
+            this.form.recordingMethod = 2;
+            this.form.conditionType = 2;
+            this.form.quantity = 1;
+            this.form.portion = 1;
+            
+            await this.queryQualityTempleContent(true);
+          }
         }
       },
       getById(id) {
@@ -790,9 +817,9 @@
         this.packingSpecificationOption = listArr;
         this.tableList = res.list;
         this.selection = res.list;
-        this.$nextTick(()=>{
-               this.$refs.sourceTable.toggleAllSelection()
-        })
+        this.$nextTick(() => {
+          this.$refs.sourceTable.toggleAllSelection();
+        });
         return res;
       },