Просмотр исходного кода

新增任务报工和委外的收发货

695593266@qq.com 9 месяцев назад
Родитель
Сommit
d60ea2d7a4

+ 2 - 2
src/views/outsourcing/index.vue

@@ -165,7 +165,7 @@
             提交
           </el-link>
 
-          <!-- <el-link
+          <el-link
             type="primary"
             :underline="false"
             @click="sendGoods(row, 'add')"
@@ -184,7 +184,7 @@
             v-if="row.approvalStatus == 2 && row.sendStatus == 1"
           >
             收货
-          </el-link> -->
+          </el-link>
         </template>
       </ele-pro-table>
     </el-card>

+ 6 - 7
src/views/produce/components/new_produceOrder.vue

@@ -93,7 +93,6 @@
   import routings from './routings.vue';
   import { isFullscreen } from 'ele-admin';
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
-  import { pageByCurrentUser } from '@/api/workOrderList';
 
   import {
     getList,
@@ -111,11 +110,11 @@
         default: () => {
           return null;
         }
-      },
-      activeName: {
-        type: String,
-        default: '0'
       }
+      // activeName: {
+      //   type: String,
+      //   default: '0'
+      // }
     },
     data() {
       return {
@@ -448,7 +447,7 @@
           return [];
         }
 
-        const URL = this.activeName == '1' ? pageByCurrentUser : workorderPage2;
+        // const URL = this.activeName == '1' ? pageByCurrentUser : workorderPage2;
 
         // console.log(this.taskObj?.id);
         // if (this.taskObj?.id == '1916800744740663298') {
@@ -457,7 +456,7 @@
         //     size: 1000
         //   });
         // } else {
-        return URL({
+        return workorderPage2({
           pageNum: page,
           size: 5000,
           workOrderId: this.$route.query.workOrderId

+ 488 - 0
src/views/produce/components/taskReport.vue

@@ -0,0 +1,488 @@
+<template>
+  <div class="ele-body">
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="110px"
+    >
+      <el-row>
+        <headerTitle style="margin-top: 15px" title="报工信息"></headerTitle>
+        <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
+          <el-form-item
+            :rules="{
+              required: true,
+              message: '请选择实际开始时间',
+              trigger: 'change'
+            }"
+            label="实际开始时间"
+            prop="realStartTime"
+          >
+            <el-date-picker
+              v-model="form.realStartTime"
+              :disabled="inputDis"
+              class="time_select"
+              placeholder="选择实际开始时间"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              @change="handleTimeChange"
+            ></el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
+          <el-form-item
+            :rules="{
+              required: true,
+              message: '请选择实际结束时间',
+              trigger: 'change'
+            }"
+            label="实际结束时间"
+            prop="realEndTime"
+          >
+            <el-date-picker
+              v-model="form.realEndTime"
+              :disabled="inputDis"
+              class="time_select"
+              placeholder="选择实际结束时间"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              @change="handleTimeChange"
+            ></el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
+          <el-form-item label="合格数量" prop="qualifiedQuantity">
+            <el-input
+              v-model.number="form.qualifiedQuantity"
+              :disabled="inputDis"
+              placeholder="请输入"
+              type="number"
+              @input="(e) => handleQuantityInput(e, 'qualifiedQuantity')"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
+          <el-form-item label="不合格数量" prop="unqualifiedQuantity">
+            <el-input
+              v-model.number="form.unqualifiedQuantity"
+              :disabled="inputDis"
+              placeholder="请输入"
+              type="number"
+              @input="(e) => handleQuantityInput(e, 'unqualifiedQuantity')"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
+          <el-form-item label="合格重量" prop="qualifiedWeight">
+            <el-input
+              v-model.number="form.qualifiedWeight"
+              :disabled="inputDis"
+              placeholder="请输入"
+              type="number"
+              @input="(e) => handleWeightInput(e, 'qualifiedWeight')"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
+          <el-form-item label="不合格重量" prop="unqualifiedWeight">
+            <el-input
+              v-model.number="form.unqualifiedWeight"
+              :disabled="inputDis"
+              placeholder="请输入"
+              type="number"
+              @input="(e) => handleWeightInput(e, 'unqualifiedWeight')"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
+          <el-form-item label="报工数" prop="reportQuantity">
+            <el-input
+              v-model.number="form.reportQuantity"
+              :disabled="inputDis"
+              placeholder="请输入"
+              type="number"
+              @input="(e) => handleQuantityInput(e, 'reportQuantity')"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
+          <el-form-item label="损耗数" prop="lossQuantity">
+            <el-input
+              v-model.number="form.lossQuantity"
+              :disabled="inputDis"
+              placeholder="请输入"
+              type="number"
+              @input="(e) => handleQuantityInput(e, 'lossQuantity')"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="备注信息">
+            <el-input
+              v-model="form.remark"
+              :disabled="inputDis"
+              :rows="2"
+              placeholder="请输入"
+              type="textarea"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row class="tool_btn">
+        <el-button type="primary" @click="submitAdd" :loading="loadingBtn"
+          >报工</el-button
+        >
+      </el-row>
+      <headerTitle style="margin-top: 15px" title="工单信息"></headerTitle>
+      <el-row :gutter="10" class="basic">
+        <el-col
+          v-for="item in fieldMap.orderList"
+          :key="item.prop"
+          :lg="8"
+          :md="12"
+          :sm="12"
+          :xl="8"
+          :xs="12"
+        >
+          <el-form-item :label="item.label" class="form80">
+            <el-input v-model="current[item.prop]" disabled>
+              <template slot="append" v-if="item.label == '要求生产数量:'">
+                {{ current['measuringUnit'] }}
+              </template>
+
+              <template slot="append" v-if="item.label == '要求生产重量:'">
+                {{ current['newWeightUnit'] }}
+              </template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <headerTitle style="margin-top: 15px" title="任务信息"></headerTitle>
+      <el-row :gutter="10" class="basic">
+        <el-col
+          v-for="item in fieldMap.taskList"
+          :key="item.prop"
+          :lg="8"
+          :md="12"
+          :sm="12"
+          :xl="8"
+          :xs="12"
+        >
+          <el-form-item :label="item.label" class="form80">
+            <el-input v-model="current[item.prop]" disabled>
+              <template slot="append" v-if="item.label == '任务数量:'">
+                {{ current['measuringUnit'] }}
+              </template>
+
+              <template slot="append" v-if="item.label == '任务重量:'">
+                {{ current['newWeightUnit'] }}
+              </template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <!-- <el-row v-if="title === '详情'">
+        <headerTitle style="margin-top: 15px" title="报工记录"></headerTitle>
+        <ModifyRecord ref="ModifyRecordRef" :list="list" />
+      </el-row> -->
+      <div slot="footer" class="tool_btn">
+        <el-button @click="cancel">关闭</el-button>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  import {
+    listWorkCenter,
+    batchUpdateRealTime,
+    listUpdateRealTimeRecord
+  } from '@/api/workOrderList';
+  import ModifyRecord from '@/views/taskList/components/ModifyRecord.vue';
+  export default {
+    components: {
+      ModifyRecord
+    },
+    props: {
+      currentRow: {
+        type: Object,
+        default: () => ({})
+      }
+    },
+    data() {
+      return {
+        title: '详情',
+        form: {
+          realEndTime: '',
+          realStartTime: '',
+          unqualifiedWeight: '',
+          unqualifiedQuantity: '',
+          qualifiedWeight: '',
+          qualifiedQuantity: '',
+          remark: '',
+          reportQuantity: '',
+          lossQuantity: ''
+        },
+        rules: {
+          // qualifiedQuantity: [
+          //   {
+          //     required: true,
+          //     message: '请输入合格数量',
+          //     trigger: 'blur'
+          //   }
+          // ],
+          // qualifiedWeight: [
+          //   {
+          //     required: true,
+          //     message: '请输入合格重量',
+          //     trigger: 'blur'
+          //   }
+          // ],
+          // unqualifiedQuantity: [
+          //   {
+          //     required: true,
+          //     message: '请输入不合格数量',
+          //     trigger: 'blur'
+          //   }
+          // ],
+          // unqualifiedWeight: [
+          //   {
+          //     required: true,
+          //     message: '请输入不合格重量',
+          //     trigger: 'blur'
+          //   }
+          // ]
+          reportQuantity: [
+            {
+              required: true,
+              message: '请输入报工数量',
+              trigger: 'blur'
+            }
+          ],
+
+          lossQuantity: [
+            {
+              required: true,
+              message: '请输入损耗数量',
+              trigger: 'blur'
+            }
+          ]
+        },
+        current: {},
+        detailsVisible: false,
+        fieldMap: {
+          orderList: [
+            { label: '计划批次号:', prop: 'batchNo' },
+            { label: '工单编码:', prop: 'mesWorkOrderCode' },
+            { label: '编码', prop: 'productCode' },
+            { label: '名称', prop: 'productName' },
+            { label: '规格', prop: 'specification' },
+            { label: '生产订单编码:', prop: 'workOrderCode' },
+            { label: '计划编号:', prop: 'productionPlanCode' },
+            { label: '工艺路线:', prop: 'produceRoutingName' },
+            { label: '要求生产数量:', prop: 'formingNum' },
+            { label: '要求生产重量:', prop: 'formingWeight' },
+            { label: '所属工厂:', prop: 'factoryName' },
+            { label: '所属班组:', prop: 'assignTeamName' },
+            { label: '计划开始时间:', prop: 'planStartTime' },
+            { label: '计划结束时间:', prop: 'planCompleteTime' }
+          ],
+          taskList: [
+            { label: '任务编码:', prop: 'assignCode' },
+            { label: '工序名称:', prop: 'taskName' },
+            { label: '执行类型:', prop: 'assigneeType' },
+            { label: '执行对象名称:', prop: 'assigneeName' },
+            { label: '工时:', prop: 'durationText' },
+            { label: '任务开始时间:', prop: 'startTime' },
+            { label: '任务结束时间:', prop: 'endTime' },
+            { label: '任务数量:', prop: 'quantity' },
+            { label: '任务重量:', prop: 'weight' }
+          ]
+        },
+        loadingBtn: false,
+        list: [],
+        inputDis: false
+      };
+    },
+    computed: {
+      // inputDis() {
+      //   return this.title === '详情';
+      // }
+    },
+    methods: {
+      open(type, row, form) {
+        this.title = type === 'report' ? '报工' : '详情';
+        this.detailsVisible = true;
+        this.current = { ...row };
+        if (form.realEndTime) {
+          this.$nextTick(() => {
+            this.form = { ...form };
+          });
+          if (type !== 'report') {
+            listUpdateRealTimeRecord(row.apsAssigneeId)
+              .then((res) => {
+                if (res) {
+                  this.list = res;
+                }
+              })
+              .catch((err) => {
+                this.$message.error(err.message);
+              });
+          }
+        }
+        this.getData();
+      },
+      cancel() {
+        this.form = {
+          realEndTime: '',
+          realStartTime: '',
+          unqualifiedWeight: '',
+          unqualifiedQuantity: '',
+          qualifiedWeight: '',
+          qualifiedQuantity: '',
+          remark: '',
+          reportQuantity: '',
+          lossQuantity: ''
+        };
+        this.$refs.form.resetFields();
+        this.detailsVisible = false;
+      },
+      async getData() {
+        try {
+          const res = await listWorkCenter(this.current.firstTaskId);
+          this.$set(this.current, 'factoryName', res[0].factoryName);
+        } catch (err) {
+          this.$message.warning(err.message);
+        }
+      },
+      // 时间选择
+      handleTimeChange() {
+        // 如果结束时间早于开始时间,清空结束时间
+
+        if (this.form.realStartTime && this.current.startTime) {
+          const realStartTime = new Date(this.form.realStartTime).getTime();
+          const realEndTime = new Date(this.current.startTime).getTime();
+          if (realStartTime < realEndTime) {
+            this.form.realStartTime = '';
+            this.$message.warning('实际开始时间不能早于任务开始时间');
+          }
+        }
+
+        if (this.form.realStartTime && this.form.realEndTime) {
+          const realStartTime = new Date(this.form.realStartTime).getTime();
+          const realEndTime = new Date(this.form.realEndTime).getTime();
+          if (realStartTime > realEndTime) {
+            this.form.realEndTime = '';
+            this.$message.warning('结束时间不能早于开始时间');
+          }
+        }
+      },
+      // 重量正则判断
+      handleWeightInput(e, type) {
+        // 过滤非数字和非小数点字符(包括负号)
+        let value = e.replace(/[^\d.]/g, '');
+        // 限制只能有一个小数点
+        const dotCount = (value.match(/\./g) || []).length;
+        if (dotCount > 1) {
+          value = value.slice(0, value.lastIndexOf('.'));
+        }
+        // 限制不能以小数点开头
+        if (value.startsWith('.')) {
+          value = '0' + value;
+        }
+        // 更新绑定值
+        this.form[type] = value;
+        // this.calculateWeight(type);
+      },
+      //计算重量
+      calculateWeight(type) {
+        let total =
+          this.form.qualifiedWeight - 0 + (this.form.unqualifiedWeight - 0);
+        if (total > this.current.weight) {
+          this.form[type] = 0;
+          this.$message.warning('合格重量加不合格重量不能大于任务重量');
+        }
+      },
+      // 计算数量
+      calculateQuantity(type) {
+        let total = this.form.reportQuantity - 0 + (this.form.lossQuantity - 0);
+        if (total > this.current.formingNum) {
+          this.form[type] = 0;
+          this.$message.warning('报工数量加损耗数量不能大于要求完成数量');
+        }
+      },
+      // 数量正则 quantity
+      handleQuantityInput(e, type) {
+        // 过滤非数字字符(包括负号)
+        let value = e.replace(/[^\d]/g, '');
+        // 限制不能以 0 开头(除非是 0 本身)
+        if (value.startsWith('0') && value.length > 1) {
+          value = value.slice(1);
+        }
+        // 更新绑定值
+        this.form[type] = value;
+        this.calculateQuantity(type);
+      },
+      submitAdd() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) return;
+          // if (
+          //   this.form.qualifiedQuantity -
+          //     0 +
+          //     (this.form.unqualifiedQuantity - 0) !==
+          //   this.current.quantity
+          // ) {
+          //   return this.$message.warning(
+          //     `合格数量加不合格数量要等于任务数量${this.current.quantity}`
+          //   );
+          // }
+          // if (
+          //   this.form.qualifiedWeight -
+          //     0 +
+          //     (this.form.unqualifiedWeight - 0) !==
+          //   this.current.weight
+          // ) {
+          //   return this.$message.warning(
+          //     `合格重量加不合格重量要等于任务重量${this.current.weight}`
+          //   );
+          // }
+          let data = {
+            ...this.form,
+            apsAssigneeId: this.current.apsAssigneeId
+          };
+          this.loadingBtn = true;
+          batchUpdateRealTime([data])
+            .then((res) => {
+              this.loadingBtn = false;
+              if (res) {
+                this.$message.success('报工成功');
+                this.cancel();
+                this.$emit('success');
+              }
+            })
+            .catch((err) => {
+              this.loadingBtn = false;
+              this.$message.error(err.message);
+            });
+        });
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  ::v-deep .time_select {
+    width: 100%;
+  }
+
+  ::v-deep .tool_btn {
+    text-align: right;
+
+    .el-button {
+      padding: 10px 18px !important;
+      font-size: 15px !important;
+    }
+  }
+</style>

+ 549 - 0
src/views/produce/components/taskWorkList.vue

@@ -0,0 +1,549 @@
+<template>
+  <div>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      height="calc(100vh - 280px)"
+      width="100%"
+      :datasource="datasource"
+      :selection.sync="selection"
+      @selection-change="handleSelectionChange"
+      @cell-click="cellClick"
+      highlight-current-row
+      @select="cellClick"
+      :need-page="false"
+      @sort-change="onSortChange"
+      @columns-change="handleColumnChange"
+      :cache-key="cacheKeyUrl"
+      :row-class-name="tableRowClassName"
+    >
+      <template v-slot:assigneeCode="{ row }">
+        <el-link
+          :underline="false"
+          type="primary"
+          @click="details('assign', row)"
+          >{{ row.assigneeCode }}
+        </el-link>
+      </template>
+
+      <template v-slot:workOrderCode="{ row }">
+        <el-link
+          :underline="false"
+          type="primary"
+          @click="details('assign', row)"
+          >{{ row.workOrderCode }}
+        </el-link>
+      </template>
+      <template v-slot:disposalStatus="{ row }">
+        <el-tag v-if="row.disposalStatus == 1" type="success">已接收</el-tag>
+        <el-tag v-if="row.disposalStatus == 2" type="danger">已拒绝</el-tag>
+      </template>
+    </ele-pro-table>
+
+    <Ddtails ref="detailsRef" @success="reload" />
+  </div>
+</template>
+
+<script>
+  import { isFullscreen } from 'ele-admin';
+  import tableColumnsMixin from '@/mixins/tableColumnsMixin';
+  import { pageByCurrentUser } from '@/api/workOrderList';
+  import Ddtails from '@/views/taskList/components/Ddtails.vue';
+
+  export default {
+    components: { Ddtails },
+    mixins: [tableColumnsMixin],
+    emits: ['changeIsPreProductionResult'],
+    props: {
+      produceTaskInfo: {
+        type: Object,
+        default: () => {
+          return null;
+        }
+      }
+      // activeName: {
+      //   type: String,
+      //   default: '0'
+      // }
+    },
+    data() {
+      return {
+        loading: false,
+        selection: [],
+
+        routeObj: {},
+        routingShow: false,
+
+        code: '',
+
+        internalIsFullscreen: isFullscreen(), // 初始值
+        cacheKeyUrl: 'mes-145878-mes-task-work-list',
+        columnsVersion: 0
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            fixed: true
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            slot: 'assigneeCode',
+            prop: 'assigneeCode',
+            label: '任务编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 210
+          },
+          {
+            slot: 'workOrderCode',
+            prop: 'workOrderCode',
+            label: '生产订单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 210
+          },
+          {
+            prop: 'mesWorkOrderCode',
+            label: '生产工单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 210
+          },
+          {
+            prop: 'productionPlanCode',
+            label: '计划编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 170
+          },
+          {
+            prop: 'assigneeType',
+            label: '执行类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 120,
+            formatter: (row) => {
+              if (!row.assigneeType) return '';
+              return row.assigneeType.desc;
+            }
+          },
+          {
+            prop: 'assigneeName',
+            label: '执行对象名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+          {
+            prop: 'workCenterName',
+            label: '工作中心',
+            align: 'center',
+            width: 180,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'assignTeamName',
+            label: '班组名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+          {
+            prop: 'taskName',
+            label: '工序名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 170
+          },
+          {
+            prop: 'productCode',
+            label: '产品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 170
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 200
+          },
+          {
+            prop: 'productionCodes',
+            label: '生产编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 170
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 170
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            width: 100,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center',
+            width: 200,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'quantity',
+            label: '任务数量',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 110
+          },
+          {
+            prop: 'weight',
+            label: '任务重量(kg)',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 110
+          },
+          {
+            prop: 'planStartTime',
+            label: '计划开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+
+          {
+            prop: 'planCompleteTime',
+            label: '计划结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+          {
+            prop: 'startTime',
+            label: '任务开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+
+          {
+            prop: 'endTime',
+            label: '任务结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+          {
+            label: '实际开始时间',
+            prop: 'realStartTime',
+            minWidth: 150,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '实际结束时间',
+            prop: 'realEndTime',
+            minWidth: 150,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '工时',
+            prop: 'durationText',
+            width: 150,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'firstTaskName',
+            label: '首工序',
+            align: 'center',
+            width: 180,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+          {
+            prop: 'statusText',
+            label: '状态',
+            align: 'center',
+            // formatter: (row) => {
+            //   const obj = this.statusOpt.find((i) => i.value == row.status);
+            //   return obj && obj.label;
+            // },
+            width: 120
+          },
+          {
+            prop: 'disposalStatus',
+            label: '任务接收状态',
+            align: 'center',
+            slot: 'disposalStatus',
+            width: 120
+          },
+          {
+            prop: 'customerName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+          {
+            prop: 'serialNo',
+            label: '客户代号',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          },
+
+          {
+            prop: 'simpleName',
+            label: '客户简称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 180
+          }
+        ];
+      },
+
+      taskObj() {
+        return this.$store.state.user.taskObj;
+      },
+      current() {
+        console.log(this.$store.state.user, 'this.$store.state.user');
+
+        return this.$store.state.user.currentObj.id;
+      }
+    },
+
+    watch: {
+      taskObj: {
+        handler(val) {
+          console.log('123');
+          this.reload();
+        },
+        // immediate: true,
+        deep: true
+      },
+      current: {
+        handler(val) {
+          console.log('456');
+          this.reload();
+        },
+        // immediate: true,
+        deep: true
+      }
+    },
+    created() {},
+
+    mounted() {
+      // 添加窗口resize事件监听器
+      window.addEventListener('resize', this.handleResize);
+    },
+
+    beforeDestroy() {
+      // 组件销毁前移除事件监听器,防止内存泄漏
+      window.removeEventListener('resize', this.handleResize);
+    },
+    methods: {
+      details(type, row) {
+        let currentRow = {
+          assignCode: row.assignCode,
+          mesWorkOrderCode: row.mesWorkOrderCode,
+          workOrderCode: row.workOrderCode,
+          productionPlanCode: row.productionPlanCode,
+          produceRoutingName: row.produceRoutingName,
+          formingNum: row.formingNum,
+          assignTeamName: row.assignTeamName,
+          formingWeight: row.formingWeight,
+          planStartTime: row.planStartTime,
+          planCompleteTime: row.planCompleteTime,
+          startTime: row.startTime,
+          firstTaskId: row.firstTaskId,
+          endTime: row.endTime,
+          taskName: row.taskName,
+          firstTaskName: row.firstTaskName,
+          assigneeType: row.assigneeType ? row.assigneeType.desc : '',
+          assigneeName: row.assigneeName,
+          weight: row.weight,
+          quantity: row.quantity,
+          durationText: row.durationText,
+          apsAssigneeId: row.id,
+          batchNo: row.batchNo,
+          productCode: row.productCode,
+          productName: row.productName,
+          specification: row.specification,
+          newWeightUnit: row.newWeightUnit,
+          measuringUnit: row.measuringUnit
+        };
+        let form = {
+          realEndTime: row.realEndTime,
+          realStartTime: row.realStartTime,
+          unqualifiedWeight: row.unqualifiedWeight,
+          unqualifiedQuantity: row.unqualifiedQuantity,
+          qualifiedWeight: row.qualifiedWeight,
+          remark: row.assigneeRemark,
+          qualifiedQuantity: row.qualifiedQuantity,
+          reportQuantity: row.reportQuantity,
+          lossQuantity: row.lossQuantity
+        };
+
+        this.$refs.detailsRef.open(type, currentRow, form);
+      },
+
+      tableRowClassName({ row, rowIndex }) {
+        if (row.outsourceStatus == 2) {
+          return 'warning-row';
+        }
+
+        if (row.entrustStatus == 2) {
+          return 'ent-row';
+        }
+      },
+
+      /* 表格数据源 */
+      datasource({ page, where }) {
+        if (!this.taskObj?.id) {
+          return [];
+        }
+
+        return pageByCurrentUser({
+          pageNum: page,
+          size: 5000,
+          workOrderId: this.$route.query.workOrderId
+            ? this.$route.query.workOrderId
+            : null,
+          taskId: this.taskObj && this.taskObj.id,
+          deviceId: this.current && this.current.deviceId,
+          keyWord: this.keyWord,
+          taskName: this.taskName,
+          ...where
+        });
+        // }
+      },
+
+      onSortChange(e) {
+        console.log(e);
+        let sort = {
+          orderBy: e.order,
+          sortName: e.prop
+        };
+        this.where = sort;
+        this.reload();
+      },
+      handleSearch(obj) {
+        this.keyWord = obj.keyWord;
+        this.taskName = obj.taskName;
+        this.reload();
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where });
+        });
+      },
+
+      async handleSelectionChange(val) {
+        // console.log('val 选择的工单列表', val);
+        // console.log('this.produceTaskInfo', this.produceTaskInfo);
+        // let initReportValue = val[0] && val[0].singleReport;
+        // let allSame = true;
+
+        // val.forEach((item) => {
+        //   if (item.singleReport !== initReportValue) {
+        //     allSame = false;
+        //   }
+        // });
+
+        // if (!allSame) {
+        //   return this.$message.warning('请选择报工类型相同的工单');
+        // }
+        // if (val.length == 0) {
+        //   return this.$message.warning('请选择任务');
+        // }
+
+        if (val.length > 1) {
+          return this.$message.warning('任务报工只能选择一条');
+        }
+
+        let ids = [];
+        ids = val.map((item) => {
+          return item.id;
+        });
+        this.$emit('taskSelect', { ids: ids, list: val });
+      },
+      rowClick(e) {
+        this.$emit('rowTaskClick', e, this.taskObj.id);
+      },
+      cellClick() {
+        this.$nextTick(() => {
+          this.$emit('getTaskName', this.selection);
+        });
+      },
+
+      handRoute(row) {
+        this.routeObj = row;
+        this.routingShow = true;
+      },
+
+      closeRoute() {
+        this.routingShow = false;
+      },
+
+      handleResize() {
+        this.internalIsFullscreen = isFullscreen();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep .el-table .warning-row {
+    background: #39d9ac;
+    // color: #39d9ac;
+  }
+
+  ::v-deep .el-table .ent-row {
+    background: #b3e10b;
+    // color: #39d9ac;
+  }
+
+  ::v-deep .el-table .success-row {
+    background: #f0f9eb;
+  }
+</style>

Разница между файлами не показана из-за своего большого размера
+ 666 - 227
src/views/produce/index.vue


+ 1 - 1
src/views/taskList/components/Ddtails.vue

@@ -139,7 +139,7 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row class="tool_btn">
+      <el-row class="tool_btn" v-if="!inputDis">
         <el-button
           type="primary"
           size="medium"

Некоторые файлы не были показаны из-за большого количества измененных файлов