695593266@qq.com 8 kuukautta sitten
vanhempi
commit
938a9f90b4

+ 10 - 0
src/api/aps/index.js

@@ -175,3 +175,13 @@ export async function updateDisposalStatus(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+// 查询全部工厂 /main/factoryarea/getAllFactory
+export async function getAllFactory() {
+  const res = await request.get(`/main/factoryarea/getAllFactory`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 16 - 21
src/api/mes/index.js

@@ -26,7 +26,7 @@ export async function getCaptcha() {
 /**
  * 查询仓库列表
  */
- export async function getWarehouseList() {
+export async function getWarehouseList() {
   const res = await request.post(`/wms/warehouse/select/warehouseList`, {
     params: { status: 1 }
   });
@@ -36,13 +36,11 @@ export async function getCaptcha() {
   return Promise.reject(new Error(res.data.message));
 }
 
-/** 
- * 查询首页头部统计 
+/**
+ * 查询首页头部统计
  */
-export async function getCount(params) {
-  const res = await request.get(`/mes/index/count`, {
-    params
-  });
+export async function getCount(body) {
+  const res = await request.post(`/mes/index/count`, body);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -50,27 +48,22 @@ export async function getCount(params) {
 }
 
 /**
- * 查询工单完成统计 
+ * 查询工单完成统计
  */
-export async function getCompletionCount(params) {
-  const res = await request.get(`/mes/index/completionCount`, {
-    params
-  });
+export async function getCompletionCount(body) {
+  const res = await request.post(`/mes/index/completionCount`, body);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
-
 /**
- * 查询工单列表 
+ * 查询工单列表
  */
 
-export async function getOrderList(params) {
-  const res = await request.get(`/mes/index/getOrderList`, {
-    params
-  });
+export async function getOrderList(body) {
+  const res = await request.post(`/mes/index/getOrderList`, body);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -78,8 +71,10 @@ export async function getOrderList(params) {
 }
 
 // 不良占比
-export async function queryProportionDefectiveTypes () {
-  const res = await request.post(`/qms/quality_work_order/queryProportionDefectiveTypes`);
+export async function queryProportionDefectiveTypes(params) {
+  const res = await request.post(
+    `/qms/quality_work_order/queryProportionDefectiveTypes` + params
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -95,4 +90,4 @@ export async function getProductionReport(params) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 7 - 0
src/views/batchRecord/components/tables/qualityWorkOrderTable.vue

@@ -97,6 +97,13 @@
               return this.getDictValue('取样类型', `0${row.qualityMode}`);
             }
           },
+          {
+            prop: 'qualityName',
+            label: '报工人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
           {
             prop: 'qualityTime',
             label: '质检时间',

+ 1 - 0
src/views/home/data.js

@@ -163,6 +163,7 @@ export const barOption = (series, itemStyle = {}) => {
         }
       }
     ],
+    ...itemStyle,
     series
   };
 };

+ 203 - 39
src/views/home/index.vue

@@ -2,14 +2,55 @@
   <div class="ele-body">
     <el-row :gutter="15">
       <el-col :span="16" style="height: calc(57% - 51px)">
-        <el-radio-group v-model="form.timeType" @change="timeTypeChange">
-          <el-radio-button label="1">企业</el-radio-button>
-          <el-radio-button label="2">工厂</el-radio-button>
-          <el-radio-button label="3">班组</el-radio-button>
-          <el-radio-button label="4">产线</el-radio-button>
-        </el-radio-group>
+        <div
+          class=""
+          style="
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+          "
+        >
+          <el-radio-group v-model="form.timeType" @change="timeTypeChange">
+            <el-radio-button label="1">企业</el-radio-button>
+            <el-radio-button label="2">工厂</el-radio-button>
+            <!-- <el-radio-button label="3">班组</el-radio-button>
+          <el-radio-button label="4">产线</el-radio-button> -->
+          </el-radio-group>
+          <div>
+            <el-select
+              v-if="form.timeType === '2'"
+              v-model="params.factoryId"
+              filterable
+              placeholder="请选择工厂"
+              size="mini"
+              style="margin-right: 20px"
+            >
+              <el-option
+                v-for="item in factoryList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+            <el-date-picker
+              v-model="params.date"
+              type="monthrange"
+              range-separator="至"
+              start-placeholder="开始月份"
+              end-placeholder="结束月份"
+              size="mini"
+              :picker-options="pickerOptions"
+            >
+            </el-date-picker>
+          </div>
+        </div>
         <div style="height: 20%" class="item">
-          <div v-for="item in arr" :key="item" :style="{ color: item.color }">
+          <div
+            v-for="(item, index) in arr"
+            :key="index"
+            :style="{ color: item.color }"
+          >
             <img :src="item.imgUrl" />
             <div>
               <span>
@@ -67,10 +108,17 @@
     TooltipComponent,
     LegendComponent
   } from 'echarts/components';
-
   import VChart from 'vue-echarts';
   import { echartsMixin } from '@/utils/echarts-mixin';
-  import { getCount, getCompletionCount, getOrderList,queryProportionDefectiveTypes } from '@/api/mes/index';
+  import {
+    getCount,
+    getCompletionCount,
+    getOrderList,
+    queryProportionDefectiveTypes
+  } from '@/api/mes/index';
+
+  import { getAllFactory } from '@/api/aps/index.js';
+
   // 按需加载 echarts
   use([
     CanvasRenderer,
@@ -112,6 +160,12 @@
             imgUrl: require('../../assets/Group4.png'),
             unit: '',
             color: '#f97876'
+          },
+          {
+            name: '已延期',
+            num: '188',
+            imgUrl: require('../../assets/Group2.png'),
+            unit: ''
           }
         ],
 
@@ -121,10 +175,74 @@
         form: {
           finishTime: '',
           timeType: '1'
+        },
+        params: {
+          // 工厂id
+          factoryId: '',
+          // 时间
+          date: '',
+          createTimeStart: '',
+          createTimeEnd: ''
+        },
+        // 工厂列表
+        factoryList: [],
+        pickerOptions: {
+          shortcuts: [
+            {
+              text: '本月',
+              onClick(picker) {
+                picker.$emit('pick', [new Date(), new Date()]);
+              }
+            },
+            {
+              text: '今年至今',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date(new Date().getFullYear(), 0);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近六个月',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setMonth(start.getMonth() - 6);
+                picker.$emit('pick', [start, end]);
+              }
+            }
+          ]
         }
       };
     },
+    watch: {
+      params: {
+        deep: true,
+        handler(newVal) {
+          // 处理参数变化 根据date同步createTimeStart和createTimeEnd
+          if (newVal.date && newVal.date.length === 2) {
+            this.params.createTimeStart = this.$util.toDateString(
+              newVal.date[0],
+              'yyyy-MM'
+            );
+            this.params.createTimeEnd = this.$util.toDateString(
+              newVal.date[1],
+              'yyyy-MM'
+            );
+          } else {
+            this.params.createTimeStart = '';
+            this.params.createTimeEnd = '';
+          }
 
+          this.getCount();
+          this.getCompletionCount();
+          this.proportion();
+          this.$nextTick(() => {
+            this.$refs.table.reload();
+          });
+        }
+      }
+    },
     created() {
       // this.pieOption = pieOption([
       //   { value: 40, name: '  外观检测' },
@@ -134,19 +252,39 @@
       //   { value: 5, name: '  重量检测' }
       // ]);
 
+      // 设置params.date 为今年的开始和结束月份
+      const currentYear = new Date().getFullYear();
+      const startOfYear = new Date(currentYear, 0, 1); // 一月一日
+      const endOfYear = new Date(currentYear, 11, 31); // 十二月三十一日
+      this.params.date = [startOfYear, endOfYear];
+      this.params.createTimeStart = this.$util.toDateString(
+        startOfYear,
+        'yyyy-MM'
+      );
+      this.params.createTimeEnd = this.$util.toDateString(endOfYear, 'yyyy-MM');
+
       this.getCount();
       this.getCompletionCount();
+      this.proportion();
     },
     mounted() {
-      this.proportion();
+      this.getFactoryList();
       setTimeout(() => {
         this.$refs.barRef.resize();
         this.$refs.pieRef.resize();
       }, 300);
     },
     methods: {
+      async getFactoryList() {
+        const res = await getAllFactory();
+        this.factoryList = res;
+      },
       async proportion() {
-        const res = await queryProportionDefectiveTypes();
+        const res = await queryProportionDefectiveTypes(
+          `?factoryId=${this.params.factoryId || ''}&createTimeStart=${
+            this.params.createTimeStart
+          }&createTimeEnd=${this.params.createTimeEnd}`
+        );
         let list = res.map((el) => {
           return {
             value: el.unQualifiedNumber,
@@ -154,20 +292,28 @@
           };
         });
         this.pieOptions = pieOptions(list);
-        console.log(res, 'res ----');
       },
       datasource({ page, where, limit }) {
-        where.factoriesId = 0;
         return getOrderList({
           ...where,
           pageNum: page,
-          size: limit
+          size: limit,
+          createTimeStart: this.params.createTimeStart,
+          createTimeEnd: this.params.createTimeEnd,
+          factoryId: this.params.factoryId || null
         });
       },
-      timeTypeChange(){},
+      timeTypeChange() {
+        // 重置工厂选择
+        this.params.factoryId = '';
+      },
       //首页统计
       async getCount() {
-        let rest = await getCount({ factoriesId: 0 });
+        let rest = await getCount({
+          factoryId: this.params.factoryId || null,
+          createTimeStart: this.params.createTimeStart,
+          createTimeEnd: this.params.createTimeEnd
+        });
         this.arr.forEach((item, index) => {
           if (item.name === '生产总数') {
             item.num = rest.formingNum || 0;
@@ -177,6 +323,8 @@
             item.num = rest.formedNum || 0;
           } else if (item.name === '生产中数量') {
             item.num = rest.inProgressWorkOrderCount || 0;
+          } else if (item.name === '已延期') {
+            item.num = rest.postponeCount || 0;
           }
         });
         // console.log(rest, 'rest');
@@ -185,36 +333,52 @@
       //工单完成统计
       async getCompletionCount() {
         let params = {
-          startDate: new Date().getFullYear() + '-01-01',
-          endDate: new Date().getFullYear() + '-12-31',
-          factoriesId: 0
+          createTimeStart: this.params.createTimeStart,
+          createTimeEnd: this.params.createTimeEnd,
+          factoryId: this.params.factoryId || null
         };
         let rest = await getCompletionCount(params);
         let inWarehouseCountList = []; //入库数量
         let inProductCountList = []; //在制工单数
-        for (let i = 0; i < rest.length; i++) {
-          inWarehouseCountList.push(rest[i].inWarehouseCount);
-          inProductCountList.push(rest[i].inProductCountList);
-        }
-        this.barOption = barOption([
-          {
-            name: '工单入库数量',
-            barWidth: '25%',
-            data: inWarehouseCountList,
-            type: 'bar',
-            yAxisIndex: 0 // 使用第一个Y轴
-          },
+        let xAxisData = []; //X轴数据
+
+        rest.forEach((item) => {
+          inWarehouseCountList.push(item.inWarehouseCount);
+          inProductCountList.push(item.inProductCountList);
+          xAxisData.push(item.inProductDate);
+        });
+
+        this.barOption = barOption(
+          [
+            {
+              name: '工单入库数量',
+              barWidth: '25%',
+              data: inWarehouseCountList,
+              type: 'bar',
+              yAxisIndex: 0 // 使用第一个Y轴
+            },
+            {
+              name: '工单数',
+              symbolSize: 10,
+              data: inProductCountList,
+              type: 'line',
+              smooth: true,
+              itemStyle: {
+                color: '#ffab08'
+              }
+            }
+          ],
           {
-            name: '工单数',
-            symbolSize: 10,
-            data: inProductCountList,
-            type: 'line',
-            smooth: true,
-            itemStyle: {
-              color: '#ffab08'
+            xAxis: {
+              type: 'category',
+              data: xAxisData,
+              axisLabel: {
+                fontSize: window.innerHeight * 0.012
+              }
             }
           }
-        ]);
+        );
+        console.log('this.barOption', inWarehouseCountList, inProductCountList);
       }
     }
   };

+ 318 - 8
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -59,7 +59,30 @@
       </el-row>
       <el-row>
         <el-col :span="8">
-          <el-form-item label="检查完成时间" required prop="checkFinishTime">
+          <el-form-item label="当前工序">
+            <el-input
+              v-model="addForm.produceTaskName"
+              placeholder="当前工序"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <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%"
+              @change="computedDuration"
+            >
+            </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"
@@ -67,10 +90,68 @@
               value-format="yyyy-MM-dd HH:mm:ss"
               placeholder="选择日期"
               style="width: 100%"
+              @change="computedDuration"
             >
             </el-date-picker>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="执行人" required prop="teamId">
+            <el-select
+              v-model="addForm.teamId"
+              placeholder="请选择班组"
+              filterable
+              style="width: 120px"
+              @change="checkTeamList(addForm.teamId)"
+            >
+              <el-option
+                v-for="item in teamList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
+            <el-select
+              v-model="addForm.executeUsersIds"
+              placeholder="请选择执行人"
+              filterable
+              multiple
+              @change="changeId"
+            >
+              <div class="checkboxWrapper">
+                <el-checkbox v-model="checked" @change="checkChange">
+                  全选
+                </el-checkbox>
+              </div>
+              <el-option
+                v-for="item in teamUserList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="工时" required prop="duration">
+            <el-input
+              placeholder="请输入"
+              v-model="addForm.duration"
+              type="number"
+              min="0"
+              step="0.1"
+              @change="durationChagne"
+            >
+              <template slot="append">
+                <div style="width: 40px; box-sizing: border-box">小时</div>
+              </template>
+            </el-input>
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item label="检查有效期" required prop="checkValidity">
             <el-input
@@ -95,6 +176,8 @@
             </el-input>
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
         <el-col :span="8">
           <el-form-item label="结论" required prop="conclution">
             <el-radio-group v-model="addForm.conclution">
@@ -251,7 +334,6 @@
 </template>
 
 <script>
-  import { submit } from '@/api/entrust';
   import {
     recordRulesDetailPage,
     getRecordRulesDetail
@@ -265,6 +347,7 @@
     getById
   } from '@/api/producetaskrecordrulesrecord/index';
   import toolModal from '@/views/batchRecord/components/toolModal.vue';
+  import { getTeam } from '@/api/produce/job.js';
 
   export default {
     components: { SelectUser, toolModal },
@@ -280,6 +363,7 @@
         id: null,
         workshopArea: '',
         checkFinishTime: '',
+        checkStartTime: '',
         checkValidity: null,
         checkValidityUnit: '',
         conclution: null,
@@ -307,7 +391,20 @@
         workOrderCode: '',
         workOrderId: 0,
         itemTaskName: '',
-        brandNo: ''
+        brandNo: '',
+        duration: null,
+        // 执行人
+        executeUsersIds: [],
+        executeUsers: [
+          // {
+          //   teamId: 0,
+          //   teamName: '',
+          //   userId: 0,
+          //   userName: ''
+          // }
+        ],
+        // 班组id
+        teamId: ''
       };
 
       return {
@@ -315,9 +412,47 @@
         formDate,
         addForm: JSON.parse(JSON.stringify(formDate)),
         formRules: {
+          checkStartTime: [
+            { required: true, message: '请选择检查开始时间', trigger: 'blur' },
+            {
+              required: true,
+              message: '请选择检查开始时间',
+              trigger: 'change'
+            },
+            {
+              validator: (rule, value, callback) => {
+                if (!value) return callback();
+                const now = new Date();
+                const start = new Date(value);
+                if (start < now) {
+                  callback(new Error('开始时间不能小于当前时间'));
+                } else {
+                  callback();
+                }
+              },
+              trigger: 'blur'
+            }
+          ],
           checkFinishTime: [
             { required: true, message: '请选择检查完成时间', trigger: 'blur' },
-            { required: true, message: '请选择检查完成时间', trigger: 'change' }
+            {
+              required: true,
+              message: '请选择检查完成时间',
+              trigger: 'change'
+            },
+            {
+              validator: (rule, value, callback) => {
+                if (!value) return callback();
+                const start = new Date(this.addForm.checkStartTime);
+                const finish = new Date(value);
+                if (finish <= start) {
+                  callback(new Error('结束时间必须大于开始时间'));
+                } else {
+                  callback();
+                }
+              },
+              trigger: 'blur'
+            }
           ],
           conclution: [
             { required: true, message: '请选择结论', trigger: 'blur' },
@@ -338,6 +473,26 @@
               message: '请选择检查有效期单位',
               trigger: 'change'
             }
+          ],
+          duration: [
+            { required: true, message: '请输入工时', trigger: 'blur' },
+            { required: true, message: '请输入工时', trigger: 'change' },
+            {
+              validator: (rule, value, callback) => {
+                if (value === '' || value === null) {
+                  callback();
+                } else if (Number(value) <= 0) {
+                  callback(new Error('工时必须大于0'));
+                } else {
+                  callback();
+                }
+              },
+              trigger: 'blur'
+            }
+          ],
+          teamId: [
+            { required: true, message: '请选择班组', trigger: 'blur' },
+            { required: true, message: '请选择班组', trigger: 'change' }
           ]
         },
         productionInfo: null,
@@ -349,7 +504,11 @@
         // 工艺路线
         workOrderInfo: null,
         // 加载中 loading
-        loading: false
+        loading: false,
+        checked: false,
+        teamUserList: [],
+        teamList: [],
+        teamAllList: []
       };
     },
     computed: {
@@ -368,6 +527,14 @@
         return '类记录表';
       }
     },
+    mounted() {
+      if (localStorage.getItem('singleUserInfo') == '1') {
+        const data = JSON.parse(localStorage.getItem('chooseUserInfo'));
+        this.getTeamList(data.teamId);
+      } else {
+        this.getTeamList(this.$store.state.user.info.teamId);
+      }
+    },
     methods: {
       open(productionInfo, workOrderInfo) {
         console.log(
@@ -432,10 +599,25 @@
             return i;
           });
           this.$util.assignObject(this.addForm, data);
+          // 工时毫秒转小时
+          this.addForm.duration = (
+            this.addForm.duration /
+            (1000 * 60 * 60)
+          ).toFixed(2);
           this.addForm.recordRulesClassify += '';
           if (this.addForm.details?.length == 0) {
             this.getRuleList();
           }
+
+          this.addForm.executeUsersIds = this.addForm.executeUsers.map(
+            (i) => i.userId
+          );
+
+          this.addForm.teamId =
+            this.addForm.executeUsers.length > 0
+              ? this.addForm.executeUsers[0].teamId
+              : '';
+
           this.loading = false;
         } catch (error) {
           this.loading = false;
@@ -453,6 +635,8 @@
           this.addForm.ruleName = this.ruleInfo.name;
           this.addForm.deviceId = this.ruleInfo.deviceId;
           this.addForm.deviceName = this.ruleInfo.deviceName;
+          this.addForm.produceTaskName =
+            this.ruleInfo.produceTaskConfigs[0]?.produceTaskName;
         }
       },
       // 查询记录规则 事项列表
@@ -516,6 +700,16 @@
             return;
           }
 
+          if (this.addForm.executeUsersIds.length == 0) {
+            this.$message.warning('请选择执行人!');
+            return;
+          }
+
+          if (this.addForm.duration <= 0) {
+            this.$message.warning('工时必须大于0!');
+            return;
+          }
+
           // 报工需要验证 缓存不验证
           if (type == 'submit') {
             // 验证检查项目
@@ -537,16 +731,22 @@
             }
           }
 
-          console.log('this.addForm', this.addForm);
+          const body = JSON.parse(JSON.stringify(this.addForm));
+
+          // 工时小时转毫秒
+          body.duration = Number(body.duration);
+          body.duration = body.duration * 60 * 60 * 1000;
+
+          // 处理执行人
 
           // 提交
           this.butLoading = true;
           try {
             if (type == 'submit') {
-              await saveOrUpdateAndSubmit(this.addForm);
+              await saveOrUpdateAndSubmit(body);
               this.$message.success('报工成功!');
             } else {
-              const id = await saveOrUpdate(this.addForm);
+              const id = await saveOrUpdate(body);
               this.addForm.id = id;
               this.$message.success('缓存成功!');
             }
@@ -569,6 +769,7 @@
           this.productionInfo.recordId == null;
           this.addForm.workshopArea = '';
           this.addForm.checkFinishTime = null;
+          this.addForm.checkStartTime = null;
           this.addForm.checkValidity = null;
           this.addForm.checkValidityUnit = null;
           this.addForm.conclution = null;
@@ -605,6 +806,95 @@
       clearTool(row) {
         row.tools = [];
         row.toolNames = '';
+      },
+      checkTeamList(id) {
+        this.addForm.executeUsersIds = [];
+        const index = this.teamList.findIndex((item) => item.id == id);
+        this.teamUserList = this.teamAllList[index];
+        console.log('this.teamUserList', this.teamUserList);
+      },
+
+      async getTeamList(id) {
+        const ids = id.split(',');
+        this.teamList = [];
+        this.teamUserList = [];
+        const list = ids.map((item) => getTeam(item));
+
+        const dataList = await Promise.all(list);
+
+        dataList.forEach((item) => {
+          this.teamList.push({
+            name: item.name,
+            id: item.id
+          });
+
+          this.teamAllList.push(item.userVOList);
+        });
+      },
+      changeId() {
+        if (this.addForm.executeUsersIds.length == this.teamUserList.length) {
+          this.checked = true;
+        } else {
+          this.checked = false;
+        }
+
+        // 同步 executeUsers
+        this.addForm.executeUsers = this.addForm.executeUsersIds
+          .map((id) => {
+            const user = this.teamUserList.find((item) => item.id === id);
+            console.log('user', user);
+            if (user) {
+              return {
+                teamId: this.addForm.teamId,
+                teamName: this.teamList.find(
+                  (team) => team.id == this.addForm.teamId
+                )?.name,
+                userId: user.id,
+                userName: user.name
+              };
+            } else {
+              return null;
+            }
+          })
+          .filter((item) => item !== null);
+
+        console.log('this.addForm.executeUsers', this.addForm.executeUsers);
+
+        this.computedDuration();
+      },
+      checkChange() {
+        this.addForm.executeUsersIds = [];
+        if (this.checked) {
+          this.addForm.executeUsersIds = this.teamUserList.map(
+            (item) => item.id
+          );
+        } else {
+          this.addForm.executeUsersIds = [];
+        }
+      },
+      // 计算工时
+      computedDuration() {
+        if (
+          this.addForm.checkStartTime &&
+          this.addForm.checkFinishTime &&
+          this.addForm.executeUsersIds.length > 0
+        ) {
+          const start = new Date(this.addForm.checkStartTime);
+          const finish = new Date(this.addForm.checkFinishTime);
+          const diff = finish - start; // 毫秒差值
+          const hours = diff / (1000 * 60 * 60); // 转换为小时
+          const totalDuration = hours * this.addForm.executeUsersIds.length;
+          this.addForm.duration = totalDuration.toFixed(1);
+        }
+      },
+      durationChagne() {
+        // 保留小数后一位
+        if (
+          this.addForm.duration &&
+          this.addForm.duration.toString().includes('.')
+        ) {
+          this.addForm.duration = Number(this.addForm.duration).toFixed(1);
+        }
       }
     }
   };
@@ -625,4 +915,24 @@
   .el-form-item .el-form-item {
     margin-bottom: -5px;
   }
+
+  .checkboxWrapper {
+    padding: 8px 20px;
+    border-bottom: 1px solid #ccc;
+  }
+
+  ::v-deep .el-select__tags {
+    flex-wrap: nowrap;
+    overflow: auto;
+  }
+
+  /* 输入框最大宽度*/
+  ::v-deep .el-select__tags-text {
+    max-width: 90px;
+  }
+
+  /* 底部滚动条的高度*/
+  ::v-deep .el-select__tags::-webkit-scrollbar {
+    height: 2px !important;
+  }
 </style>

+ 3 - 0
vue.config.js

@@ -37,6 +37,9 @@ module.exports = {
         // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086', // 赵沙金
         target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.116:18086', // 赵沙金
         // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
         // target: 'http://192.168.1.144:18086',