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

禅道bug 2635 2633 2533 2270 2250 1588 修复

jingshuyong 11 месяцев назад
Родитель
Сommit
2010f03740

+ 32 - 32
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -682,31 +682,31 @@
             label: '库存',
             showOverflowTooltip: true
           },
-          {
-            prop: 'secureInventory',
-            label: '安全库存',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'lockQuantity',
-            label: '锁库数量',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'inTransitNum',
-            label: '在途数量',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'inTransitOrdersNum',
-            label: '在途已关联数量',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'availableQuantity',
-            label: '可用数量',
-            showOverflowTooltip: true
-          },
+          // {
+          //   prop: 'secureInventory',
+          //   label: '安全库存',
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   prop: 'lockQuantity',
+          //   label: '锁库数量',
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   prop: 'inTransitNum',
+          //   label: '在途数量',
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   prop: 'inTransitOrdersNum',
+          //   label: '在途已关联数量',
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   prop: 'availableQuantity',
+          //   label: '可用数量',
+          //   showOverflowTooltip: true
+          // },
           {
             prop: 'unit',
             label: '计量单位',
@@ -723,13 +723,13 @@
             minWidth: 120
           },
 
-          {
-            label: '采购数量',
-            slot: 'purchaseQuantity',
-            action: 'purchaseQuantity',
-            align: 'center',
-            minWidth: 120
-          },
+          // {
+          //   label: '采购数量',
+          //   slot: 'purchaseQuantity',
+          //   action: 'purchaseQuantity',
+          //   align: 'center',
+          //   minWidth: 120
+          // },
           {
             label: '采购周期',
             slot: 'purchasingCycle',

+ 50 - 31
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -16,7 +16,7 @@
         style="margin-bottom: 16px"
       >
         <el-form-item label="选择日期:">
-          <el-date-picker
+          <!-- <el-date-picker
             v-model="startTime"
             type="date"
             placeholder="选择日期"
@@ -24,6 +24,16 @@
             size="large"
             :picker-options="pickerOptions"
           >
+          </el-date-picker> -->
+          <el-date-picker
+            v-model="startTime"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :clearable="false"
+            :picker-options="pickerOptions"
+          >
           </el-date-picker>
         </el-form-item>
         <el-form-item>
@@ -679,24 +689,13 @@
         baseUnit: '',
         quota_calculation: 1,
         pickerOptions: {
-          disabledDate: (time) => {
-            // 获取三个月前的日期(修正版)
-            const threeMonthsAgo = new Date();
-            threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
-            // 获取当前日期
-            const today = new Date();
-            // 禁用三个月前的日期之前的日期和当前日期之后的日期
-            // 注意:这里使用setHours(0,0,0,0)来确保只比较日期部分
-            const threeMonthsAgoDate = new Date(threeMonthsAgo);
-            threeMonthsAgoDate.setHours(0, 0, 0, 0);
-            const todayDate = new Date(today);
-            todayDate.setHours(0, 0, 0, 0);
-            const timeDate = new Date(time);
-            timeDate.setHours(0, 0, 0, 0);
-            return timeDate < threeMonthsAgoDate || timeDate > todayDate;
+          // 限制最大可选日期为今天
+          disabledDate(time) {
+            const today = new Date(2025, 7, 29);
+            return time.getTime() > today.getTime();
           }
         },
-        startTime: ''
+        startTime: []
       };
     },
     watch: {
@@ -724,26 +723,41 @@
         }
       },
       async getKitting() {
+        let { startTime, endTime } = this.getTimeData();
         let params = {
           categoryId: this.planInfo.categoryId,
-          startTime: this.startTime
+          startTime,
+          endTime
         };
         const res = await getProductKitting(params);
         if (res) {
           this.kitComInfo = res;
         }
       },
+      getTimeData() {
+        let startTime = '';
+        let endTime = '';
+        if (this.startTime.length > 0) {
+          startTime = this.startTime[0];
+          endTime = this.startTime[1];
+        }
+        return { startTime, endTime };
+      },
       initTime() {
-        // 设置默认选中三个月前的日期时间
-        const threeMonthsAgo = new Date();
-        threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
-
-        // 格式化为 YYYY-MM-DD HH:mm:ss
-        const year = threeMonthsAgo.getFullYear();
-        const month = String(threeMonthsAgo.getMonth() + 1).padStart(2, '0');
-        const day = String(threeMonthsAgo.getDate()).padStart(2, '0');
-        const time = `${year}-${month}-${day}`;
-        this.startTime = time;
+        // 获取当前日期(今天)
+        const today = new Date(2025, 7, 29); // 注意:月份是0-based,8月对应7
+        // 计算三个月前的日期
+        const threeMonthsAgo = new Date(today);
+        threeMonthsAgo.setMonth(today.getMonth() - 3);
+        let start = this.formatDate(threeMonthsAgo);
+        let end = this.formatDate(today);
+        this.startTime = [start, end];
+      },
+      formatDate(date) {
+        const year = date.getFullYear();
+        const month = String(date.getMonth() + 1).padStart(2, '0');
+        const day = String(date.getDate()).padStart(2, '0');
+        return `${year}-${month}-${day}`;
       },
       selectCalculate(val) {
         this.attributeChange(this.formInline.attributeType);
@@ -820,18 +834,21 @@
           return;
         }
         let kitting = this.quota_calculation == 1 ? false : true;
+        let { startTime, endTime } = this.getTimeData();
         let params1 = {
           planId: this.planId,
           bomVersionId: this.formInline.bomId,
           produceType: 2,
-          startTime: this.startTime,
+          startTime,
+          endTime,
           kitting: kitting
         };
         let params2 = {
           planId: this.planId,
           bomVersionId: this.formInline.bomId,
           produceType: 3,
-          startTime: this.startTime,
+          startTime,
+          endTime,
           kitting: kitting
         };
         this.loading = true;
@@ -877,11 +894,13 @@
         let kitting = this.quota_calculation == 1 ? false : true;
         let produceType =
           this.produceType == 1 ? 1 : attributeType == 2 ? 2 : 3;
+        let { startTime, endTime } = this.getTimeData();
         let params = {
           planId: this.planId,
           bomVersionId: data.bomId,
           produceType: produceType,
-          startTime: this.startTime,
+          startTime,
+          endTime,
           kitting: kitting
         };
         this.loading = true;

+ 44 - 0
src/views/saleOrder/components/contentSearch.vue

@@ -0,0 +1,44 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
+</template>
+<script>
+  export default {
+    data() {
+      return {};
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+          {
+            label: '工号:',
+            value: 'jobNumber',
+            type: 'input',
+            placeholder: '工号'
+          },
+          {
+            label: '用户账号:',
+            value: 'loginName',
+            type: 'input',
+            placeholder: '用户账号'
+          },
+          {
+            label: '姓名:',
+            value: 'name',
+            type: 'input',
+            placeholder: '请输入'
+          },
+        ];
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', {
+          ...e
+        });
+      }
+    }
+  };
+</script>

+ 32 - 6
src/views/saleOrder/components/create-order.vue

@@ -63,7 +63,7 @@
                 clearable
                 v-model="form.customerName"
                 :disabled="form.saleType == 3"
-                style="width: calc(100% - 80px)"
+                style="width: calc(100% - 70px)"
               />
               <!-- <el-button style="margin-left: 3px;" size="small" type="primary" @click.native="$refs.contactDialogRef.open()"
               >选择
@@ -97,7 +97,18 @@
 
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
             <el-form-item label="业务员:">
-              <el-input clearable v-model="form.salesman" />
+              <el-input
+                clearable
+                v-model="form.salesman"
+                style="width: calc(100% - 70px)"
+              />
+              <el-button
+                style="margin-left: 3px"
+                type="primary"
+                size="small"
+                @click="selectPersonnel"
+                >选择</el-button
+              >
             </el-form-item>
           </el-col>
 
@@ -590,6 +601,8 @@
       ref="orderHomogeneityInspectInstallDialog"
     >
     </orderHomogeneityInspectInstallDialog>
+
+    <personnelDialog ref="personnelRef" @changePersonnel="changePersonnel" />
   </div>
 </template>
 
@@ -599,6 +612,7 @@
   import orderHomogeneityInspectDialog from './orderHomogeneityInspectDialog';
   import orderHomogeneityInspectInstallDialog from './orderHomogeneityInspectInstallDialog';
   import ProcessRoute from '@/components/selectionDialog/processRoute.vue';
+  import personnelDialog from './personnelDialog.vue';
   import {
     createOrUpdate,
     getOrderDetail,
@@ -620,7 +634,8 @@
       orderHomogeneityInspectDialog,
       orderHomogeneityInspectInstallDialog,
       ProcessRoute,
-      contactDialog
+      contactDialog,
+      personnelDialog
     },
     props: {
       isAdd: {
@@ -634,6 +649,8 @@
         loading: false,
         disabledList: [], //已保存数据不做删除
         form: {
+          salesman:'',
+          salesmanId:'',
           productInfoList: [],
           deliveryRequirements: 1,
           saleType: 1,
@@ -711,9 +728,9 @@
       };
     },
     watch: {
-      disabledList() {
-        console.log(this.disabledList, 'disabledList');
-      }
+      // disabledList() {
+      //   console.log(this.disabledList, 'disabledList');
+      // }
     },
     computed: {
       // 是否开启响应式布局
@@ -759,6 +776,13 @@
       this.getCodeData();
     },
     methods: {
+      selectPersonnel() {
+        this.$refs.personnelRef.open(this.form.salesmanId);
+      },
+      changePersonnel(row) {
+        this.form.salesman = row.name;
+        this.form.salesmanId = row.id;
+      },
       // 获取
       async getCodeData() {
         let arr1 = await this.getLevelCode('product_model_key');
@@ -902,6 +926,8 @@
 
       cancel() {
         this.form = {
+          salesmanId:'',
+          salesman:'',
           productInfoList: [],
           deliveryRequirements: 1,
           saleType: 1,

+ 52 - 32
src/views/saleOrder/components/orderHomogeneityInspectDialog.vue

@@ -16,7 +16,7 @@
         style="margin-bottom: 16px"
       >
         <el-form-item label="选择日期">
-          <el-date-picker
+          <!-- <el-date-picker
             v-model="startTime"
             type="date"
             placeholder="选择日期"
@@ -24,6 +24,16 @@
             size="large"
             :picker-options="pickerOptions"
           >
+          </el-date-picker> -->
+          <el-date-picker
+            v-model="startTime"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :clearable="false"
+            :picker-options="pickerOptions"
+          >
           </el-date-picker>
         </el-form-item>
         <el-form-item>
@@ -637,24 +647,13 @@
         baseUnit: '',
         quota_calculation: 1,
         pickerOptions: {
-          disabledDate: (time) => {
-            // 获取三个月前的日期(修正版)
-            const threeMonthsAgo = new Date();
-            threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
-            // 获取当前日期
-            const today = new Date();
-            // 禁用三个月前的日期之前的日期和当前日期之后的日期
-            // 注意:这里使用setHours(0,0,0,0)来确保只比较日期部分
-            const threeMonthsAgoDate = new Date(threeMonthsAgo);
-            threeMonthsAgoDate.setHours(0, 0, 0, 0);
-            const todayDate = new Date(today);
-            todayDate.setHours(0, 0, 0, 0);
-            const timeDate = new Date(time);
-            timeDate.setHours(0, 0, 0, 0);
-            return timeDate < threeMonthsAgoDate || timeDate > todayDate;
+          // 限制最大可选日期为今天
+          disabledDate(time) {
+            const today = new Date(2025, 7, 29);
+            return time.getTime() > today.getTime();
           }
         },
-        startTime: '',
+        startTime: [],
         kitting: false
       };
     },
@@ -692,16 +691,20 @@
         this.$refs.currentDetailDialog.open({ bomCode: row.code });
       },
       initTime() {
-        // 设置默认选中三个月前的日期时间
-        const threeMonthsAgo = new Date();
-        threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
-
-        // 格式化为 YYYY-MM-DD HH:mm:ss
-        const year = threeMonthsAgo.getFullYear();
-        const month = String(threeMonthsAgo.getMonth() + 1).padStart(2, '0');
-        const day = String(threeMonthsAgo.getDate()).padStart(2, '0');
-        const time = `${year}-${month}-${day}`;
-        this.startTime = time;
+        // 获取当前日期(今天)
+        const today = new Date(2025, 7, 29); // 注意:月份是0-based,8月对应7
+        // 计算三个月前的日期
+        const threeMonthsAgo = new Date(today);
+        threeMonthsAgo.setMonth(today.getMonth() - 3);
+        let start = this.formatDate(threeMonthsAgo);
+        let end = this.formatDate(today);
+        this.startTime = [start, end];
+      },
+      formatDate(date) {
+        const year = date.getFullYear();
+        const month = String(date.getMonth() + 1).padStart(2, '0');
+        const day = String(date.getDate()).padStart(2, '0');
+        return `${year}-${month}-${day}`;
       },
       open(dataList, order, source, produceType) {
         this.clearData();
@@ -768,9 +771,11 @@
         }
       },
       async getKitting() {
+        let { startTime, endTime } = this.getTimeData();
         let params = {
           categoryId: this.orderInfo.categoryId,
-          startTime: this.startTime
+          startTime,
+          endTime
         };
         const res = await getProductKitting(params);
         if (res) {
@@ -859,18 +864,21 @@
           return;
         }
         let kitting = this.quota_calculation == 1 ? false : true;
+        let { startTime, endTime } = this.getTimeData();
         let params1 = {
           salesOrderId: this.salesOrderId,
           bomVersionId: this.formInline.bomId,
           produceType: 2,
-          startTime: this.startTime,
+          startTime,
+          endTime,
           kitting: kitting
         };
         let params2 = {
           salesOrderId: this.salesOrderId,
           bomVersionId: this.formInline.bomId,
           produceType: 3,
-          startTime: this.startTime,
+          startTime,
+          endTime,
           kitting: kitting
         };
         this.loading = true;
@@ -919,11 +927,13 @@
           let produceType =
             this.produceType == 1 ? 1 : attributeType == 2 ? 2 : 3;
           let kitting = this.quota_calculation == 1 ? false : true;
+          let { startTime, endTime } = this.getTimeData();
           params = {
             salesOrderId: this.salesOrderId,
             bomVersionId: data.bomId,
             produceType: produceType,
-            startTime: this.startTime,
+            startTime,
+            endTime,
             kitting: kitting
           };
           api = findMaterialInfoSalesorder;
@@ -933,7 +943,8 @@
             categoryId: this.orderInfo.categoryId,
             bomVersionId: this.orderInfo.bomCategoryId,
             requiredFormingNum: this.orderInfo.contractNum,
-            startTime: this.startTime,
+            startTime,
+            endTime,
             kitting: kitting
           };
         }
@@ -947,6 +958,15 @@
           this.loading = false;
         }
       },
+      getTimeData() {
+        let startTime = '';
+        let endTime = '';
+        if (this.startTime.length > 0) {
+          startTime = this.startTime[0];
+          endTime = this.startTime[1];
+        }
+        return { startTime, endTime };
+      },
       // 结果数据处理
       resultProcess(result) {
         if (!result || result.length == 0) {

+ 227 - 0
src/views/saleOrder/components/personnelDialog.vue

@@ -0,0 +1,227 @@
+<template>
+  <ele-modal
+    title="选择业务员"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    top="5vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    :maxable="true"
+  >
+    <el-card shadow="never">
+      <contentSearch @search="reload"></contentSearch>
+
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        class="dict-table"
+        @cell-click="cellClick"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:action="{ row }">
+          <el-radio class="radio" v-model="radio" :label="row.id"
+            ><i></i
+          ></el-radio>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <div slot="footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getUserPage } from '@/api/system/organization';
+  import contentSearch from './contentSearch.vue';
+  export default {
+    components: { contentSearch },
+    props: {
+      classType: {
+        type: Number | String,
+        default: 1
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        statusOptions: [
+          { value: 1, label: '全职' },
+          { value: 2, label: '兼职' },
+          { value: 3, label: '实习' },
+          { value: 4, label: '正式' },
+          { value: 5, label: '试用' },
+          { value: 6, label: '离职' }
+        ],
+        columns: [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择',
+            width: 60
+          },
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 60,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left',
+            label: '序号'
+          },
+          {
+            prop: 'name',
+            label: '姓名',
+            slot: 'name',
+             align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'jobNumber',
+            label: '工号',
+             align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'postName',
+            label: '岗位',
+             align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          //   {
+          //     prop: 'factoryId',
+          //     label: '所属工厂',
+          //     sortable: 'custom',
+          //     showOverflowTooltip: true,
+          //     minWidth: 110,
+          //     formatter: (_row, _column, cellValue) => {
+          //       return this.factoryList.find((item) => item.id == cellValue)
+          //         ?.name;
+          //     }
+          //   },
+          {
+            prop: 'loginName',
+            label: '用户账号',
+             align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'sex',
+            label: '性别',
+             align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 80,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue == 1 ? '男' : cellValue == 2 ? '女' : '';
+            }
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            width: 80,
+            formatter: (_row, _column, cellValue) => {
+              const dom = this.statusOptions.find((item) => {
+                return item.value == cellValue;
+              });
+              return dom ? dom.label : '';
+            }
+          },
+          {
+            prop: 'isEnabled',
+            align: 'center',
+            label: '是否启用',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.isEnabled === 0
+                ? '停用'
+                : row.isEnabled === 1
+                ? '启用'
+                : '';
+            }
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+             align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          }
+        ],
+
+        radio: null
+      };
+    },
+
+    watch: {},
+    methods: {
+      open(item) {
+        if (item) {
+          this.radio = item.id;
+        }
+        this.visible = true;
+      },
+
+      //   /* 表格数据源 */
+      //   datasource({ page, limit, where, order }) {
+      //     return contactPageUsages({
+      //       pageNum: page,
+      //       size: limit,
+
+      //       ...where,
+      //       status: '1'
+      //     });
+      //   },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getUserPage({
+          ...where,
+          pageNum: page,
+          size: limit,
+          //   groupId: this.organizationId,
+          isQueryLZ: 0
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
+
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请选择业务员');
+        }
+        this.$emit('changePersonnel', this.current);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 104 - 63
src/views/workOrder/components/details.vue

@@ -7,39 +7,45 @@
     :maxable="true"
     :title="'详情'"
     append-to-body
-    :before-close="cancel"
+    :before-close="cancelDetails"
   >
     <div class="form-wrapper">
       <el-form
         ref="form"
         :model="form"
-        :inline="true"
         label-position="right"
-        label-width="100px"
+        label-width="107px"
       >
-        <el-row :gutter="10" class="basic" type="flex" style="flex-wrap: wrap">
+        <el-row
+          :gutter="10"
+          class="basic"
+          type="flex"
+          style="flex-wrap: wrap"
+          v-for="(el, index) in fieldList"
+          :key="index"
+        >
           <el-col
-            :xs="12"
-            :sm="12"
-            :md="12"
-            :lg="8"
+            :xs="6"
+            :sm="6"
+            :md="6"
+            :lg="6"
             :xl="6"
-            v-for="item in fieldList"
+            v-for="item in el"
             :key="item.prop"
           >
             <el-form-item :label="item.label">
               <!-- <div class="item_label">{{ current[item.prop] }}</div> -->
-              <el-input :value="fieldValue(item.prop)" disabled />
+              <el-input :value="fieldValue(item.prop)" readonly />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="10">
-          <el-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
+          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="6">
             <el-form-item label="所属工厂:">
-              <el-input v-model="form.factoryName" :disabled="true"> </el-input>
+              <el-input v-model="form.factoryName" :readonly="true"> </el-input>
             </el-form-item>
           </el-col>
-          <el-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
+          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="6">
             <el-form-item label="所属工作中心:">
               <el-select
                 style="width: 100%"
@@ -57,7 +63,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
+          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="6">
             <el-form-item label="所属班组:" required>
               <el-select
                 style="width: 100%"
@@ -78,21 +84,19 @@
         </el-row>
         <el-row>
           <el-form-item label="报工类型:" required>
-            <el-radio-group v-model="form.singleReport">
+            <el-radio-group v-model="form.singleReport" disabled>
               <!-- v-if="clientEnvironmentId != 2" -->
-              <el-radio :label="1" :disabled="singleDis">单件报工</el-radio>
-              <el-radio :label="0" :disabled="batchDis">批量报工</el-radio>
+              <el-radio :label="1">单件报工</el-radio>
+              <el-radio :label="0">批量报工</el-radio>
             </el-radio-group>
           </el-form-item>
         </el-row>
         <el-row>
           <el-form-item label="派单方式:" prop="taskAss">
             <!-- @change="changeDispatch" -->
-            <el-radio-group v-model="form.taskAss">
-              <el-radio :label="1" :disabled="orderDis">生产订单派单</el-radio>
-              <el-radio :label="0" :disabled="procTaskDis"
-                >工序任务派单</el-radio
-              >
+            <el-radio-group v-model="form.taskAss" disabled>
+              <el-radio :label="1">生产订单派单</el-radio>
+              <el-radio :label="0">工序任务派单</el-radio>
             </el-radio-group>
           </el-form-item>
         </el-row>
@@ -117,6 +121,7 @@
               placeholder="请选择工位"
               size="mini"
               multiple
+              disabled
               filterable
             >
               <el-option
@@ -137,6 +142,7 @@
               size="mini"
               filterable
               multiple
+              disabled
             >
               <el-option
                 v-for="item in crewList"
@@ -156,6 +162,7 @@
               size="mini"
               filterable
               multiple
+              disabled
             >
               <el-option
                 v-for="item in productionList"
@@ -194,7 +201,7 @@
               row-key="id"
             >
               <template v-slot:toolbar>
-                <el-button
+                <!-- <el-button
                   type="primary"
                   @click="dispatch(item, 1)"
                   :loading="toolbarLoading"
@@ -214,9 +221,9 @@
                   :loading="toolbarLoading"
                 >
                   保存
-                </el-button>
+                </el-button> -->
 
-                <div style="margin-left: 50px; display: inline-block">
+                <div style="display: inline-block">
                   <span
                     class="text"
                     style="
@@ -258,7 +265,7 @@
               </template>
               <template v-slot:quantity="{ row }">
                 <el-input
-                  :disabled="permissions(row)"
+                  :readonly="permissions(row)"
                   type="number"
                   v-model="row.quantity"
                   placeholder="请输入数量"
@@ -267,7 +274,7 @@
               </template>
               <template v-slot:weight="{ row }">
                 <el-input
-                  :disabled="permissions(row)"
+                  :readonly="permissions(row)"
                   type="number"
                   v-model="row.weight"
                   placeholder="请输入重量"
@@ -293,7 +300,7 @@
               </template>
               <template v-slot:startTime="{ row }">
                 <el-date-picker
-                  :disabled="permissions(row)"
+                  :readonly="permissions(row)"
                   class="w100"
                   v-model="row.startTime"
                   type="datetime"
@@ -304,7 +311,7 @@
               </template>
               <template v-slot:endTime="{ row }">
                 <el-date-picker
-                  :disabled="permissions(row)"
+                  :readonly="permissions(row)"
                   class="w100"
                   v-model="row.endTime"
                   type="datetime"
@@ -315,7 +322,7 @@
               </template>
 
               <template v-slot:action="{ row }">
-                <!--  :disabled="resetBtnDis(row)" -->
+                <!--  :readonly="resetBtnDis(row)" -->
                 <el-popconfirm
                   title="确定要重置该条数据吗?"
                   @confirm="resetData(row, item)"
@@ -333,10 +340,7 @@
     </div>
 
     <div slot="footer">
-      <el-button plain @click="cancel">取消</el-button>
-      <el-button type="primary" @click="confirm" :loading="toolbarLoading"
-        >确定</el-button
-      >
+      <el-button plain @click="cancelDetails">取消</el-button>
     </div>
   </ele-modal>
 </template>
@@ -384,19 +388,36 @@
         procTaskDis: false, // 工序任务派单选择
         firstTaskindex: '', // 首工序id 对应的工序列表数据下标
         fieldList: [
-          { label: '生产订单号:', prop: 'code' },
-          { label: '计划编号:', prop: 'productionPlanCode' },
-          { label: '工艺路线:', prop: 'produceRoutingName' },
-          // { label: '编码', prop: 'productCode' },
-          { label: '名称:', prop: 'productName' },
-          { label: '生产编号:', prop: 'productionCodes' },
-          { label: '牌号:', prop: 'brandNo' },
-          { label: '批次号:', prop: 'batchNo' },
-          { label: '型号:', prop: 'model' },
-          { label: '要求生产数量:', prop: 'formingNum' },
-          { label: '要求生产重量:', prop: 'initialWeight' },
-          { label: '计划开始时间:', prop: 'planStartTime' },
-          { label: '计划结束时间:', prop: 'planCompleteTime' }
+          [
+            { label: '生产订单号:', prop: 'code' },
+            { label: '计划编号:', prop: 'productionPlanCode' },
+            { label: '工艺路线:', prop: 'produceRoutingName' },
+            { label: '名称:', prop: 'productName' }
+          ],
+          [
+            { label: '生产编号:', prop: 'productionCodes' },
+            { label: '牌号:', prop: 'brandNo' },
+            { label: '批次号:', prop: 'batchNo' },
+            { label: '型号:', prop: 'model' }
+          ],
+          [
+            { label: '要求生产数量:', prop: 'formingNum' },
+            { label: '要求生产重量:', prop: 'initialWeight' },
+            { label: '计划开始时间:', prop: 'planStartTime' },
+            { label: '计划结束时间:', prop: 'planCompleteTime' }
+          ],
+          [
+            { label: 'BOM版本:', prop: 'bomCategoryName' },
+            { label: 'BOM类型:', prop: 'produceType' },
+            { label: '首工序:', prop: 'firstTaskName' },
+            { label: '创建时间:', prop: 'createTime' }
+          ],
+          [
+            { label: '机型:', prop: 'modelKey' },
+            { label: '颜色:', prop: 'colorKey' },
+            { label: '派单人:', prop: 'dispatcher' },
+            { label: '派单时间:', prop: 'dispatchTime' }
+          ]
         ],
         shiftList: [],
         dateValue: '',
@@ -410,7 +431,22 @@
     computed: {
       fieldValue() {
         return (field) => {
-          return this.current[field];
+          let value = this.current[field];
+          if (field == 'modelKey' || field == 'colorKey') {
+            return value.toString();
+          }
+          if (field == 'produceType') {
+            if (value == 1) {
+              return 'PBOM';
+            }
+            if (value == 2) {
+              return 'MBOM';
+            }
+            if (value == 3) {
+              return 'ABOM';
+            }
+          }
+          return value || '';
         };
       },
       clientEnvironmentId() {
@@ -423,7 +459,7 @@
         // if(this.form.taskAss == 1){
         //   return '1000px'
         // }
-        return '75vw';
+        return '85vw';
       },
       // 重置按钮 的置灰权限 没有进行操作跟派单的数据 置灰
       resetBtnDis() {
@@ -444,8 +480,9 @@
       // 列表输入框操作 已派单的不能操作
       permissions() {
         return (row) => {
-          if (!row.status) return false;
-          if (row.status.code == 1) return true;
+          // if (!row.status) return false;
+          // if (row.status.code == 1) return true;
+          return true;
         };
       },
       // 时间段显示
@@ -467,14 +504,14 @@
             align: 'center',
             fixed: 'left'
           },
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center',
-            fixed: 'left',
-            reserveSelection: true
-          },
+          // {
+          //   width: 45,
+          //   type: 'selection',
+          //   columnKey: 'selection',
+          //   align: 'center',
+          //   fixed: 'left',
+          //   reserveSelection: true
+          // },
           {
             prop: 'name',
             label: this.dynamicName,
@@ -580,6 +617,10 @@
               res.value == '0' ? 0 : res.value == '1' ? 1 : 2;
           }
         });
+      },
+
+      cancelDetails() {
+        this.$emit('update:detailsVisible', false);
       }
     }
   };
@@ -602,11 +643,11 @@
     margin-top: 20px;
   }
 
-  ::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
-    background-color: #10d070;
-    border-color: #10d070;
-  }
   ::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
     box-shadow: none;
   }
+
+  ::v-deep .el-input.is-disabled .el-input__inner {
+    color: #ab7777;
+  }
 </style>

+ 8 - 9
src/views/workOrder/index.vue

@@ -154,7 +154,7 @@
       ref="detailsRef"
       v-if="detailsVisible"
       :current="dispatchRow"
-      :detailsVisible="detailsVisible"
+      :detailsVisible.sync="detailsVisible"
     />
   </div>
 </template>
@@ -559,14 +559,13 @@
     methods: {
       // 进入详情
       openDetails(row) {
-        
-        // let dispatchRow = { ...row };
-        // this.dispatchRow = { ...row };
-        // dispatchRow.initialWeight = row.formingWeight
-        //   ? row.formingWeight + row.newWeightUnit
-        //   : '';
-        // this.dispatchRow = dispatchRow;
-        // this.detailsVisible = true;
+        let dispatchRow = { ...row };
+        this.dispatchRow = { ...row };
+        dispatchRow.initialWeight = row.formingWeight
+          ? row.formingWeight + row.newWeightUnit
+          : '';
+        this.dispatchRow = dispatchRow;
+        this.detailsVisible = true;
       },
       // 全选/取消全选
       selectAll(selection) {

+ 15 - 2
src/views/workOrder/mixins/release.js

@@ -75,10 +75,17 @@ export default {
     async workCenterData() {
       // 判断是否存在工序id 有的话就取否则取首工序id
       console.log(this.current, 'this.current 查询工作中心');
-      let id = this.current.taskId || this.current.firstTaskId;
+      let id = '';
+      if (!this.current.taskId || this.current.taskId < 0) {
+        id = this.current.firstTaskId;
+      } else {
+        id = this.current.taskId;
+      }
+      // this.current.taskId || this.current.firstTaskId;
       console.log(id, 'id 查询工作中心');
       const res = await listWorkCenter(id);
       this.workCenterList = res;
+      console.log(this.workCenterList, 'res 333');
       if (res.length > 0) {
         this.form.factoryName = res[0].factoryName;
         this.form.workCenterId = res[0].id;
@@ -260,7 +267,13 @@ export default {
     // 查询工位数据
     FirstTaskIdFn() {
       console.log(this.current, 'this.current 查询工位数据');
-      let id = this.current.taskId || this.current.firstTaskId;
+      // let id = this.current.taskId || this.current.firstTaskId;
+      let id = '';
+      if (!this.current.taskId || this.current.taskId < 0) {
+        id = this.current.firstTaskId;
+      } else {
+        id = this.current.taskId;
+      }
       console.log(id, 'id 查询工位数据');
       listByFirstTaskId(id)
         .then((res) => {