quwangxin 2 лет назад
Родитель
Сommit
22c35afedc

+ 12 - 12
src/views/mes/workOrder/components/send-order.vue

@@ -194,7 +194,7 @@
       // 修改回显的数据
       id: String | Number
     },
-    data() {
+    data () {
       const defaultForm = {
         name: '',
         name1: '',
@@ -338,10 +338,10 @@
         delectId: 1
       };
     },
-    created() {},
+    created () {},
 
     methods: {
-      OneChange(val) {
+      OneChange (val) {
         if (val == 1) {
           this.form.name1 = '';
           this.form.name2 = '';
@@ -349,7 +349,7 @@
           this.form.name2 = '';
         }
       },
-      pushArr() {
+      pushArr () {
         this.form.dictStaticSubmitPOList.push({
           code: '',
           enable: 1,
@@ -361,10 +361,10 @@
         this.filterArr();
       },
       //
-      checkedValue(val) {
+      checkedValue (val) {
         console.log(val);
       },
-      removeArr(row) {
+      removeArr (row) {
         console.log(row);
         if (row.row.id) {
           this.form.dictStaticSubmitPOList.forEach((item) => {
@@ -391,9 +391,9 @@
         //   this.filterArr();
         // }
       },
-      handleSelectionChange() {},
+      handleSelectionChange () {},
       /* 保存编辑 */
-      save() {
+      save () {
         this.$refs.form.validate((valid) => {
           if (!valid) {
             return false;
@@ -429,17 +429,17 @@
             });
         });
       },
-      filterArr() {
+      filterArr () {
         this.tableData = this.form.dictStaticSubmitPOList.filter(
           (item) => item.deleted !== 1
         );
       },
       /* 更新visible */
-      updateVisible(value) {
+      updateVisible (value) {
         this.$emit('update:visible', value);
       },
 
-      getDetail() {
+      getDetail () {
         //   const res = await pageDictionaryData(this.id);
         //   this.form = res.data.dictInfoVO;
         //   this.form.dictStaticSubmitPOList = res.data.dictStaticVOList;
@@ -451,7 +451,7 @@
       }
     },
     watch: {
-      visible(visible) {
+      visible (visible) {
         if (visible) {
           if (this.id) {
             // this.$util.assignObject(this.form, this.data);

+ 213 - 0
src/views/produceOrder/components/order-dailog.vue

@@ -0,0 +1,213 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    title="添加工单-选择设备"
+    width="65vw"
+    append-to-body
+  >
+    <div class="search-box">
+      生产工单号:
+      <el-input placeholder="请输入" v-model="orderCode"></el-input>
+    </div>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      @done="handleDone"
+      row-key="id"
+      :needPage="false"
+      :initLoad="false"
+      :selection.sync="selectionList"
+      :datasource="datasource"
+      height="45vh"
+    >
+    </ele-pro-table>
+    <div class="footer" slot="footer">
+      <el-button @click="cancel">取消</el-button>
+      <el-button @click="confirm" type="primary">确定</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getPage } from '@/api/produceOrder/index.js';
+  export default {
+    data () {
+      return {
+        visible: false,
+        orderCode: '',
+        selectionList: [],
+        memoList: [],
+        callback: null
+      };
+    },
+    computed: {
+      columns () {
+        const list = [
+          {
+            type: 'selection',
+            width: 55,
+            align: 'center',
+            fixed: 'left',
+            reserveSelection: true
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            slot: 'code',
+            label: '生产工单号',
+            align: 'center'
+          },
+          {
+            prop: 'productionPlanCode',
+            label: '计划编号',
+            align: 'center'
+          },
+          {
+            prop: 'planType',
+            label: '计划类型',
+            align: 'center'
+          },
+          {
+            prop: 'produceVersionName',
+            label: '生产版本',
+            align: 'center'
+          },
+          {
+            prop: 'productCode',
+            label: '产品编号',
+            align: 'center'
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center'
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center'
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center'
+          },
+          {
+            prop: 'formingNum',
+            label: '要求成型数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'formingWeight',
+            label: '要求成型重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'formedNum',
+            label: '已成型数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'formedWeight',
+            label: '已成型重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'planStartTime',
+            label: '计划开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'startTime',
+            label: '实际开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 350,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+
+        return list;
+      }
+    },
+    methods: {
+      open (val, list = []) {
+        this.memoList = list;
+        this.visible = true;
+      },
+      handleDone ({ data }) {
+        if (this.memoList.length) {
+          this.$nextTick(() => {
+            this.memoList.length &&
+              this.$refs.table.setSelectedRowKeys(
+                this.memoList.map((i) => i.id)
+              );
+          });
+        }
+      },
+      /* 表格数据源 */
+      datasource ({ page, limit }) {
+        return getPage({
+          pageNum: page,
+          size: limit,
+          code: this.orderCode
+        });
+      },
+      confirm () {
+        if (!this.selectionList?.length)
+          return this.$message.error('请选择数据');
+        this.$emit('success', this.selectionList);
+
+        this.cancel();
+      },
+      cancel () {
+        this.$refs.table.clearSelection();
+        this.orderCode = '';
+        this.visible = false;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .search-box {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    margin-bottom: 20px;
+    .el-input {
+      width: 220px;
+      margin: 0 32px;
+    }
+  }
+</style>

+ 6 - 1
src/views/produceOrder/index.vue

@@ -24,7 +24,7 @@
       >
         <template v-slot:toolbar>
           <el-button type="primary">工单刷新</el-button>
-          <el-button type="success">领料</el-button>
+          <el-button type="success" @click="handlePicking">领料</el-button>
           <el-button type="success">批量完结</el-button>
           <el-button type="success" @click="handleCreate">创建工单</el-button>
           <el-button type="success">工单操作控制</el-button>
@@ -275,6 +275,11 @@
       }
     },
     methods: {
+      handlePicking () {
+        this.$router.push({
+          path: '/produceOrder/picking'
+        });
+      },
       statusFormatter (status) {
         const obj = this.statusOpt[this.activeName].find(
           (i) => i.value == status

+ 20 - 1
src/views/produceOrder/picking.vue

@@ -27,7 +27,7 @@
         cache-key="picking-table"
       >
         <template v-slot:toolbar>
-          <el-link type="primary">加入工单</el-link>
+          <el-link type="primary" @click="addOrder">加入工单</el-link>
         </template>
         <template v-slot:action="{ $index }">
           <el-link type="danger" @click="delOrder($index)">删除</el-link>
@@ -56,6 +56,8 @@
         </template>
       </ele-pro-table>
     </el-card>
+
+    <orderDailog ref="orderDailogRef" @success="orderSuccess" />
   </div>
 </template>
 
@@ -69,8 +71,10 @@
   import Warehousing from './components/report/Warehousing';
   import Sinter from './components/report/Sinter';
   import Furnace from './components/report/Furnace';
+  import orderDailog from './components/order-dailog';
   export default {
     components: {
+      orderDailog,
       Extrusion,
       Drying,
       Heating,
@@ -194,6 +198,21 @@
       }
     },
     methods: {
+      addOrder () {
+        this.$refs.orderDailogRef.open(this.orderList.slice(0));
+      },
+      orderSuccess (list) {
+        const obj = {};
+
+        this.orderList = [...this.orderList, ...list].reduce((next, pre) => {
+          if (!obj[pre.id]) {
+            next.push(pre);
+            obj[pre.id] = true;
+          }
+
+          return next;
+        }, []);
+      },
       delMaterial (index) {
         this.$confirm('是否删除', '提示')
           .then(() => {