Browse Source

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-aps into dev

lishougeng 1 year ago
parent
commit
81e1d6c66e

+ 1 - 1
src/views/cuttingPlan/components/producePlan.vue

@@ -73,7 +73,7 @@
             @click="produceAdd"
             v-if="type != 'detail'"
           >
-            添加生产订单
+            添加生产计划
           </el-button>
         </template>
 

+ 348 - 368
src/views/materialPlan/components/produceOrder.vue

@@ -1,411 +1,391 @@
 <template>
-    <el-dialog
-      :title="title"
-      v-if="visible"
-      :visible.sync="visible"
-      :before-close="handleClose"
-      :close-on-click-modal="true"
-      :close-on-press-escape="false"
-      append-to-body
-      width="90%"
-    >
-      <el-card shadow="never">
-        <productionPlanSearch 
-        @search="reload"
-        ref="searchRef"
-        :statusOpt="statusOpt"
-        :planType="planType"
-        :activeName="activeName"
-        />
-  
-        <!-- 数据表格 -->
-        <ele-pro-table
-          ref="table"
-          :columns="columns"
-          :datasource="datasource"
-          :selection.sync="selection"
-          row-key="id"
-        >
-        </ele-pro-table>
-      </el-card>
-  
-      <div class="btns">
-        <el-button type="primary" size="small" @click="selected">选择</el-button>
-        <el-button size="small" @click="handleClose">关闭</el-button>
-      </div>
-    </el-dialog>
-  </template>
-  
-  <script>
-  import productionPlanSearch from '@/views/productionPlan/components/productionPlan-search.vue';
-    import { getList } from '@/api/productionPlan/index.js';
-    import dictMixins from '@/mixins/dictMixins';
-    export default {
-      components: { productionPlanSearch },
-      mixins: [dictMixins],
-      data() {
-        return {
-          visible: false,
-          title: '生产订单',
-
-          statusOpt: {
-          first: [
-            { label: '所有状态', value: '3,2' },
-            { label: '待发布', value: '2' },
-            { label: '发布失败', value: '3' },
-            { label: '已发布', value: '4' }
-          ],
-          second: [
-            { label: '所有状态', value: '7,4,5,6' },
-            { label: '待生产', value: '4' },
-            { label: '生产中', value: '5' },
-            { label: '已完成', value: '6' },
-            { label: '已延期', value: '7' }
-          ],
-          change: [{ label: '已变更', value: '9' }]
-        },
-        planType: [
-          { label: '所有计划类型', value: null },
-          { label: '内销计划', value: '1' },
-          { label: '外销计划', value: '2' },
-          { label: '预制计划', value: '3' }
+  <el-dialog :title="title" v-if="visible" :visible.sync="visible" :before-close="handleClose"
+    :close-on-click-modal="true" :close-on-press-escape="false" append-to-body width="90%">
+    <el-card shadow="never">
+      <productionPlanSearch @search="reload" ref="searchRef" :statusOpt="statusOpt" :planType="planType"
+        :activeName="activeName" />
+
+      <!-- 数据表格 -->
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id">
+      </ele-pro-table>
+    </el-card>
+
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import productionPlanSearch from '@/views/productionPlan/components/productionPlan-search.vue';
+import { getList } from '@/api/productionPlan/index.js';
+import dictMixins from '@/mixins/dictMixins';
+export default {
+  components: { productionPlanSearch },
+  mixins: [dictMixins],
+  data() {
+    return {
+      visible: false,
+      title: '生产计划',
+
+      statusOpt: {
+        first: [
+          { label: '所有状态', value: '3,2' },
+          { label: '待发布', value: '2' },
+          { label: '发布失败', value: '3' },
+          { label: '已发布', value: '4' }
         ],
+        second: [
+          { label: '所有状态', value: '7,4,5,6' },
+          { label: '待生产', value: '4' },
+          { label: '生产中', value: '5' },
+          { label: '已完成', value: '6' },
+          { label: '已延期', value: '7' }
+        ],
+        change: [{ label: '已变更', value: '9' }]
+      },
+      planType: [
+        { label: '所有计划类型', value: null },
+        { label: '内销计划', value: '1' },
+        { label: '外销计划', value: '2' },
+        { label: '预制计划', value: '3' }
+      ],
+
+      activeName: 'first',
+
+
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'selection',
+          type: 'selection',
+          width: 45,
+          align: 'center',
+          selectable: (row, index) => {
+            return !this.tableData.some(
+              (it) => it.id == row.id || it.salesOrderId == row.id
+            );
+          },
+          reserveSelection: true,
+          fixed: 'left'
+        },
 
-        activeName: 'first',
-
-  
-          // 表格列配置
-          columns: [
-            {
-              columnKey: 'selection',
-              type: 'selection',
-              width: 45,
-              align: 'center',
-              selectable: (row, index) => {
-                return !this.tableData.some(
-                  (it) => it.id == row.id || it.salesOrderId == row.id
-                );
-              },
-              reserveSelection: true,
-              fixed: 'left'
-            },
-           
-            
-          {
-            slot: 'batchNo',
-            prop: 'batchNo',
-            label: '批次号',
-            align: 'center',
-            minWidth: 140,
-            sortable: true
-          },
 
-          {
-            slot: 'code',
-            prop: 'code',
-            action: 'code',
-            label: '计划编号',
-            align: 'center',
+        {
+          slot: 'batchNo',
+          prop: 'batchNo',
+          label: '批次号',
+          align: 'center',
+          minWidth: 140,
+          sortable: true
+        },
 
-            minWidth: 160,
-            sortable: true
-          },
+        {
+          slot: 'code',
+          prop: 'code',
+          action: 'code',
+          label: '计划编号',
+          align: 'center',
 
-          {
-            prop: 'salesCode',
-            action: 'salesCode',
-            label: '销售订单号',
-            align: 'center',
-            minWidth: 160
-          },
+          minWidth: 160,
+          sortable: true
+        },
 
-          {
-            prop: 'productCode',
-            label: '编码',
-            align: 'center',
+        {
+          prop: 'salesCode',
+          action: 'salesCode',
+          label: '销售订单号',
+          align: 'center',
+          minWidth: 160
+        },
 
-            minWidth: 140
-          },
-          {
-            prop: 'productName',
-            label: '名称',
-            align: 'center',
+        {
+          prop: 'productCode',
+          label: '编码',
+          align: 'center',
 
-            minWidth: 140
-          },
+          minWidth: 140
+        },
+        {
+          prop: 'productName',
+          label: '名称',
+          align: 'center',
 
-          {
-            prop: 'brandNo',
-            label: '牌号',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+          minWidth: 140
+        },
 
-          {
-            prop: 'specification',
-            label: '规格',
-            align: 'center',
-            minWidth: 150,
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'model',
-            label: '型号',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          minWidth: 150,
 
-          {
-            prop: 'priority',
-            label: '优先级',
-            align: 'center',
-            minWidth: 120,
-            slot: 'priority',
-            sortable: 'custom'
-          },
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'model',
+          label: '型号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: 'produceRoutingName',
-            label: '工艺路线',
-            align: 'center',
-            width: 140,
-            showOverflowTooltip: true
-          },
+        {
+          prop: 'priority',
+          label: '优先级',
+          align: 'center',
+          minWidth: 120,
+          slot: 'priority',
+          sortable: 'custom'
+        },
 
-          {
-            prop: 'productNum',
-            label: '计划数量',
-            align: 'center',
+        {
+          prop: 'produceRoutingName',
+          label: '工艺路线',
+          align: 'center',
+          width: 140,
+          showOverflowTooltip: true
+        },
 
-            slot: 'productNum'
-          },
-          {
-            prop: 'productWeight',
-            label: '计划重量',
-            align: 'center',
+        {
+          prop: 'productNum',
+          label: '计划数量',
+          align: 'center',
 
-            slot: 'productWeight'
-          },
-          {
-            prop: 'requiredFormingNum',
-            label: '要求生产数量',
-            align: 'center',
+          slot: 'productNum'
+        },
+        {
+          prop: 'productWeight',
+          label: '计划重量',
+          align: 'center',
 
-            slot: 'requiredFormingNum'
-          },
+          slot: 'productWeight'
+        },
+        {
+          prop: 'requiredFormingNum',
+          label: '要求生产数量',
+          align: 'center',
 
-          {
-            prop: 'newSumOrderWeight',
-            label: '要求生产重量',
-            align: 'center',
+          slot: 'requiredFormingNum'
+        },
 
-            slot: 'newSumOrderWeight'
-          },
+        {
+          prop: 'newSumOrderWeight',
+          label: '要求生产重量',
+          align: 'center',
 
-          {
-            prop: 'scheduleStatusName',
-            label: '进度状态',
-            align: 'center',
-            minWidth: 100
-          },
+          slot: 'newSumOrderWeight'
+        },
 
-          {
-            prop: '',
-            label: '已排产数量',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+        {
+          prop: 'scheduleStatusName',
+          label: '进度状态',
+          align: 'center',
+          minWidth: 100
+        },
 
-          {
-            prop: '',
-            label: '未排产数量',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+        {
+          prop: '',
+          label: '已排产数量',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: '',
-            label: '已生产数量',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+        {
+          prop: '',
+          label: '未排产数量',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: '',
-            label: '未生产数量',
-            align: 'center',
-            showOverflowTooltip: true
-          },
+        {
+          prop: '',
+          label: '已生产数量',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: 'factoryName',
-            label: '所属工厂',
-            align: 'center'
-          },
+        {
+          prop: '',
+          label: '未生产数量',
+          align: 'center',
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: '',
-            label: '合格品数',
-            align: 'center'
-          },
+        {
+          prop: 'factoryName',
+          label: '所属工厂',
+          align: 'center'
+        },
 
-          {
-            prop: '',
-            label: '合格品数',
-            align: 'center'
-          },
+        {
+          prop: '',
+          label: '合格品数',
+          align: 'center'
+        },
 
-          {
-            prop: '',
-            label: '合格率',
-            align: 'center'
-          },
+        {
+          prop: '',
+          label: '不合格品数',
+          align: 'center'
+        },
 
-          {
-            prop: 'moCount',
-            label: '模数',
-            align: 'center',
-            show: this.clientEnvironmentId == '4'
-          },
+        {
+          prop: '',
+          label: '合格率',
+          align: 'center'
+        },
 
-          {
-            prop: 'blockCount',
-            label: '块数',
-            align: 'center',
-            show: this.clientEnvironmentId == '4'
-          },
-          {
-            prop: 'noWordCount',
-            label: '未排程块数',
-            align: 'center',
+        {
+          prop: 'moCount',
+          label: '模数',
+          align: 'center',
+          show: this.clientEnvironmentId == '4'
+        },
 
-            show: this.clientEnvironmentId == '4',
-            minWidth: 110
-          },
-          {
-            prop: 'reqMoldTime',
-            label: '计划完成日期',
-            align: 'center',
-            width: 110,
-            showOverflowTooltip: true
-          },
+        {
+          prop: 'blockCount',
+          label: '块数',
+          align: 'center',
+          show: this.clientEnvironmentId == '4'
+        },
+        {
+          prop: 'noWordCount',
+          label: '未排程块数',
+          align: 'center',
 
-          {
-            prop: 'startTime',
-            label: '计划开始日期',
-            align: 'center',
-            width: 110,
-            showOverflowTooltip: true
-          },
+          show: this.clientEnvironmentId == '4',
+          minWidth: 110
+        },
+        {
+          prop: 'reqMoldTime',
+          label: '计划完成日期',
+          align: 'center',
+          width: 110,
+          showOverflowTooltip: true
+        },
 
-          {
-            prop: 'endTime',
-            label: '计划结束日期',
-            align: 'center',
-            width: 110,
-            showOverflowTooltip: true
-          },
+        {
+          prop: 'startTime',
+          label: '计划开始日期',
+          align: 'center',
+          width: 110,
+          showOverflowTooltip: true
+        },
 
+        {
+          prop: 'endTime',
+          label: '计划结束日期',
+          align: 'center',
+          width: 110,
+          showOverflowTooltip: true
+        },
 
 
-          {
-            prop: 'orderType',
-            label: '计划类型',
-            align: 'center',
 
-            formatter: (row) => {
-              const obj = this.planType.find((i) => i.value == row.planType);
-              return obj && obj.label;
-            }
-          },
-          {
-            prop: 'version',
-            label: '版本',
-            align: 'center',
+        {
+          prop: 'orderType',
+          label: '计划类型',
+          align: 'center',
 
-            minWidth: 80
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-            align: 'center',
-            width: 110,
-            showOverflowTooltip: true
-          },
+          formatter: (row) => {
+            const obj = this.planType.find((i) => i.value == row.planType);
+            return obj && obj.label;
+          }
+        },
+        {
+          prop: 'version',
+          label: '版本',
+          align: 'center',
 
-          ],
-  
-          // 表格选中数据
-          selection: [],
-  
-          tableData: [],
-          current: null,
-          planType: [
-          { label: '所有计划类型', value: null },
-          { label: '内销计划', value: '1' },
-          { label: '外销计划', value: '2' },
-          { label: '预制计划', value: '3' }
-        ],
-          
-        };
-      },
-  
-      computed: {
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      },
+          minWidth: 80
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          width: 110,
+          showOverflowTooltip: true
+        },
+
+      ],
+
+      // 表格选中数据
+      selection: [],
+
+      tableData: [],
+      current: null,
+      planType: [
+        { label: '所有计划类型', value: null },
+        { label: '内销计划', value: '1' },
+        { label: '外销计划', value: '2' },
+        { label: '预制计划', value: '3' }
+      ],
+
+    };
+  },
+
+  computed: {
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
     },
-      created() {
-   
-      },
-      methods: {
-        open(item) {
-          if (item) {
-            this.tableData = item;
-          }
-  
-          this.visible = true;
-        },
-  
-        /* 表格数据源 */
-        async datasource({ page, limit, where }) {
-
-          const data = await getList({
-            ...where,
-            pageNum: page,
-            size: limit
-          });
-  
-          return data;
-        },
-  
-        /* 刷新表格 */
-        reload(where) {
-          this.$refs.table.reload({ page: 1, where: where });
-        },
-  
-        handleClose() {
-          this.visible = false;
-          this.$refs.table.setSelectedRows([]);
-          this.selection = [];
-        },
-        selected() {
-          if (!this.selection.length) {
-            this.$message.error('请至少选择一条数据');
-            return;
-          }
-          this.$emit('chooseOrder', this.selection);
-          this.handleClose();
-        }
+  },
+  created() {
+
+  },
+  methods: {
+    open(item) {
+      if (item) {
+        this.tableData = item;
       }
-    };
-  </script>
-  
-  <style lang="scss" scoped>
-    .btns {
-      text-align: center;
-      padding: 10px 0;
+
+      this.visible = true;
+    },
+
+    /* 表格数据源 */
+    async datasource({ page, limit, where }) {
+
+      const data = await getList({
+        ...where,
+        pageNum: page,
+        size: limit
+      });
+
+      return data;
+    },
+
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where: where });
+    },
+
+    handleClose() {
+      this.visible = false;
+      this.$refs.table.setSelectedRows([]);
+      this.selection = [];
+    },
+    selected() {
+      if (!this.selection.length) {
+        this.$message.error('请至少选择一条数据');
+        return;
+      }
+      this.$emit('chooseOrder', this.selection);
+      this.handleClose();
     }
-  </style>
-  
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+</style>

+ 4 - 0
src/views/materialPlan/components/producePlan.vue

@@ -148,6 +148,8 @@
               </template>
 
               <template v-slot:demandQuantity="{ row }">
+                <div>
+                  <!-- 需求数量 -->
                 <el-input
                   v-model="row.demandQuantity"
                   placeholder="请输入"
@@ -160,6 +162,8 @@
                       ))
                   "
                 ></el-input>
+                </div>
+               
               </template>
               <!-- <template v-slot:purchasingCycle="{ row }">
                  <el-input

+ 2 - 0
src/views/materialPlan/index.vue

@@ -272,6 +272,8 @@
         });
       },
       handleEdit(type, row) {
+
+        console.log(row.orderType,'---------------');
         if (row.orderType == 1) {
           this.$refs.planEditDialogRef.open(type, row);
         } else if (row.orderType == 2) {

+ 8 - 8
src/views/productionPlan/components/productionPlan-search.vue

@@ -64,7 +64,7 @@
           </el-select>
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
+      <!-- <el-col v-bind="styleResponsive ? { lg: 3, md: 12 } : { span: 3 }">
         <el-form-item label="计划状态:" label-width="80px">
           <el-select
             size="mini"
@@ -80,7 +80,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      </el-col>
+      </el-col> -->
 <!--      <el-col-->
 <!--        v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"-->
 <!--        v-if="activeName == 'second'"-->
@@ -131,8 +131,8 @@
             >
               <el-option label="要求完成日期" value="reqMoldTime"></el-option>
               <el-option
-                label="预测生产日期"
-                value="planFormingTime"
+                label="计划交付日期"
+                value="planDeliveryTime"
               ></el-option>
               <!-- <el-option label="实际生产日期" value="formingTime"></el-option> -->
             </el-select>
@@ -272,7 +272,7 @@
                     />
                   </el-form-item>
                 </el-row>
-                <el-row v-if="activeName == 'second'">
+                <!-- <el-row v-if="activeName == 'second'">
                   <el-form-item label-width="150px">
                     <template slot="label">
                       <el-select
@@ -302,7 +302,7 @@
                     >
                     </el-date-picker>
                   </el-form-item>
-                </el-row>
+                </el-row> -->
                 <el-row v-if="activeName == 'second'">
                   <el-form-item label="工单发布时间:" label-width="150px">
                     <el-date-picker
@@ -345,7 +345,7 @@
         deliveryTime: [],
         formingTime: [],
         reqMoldTime: [],
-        planFormingTime: [],
+        // planFormingTime: [],
         executeUserName: '',
         searchInfo: '',
       };
@@ -356,7 +356,7 @@
         where: { ...defaultWhere },
         treeData: [],
         productTypeList: [
-          { code: 2, name: '加工(MBOM)' },
+          { code: 1, name: '加工(MBOM)' },
           { code: 3, name: '装配(ABOM)' },
         ],
       };

+ 8 - 1
src/views/productionPlan/index.vue

@@ -628,9 +628,16 @@
             show: this.clientEnvironmentId == '4',
             minWidth: 110
           },
+          {
+            prop: 'planDeliveryTime',
+            label: '计划交付日期',
+            align: 'center',
+            width: 110,
+            showOverflowTooltip: true
+          },
           {
             prop: 'reqMoldTime',
-            label: '计划完成日期',
+            label: '订单要求计划交付日期',
             align: 'center',
             width: 110,
             showOverflowTooltip: true

+ 5 - 0
src/views/saleOrder/index.vue

@@ -374,6 +374,9 @@
     },
     methods: {
       async check(){
+
+        console.log(111111333333);
+
         if(this.selection.length > 0){
           let codeList = [];
           this.selection.map(ele => {
@@ -523,6 +526,8 @@
       },
 
       onSortChange(e) {
+        console.log(111111111,e);
+
         let sort = {
           orderBy: e.order,
           sortName: e.prop

+ 46 - 0
src/views/saleOrder/salesToProduction.vue

@@ -462,6 +462,36 @@
             prop="deliveryTime"
             width="160"
           >
+          <template slot-scope="scope">
+              <el-form-item
+                label-width="0px"
+                :prop="'salesOrders.' + scope.$index + '.deliveryTime'"
+                :rules="{
+                  required: true,
+                  message: '请选择交付日期',
+                  trigger: 'blur'
+                }"
+                class="table-item"
+              >
+                <el-date-picker
+                  style="width: 100%"
+                  v-model="scope.row.deliveryTime"
+                  @change="changeDate(scope.row, scope.$index)"
+
+                  :pickerOptions="{
+                    disabledDate: (time) =>
+                      time.getTime() <
+                      new Date(new Date().setHours(0, 0, 0, 0)).getTime()
+
+                  }"
+                  type="date"
+                  placeholder="选择日期"
+                  value-format="yyyy-MM-dd"
+                >
+                </el-date-picker>
+
+              </el-form-item>
+            </template>
           </el-table-column>
           <el-table-column
             label="要求完成日期"
@@ -490,6 +520,7 @@
 
                   }"
                   type="date"
+                  disabled
                   placeholder="选择日期"
                   value-format="yyyy-MM-dd"
                 >
@@ -707,7 +738,22 @@ export default {
 
     }
   },
+
   methods: {
+
+    // 验证时间是否超期
+    changeDate(item,i){
+      console.log(this.isTimeAGreaterThanB(item.deliveryTime,item.reqMoldTime));
+      if(this.isTimeAGreaterThanB(item.deliveryTime,item.reqMoldTime)){
+        this.$message.error('交付时间大于了要求完成日期')
+      }
+
+    },
+    isTimeAGreaterThanB(timeA, timeB) {
+      return new Date(timeA) > new Date(timeB);
+    },
+
+
     async getFactoryList(){
       this.factoryList = await getFactoryList();
     },

+ 10 - 2
src/views/workOrder/index.vue

@@ -21,6 +21,9 @@
         autoAmendPage
         :parse-data="parseData"
       >
+
+
+
         <template v-slot:code="{ row }">
           {{ row.code }}
         </template>
@@ -272,6 +275,7 @@
         return [
           {
             columnKey: 'index',
+            slot: 'index',
             label: '序号',
             type: 'index',
             width: 55,
@@ -296,7 +300,7 @@
             prop: 'produceRoutingName',
             label: '工艺路线',
             align: 'center',
-            minWidth: 110
+            minWidth: 170
           },
           {
             prop: 'productCode',
@@ -590,4 +594,8 @@
   };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+::v-deep .el-table__row {
+  height: 51px !important;
+}
+</style>

+ 2 - 1
vue.config.js

@@ -35,7 +35,8 @@ module.exports = {
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.158:18086',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.251:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {