695593266@qq.com 3 miesięcy temu
rodzic
commit
f8016af0f8

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

@@ -300,7 +300,7 @@
             "
             @click="handleOrderPublish(1, row)"
           >
-            发布
+            审批
           </el-link>
           <el-link
             type="primary"
@@ -310,7 +310,7 @@
             :underline="false"
             @click="handleOrderPublish(2, row)"
           >
-            重新发
+            重新发起审批
           </el-link>
 
           <el-link

+ 196 - 1
src/views/saleOrder/components/plan-submit.vue

@@ -90,6 +90,69 @@
         </el-descriptions-item>
       </el-descriptions>
     </div>
+
+    <headerTitle title="计划列表" class="mt20" v-if="isAutoGenerateSubPlans">
+    </headerTitle>
+
+    <ele-pro-table
+      ref="table2"
+      :needPage="false"
+      :columns="jsColumns"
+      :datasource="jhList"
+      tool-class="ele-toolbar-actions"
+      max-height="360px"
+      v-if="isAutoGenerateSubPlans"
+    >
+      <!-- <template v-slot:toolbar>
+        <div class="toolbar_box">
+          <el-button type="primary" size="mini" @click="handleAdd"
+            >新增</el-button
+          >
+        </div>
+      </template> -->
+      <template v-slot:produceRoutingName="{ row }">
+        <span>{{ row.produceRoutingName }}</span>
+      </template>
+      <template v-slot:startTime="{ row }">
+        <el-date-picker
+          class="w100"
+          v-model="row.startTime"
+          type="datetime"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          placeholder="开始时间"
+          @change="handleStartTimeChange(row)"
+          disabled
+        ></el-date-picker>
+      </template>
+      <template v-slot:endTime="{ row }">
+        <el-date-picker
+          class="w100"
+          v-model="row.endTime"
+          type="datetime"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          @change="handleEndTimeChange(row)"
+          placeholder="完成时间"
+          disabled
+        ></el-date-picker>
+      </template>
+      <template v-slot:requiredFormingNum="{ row }">
+        <span>{{ row.requiredFormingNum }} {{ row.measuringUnit }}</span>
+      </template>
+      <template v-slot:action="{ row, $index }">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除这条数据吗?"
+          @confirm="removeRow(row, $index)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+
     <div slot="footer" class="footer">
       <div>
         <el-button @click="cancel">取消</el-button>
@@ -112,6 +175,7 @@
   import { getCode } from '@/api/codeManagement';
   import dictMixins from '@/mixins/dictMixins';
   import { debounce } from 'lodash';
+  import { parameterGetByCode } from '@/api/mainData/index';
 
   export default {
     mixins: [dictMixins],
@@ -123,12 +187,92 @@
       return {
         visible: false,
         loading: false,
-        tableList: []
+        tableList: [],
+        isAutoGenerateSubPlans: false,
+        jhList: [],
+        jsColumns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            prop: 'productCode',
+            label: '编码',
+            align: 'center',
+            minWidth: 140
+          },
+          {
+            prop: 'productName',
+            label: '名称',
+            align: 'center',
+            minWidth: 140
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            minWidth: 150,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            slot: 'startTime',
+            prop: 'startTime',
+            label: '计划开始时间',
+            align: 'center',
+            minWidth: 180
+          },
+          {
+            slot: 'endTime',
+            prop: 'endTime',
+            label: '计划完成时间',
+            align: 'center',
+            minWidth: 180
+          },
+          {
+            prop: 'produceRoutingName',
+            slot: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center',
+            minWidth: 120
+          },
+          {
+            prop: 'requiredFormingNum',
+            label: '要求生产数量',
+            align: 'center',
+            slot: 'requiredFormingNum',
+            width: 130
+          }
+
+          // {
+          //   columnKey: 'action',
+          //   label: '操作',
+          //   width: 90,
+          //   align: 'center',
+          //   fixed: 'right',
+          //   slot: 'action'
+          // }
+        ]
       };
     },
     computed: {},
     created() {
       this.requestDict('订单计划类型');
+      this.getAutoGenerateSubPlans('auto_split_produce_plan');
     },
     methods: {
       open() {
@@ -136,11 +280,62 @@
         if (this.type != 'edit') {
           this.getPlanCode();
         }
+
+        if (this.isAutoGenerateSubPlans) {
+          console.log(this.info, 'this.infothis.info');
+          this.getJHListData(this.info);
+        }
       },
       cancel() {
         this.visible = false;
       },
 
+      async getAutoGenerateSubPlans(code) {
+        await parameterGetByCode({ code }).then((res) => {
+          this.isAutoGenerateSubPlans = res.value == '0' ? false : true;
+        });
+      },
+
+      getJHListData(m) {
+        for (let i = 0; i < this.jhList.length; i++) {
+          let item = this.jhList[i];
+          if (item.id == m.id) {
+            return;
+          }
+        }
+        let row = {};
+        // if (
+        //   m.processRoute &&
+        //   m.processRoute.list &&
+        //   m.processRoute.list.length > 0
+        // ) {
+        //   row = m.processRoute.list[0];
+        // }
+        // let _num =
+        //   ((this.formData.requiredFormingNum || 0) / (this.baseCount || 0)) *
+        //   m.dosage;
+        // _num = _num.toFixed(3);
+        // _num = this.formattedNum(_num);
+        let data = {
+          id: m.id,
+          categoryId: m.categoryId,
+          productCode: m.productCode,
+          productName: m.productName,
+          brandNo: m.brandNo,
+          specification: m.specification,
+          model: m.model,
+          produceRoutingName: m.produceRoutingName || '',
+          productUnitWeight: m.productUnitWeight,
+          requiredFormingNum: m.requiredFormingNum,
+          measuringUnit: m.measuringUnit,
+          startTime: m.startTime || '',
+          endTime: m.endTime || '',
+          unit: this.unit,
+          resourceType: 0
+        };
+        this.jhList.push(data);
+      },
+
       async getPlanCode() {
         this.loading = true;
         try {

+ 13 - 3
src/views/saleOrder/salesToProductionNewTwo.vue

@@ -3,7 +3,11 @@
     <el-card shadow="never">
       <div class="body-title">
         <div class="title-left">{{
-          type == 'edit' ? '计划修改' : '销售订单转生产计划'
+          type == 'edit'
+            ? '计划修改'
+            : clientEnvironmentId == 9
+            ? '作业计划转生产计划'
+            : '销售订单转生产计划'
         }}</div>
         <div class="title-right">
           <el-button @click="cancel">取消</el-button>
@@ -132,7 +136,10 @@
             </el-form-item>
           </el-col>
 
-          <el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
+          <el-col
+            v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }"
+            v-if="clientEnvironmentId != 9"
+          >
             <el-form-item label="库存数量:" prop="stockCountBase">
               <el-input
                 v-model="form.stockCountBase"
@@ -144,7 +151,10 @@
           </el-col>
         </el-row>
         <el-row :gutter="24">
-          <el-col v-bind="styleResponsive ? { lg: 4, md: 8 } : { span: 4 }">
+          <el-col
+            v-bind="styleResponsive ? { lg: 4, md: 8 } : { span: 4 }"
+            v-if="clientEnvironmentId != 9"
+          >
             <el-form-item label="余量系数:" prop="marginCoefficient">
               <el-select
                 v-model="form.marginCoefficient"

+ 7 - 3
src/views/workOrder/index.vue

@@ -151,7 +151,10 @@
           <el-link
             v-if="
               dispatchPermission(row) &&
-              $hasPermission('aps:workorder:dispatch')
+              $hasPermission('aps:workorder:dispatch') &&
+              row.workCenterId &&
+              userWorkCenter &&
+              userWorkCenter.includes(row.workCenterId)
             "
             :underline="false"
             icon="el-icon-truck"
@@ -308,10 +311,11 @@
         dispatchVisible: false,
         selectionMap: {},
         detailsVisible: false,
-        tabMixinsInit:false,
+        tabMixinsInit: false,
         tabValue: '1',
         treeId: [],
-        tableHeight: 'calc(100vh - 345px)'
+        tableHeight: 'calc(100vh - 345px)',
+        userWorkCenter: this.$store.state.user.info.workCenterIds
       };
     },
     computed: {

+ 2 - 2
vue.config.js

@@ -35,14 +35,14 @@ module.exports = {
         // target: 'http://192.168.1.103:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.158:18086',
-        // target: 'http://192.168.1.251:18086',
+        target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.102:18086',
         // target: 'http://aiot.zoomwin.com.cn:51001/api',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
 
         // target: 'http://192.168.1.116:18086',