Преглед на файлове

领用申请,下料申请1修改

zhangqing преди 1 година
родител
ревизия
c7ed31f371
променени са 4 файла, в които са добавени 367 реда и са изтрити 17 реда
  1. 10 0
      src/api/materialPlan/index.js
  2. 330 0
      src/views/cuttingPlan/index1.vue
  3. 4 4
      src/views/materialPlan/components/produce-edit-dialog.vue
  4. 23 13
      src/views/materialPlan/usePlan.vue

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

@@ -170,3 +170,13 @@ export async function dosingPage(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+// 领用页面提交
+export async function addUserPlan(data) {
+  const res = await request.post(`/aps/batchingplan/submitOutInStock`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 330 - 0
src/views/cuttingPlan/index1.vue

@@ -0,0 +1,330 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <cuttingPlanSearch @search="reload" :statusOpt="statusOpt" :activeName="activeName" ref="searchRef">
+      </cuttingPlanSearch>
+
+      <!-- 数据表格 -->
+      <ele-pro-table ref="table11" :initLoad="false" :columns="columns" :datasource="datasource"
+        cache-key="`materialPlanTable`" :pageSize="20" :pageSizes="[20, 30, 40, 50, 100]">
+        <template v-slot:toolbar>
+          <el-dropdown trigger="click" @command="handleClick">
+            <el-link type="primary" icon="el-icon-plus">创建计划</el-link>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="1">来源销售订单</el-dropdown-item>
+              <el-dropdown-item command="2">来源生产计划</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </template>
+        <template v-slot:name="{ row }">
+          <el-link type="primary" @click="handleEdit('detail', row)">{{
+            row.name
+          }}</el-link>
+        </template>
+        <template v-slot:code="{ row }">
+          <el-link type="primary" @click="handleEdit('detail', row)">{{
+            row.code
+          }}</el-link>
+        </template>
+        <template v-slot:status="{ row }">
+          <span :class="{ 'ele-text-danger': row.status == 3 }">
+            {{ statusFormatter(row.status) }}
+          </span>
+        </template>
+
+        <template v-slot:orderType="{ row }">
+          <span>
+            {{
+              row.orderType == 1
+                ? '销售订单'
+                : row.orderType == 2
+                  ? '生产计划'
+                  : ''
+            }}
+          </span>
+        </template>
+
+        <template v-slot:approvalStatus="{ row }">
+          <el-link type="primary" :underline="false" @click="handleDetails(row)">
+            {{ approvalStatusFormatter(row.approvalStatus) }}
+          </el-link>
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link type="primary" :underline="false" @click="add(row)"
+          v-if="row.status != 200 && row.status != 201">
+            提交
+          </el-link>
+          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="handleEdit('edit', row)"
+          v-if="row.status != 200 && row.status != 201">
+            修改
+          </el-link>
+          <el-link @click="handleDel(row)" type="danger" :underline="false" icon="el-icon-delete"
+          v-if="row.status != 200 && row.status != 201">
+            删除
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <detail ref="detailRef"></detail>
+
+    <planEditDialog ref="planEditDialogRef" @success="reload" />
+    <producePlan ref="produceRef" @success="reload"></producePlan>
+    <process-submit-dialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="reload"
+      :isNotNeedProcess="false"
+    ></process-submit-dialog>
+  </div>
+</template>
+
+<script>
+import cuttingPlanSearch from './components/cuttingPlan-search.vue';
+
+import planEditDialog from './components/plan-edit-dialog.vue';
+
+import producePlan from './components/producePlan.vue';
+
+import detail from '@/views/materialPlan/components/detail.vue';
+import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
+import { getList, del, submit } from '@/api/cuttingPlan/index.js';
+import { addUserPlan } from '@/api/materialPlan/index';
+
+
+export default {
+  components: {
+    cuttingPlanSearch,
+    processSubmitDialog,
+    detail,
+    planEditDialog,
+    producePlan
+  },
+
+  data() {
+    return {
+      activeName: 'first',
+
+      // 加载状态
+      loading: false,
+      processSubmitDialogFlag:false,
+      statusOpt: {
+        first: [
+          { label: '所有状态', value: null },
+          { label: '待排产', value: '1' },
+          { label: '待发布', value: '2' },
+          { label: '发布失败', value: '3' },
+          { label: '已完成', value: '6' },
+          { label: '已申请', value: '200' },
+          { label: '已入库', value: '201' },
+        ]
+      },
+
+      approvalStatusOpt: {
+        first: [
+          { label: '未提交', value: '0' },
+          { label: '审核中', value: '1' },
+          { label: '审核通过', value: '2' },
+          { label: '审核未通过', value: '3' }
+        ]
+      }
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      return [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          slot: 'demandType',
+          prop: 'demandType',
+          label: '需求类型',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return row.demandType == 1
+              ? '生产性物资采购'
+              : row.demandType == 6
+                ? '外协自供料采购'
+                : row.demandType == 7
+                  ? '外协客供料采购'
+                  : '';
+          },
+          width: 130,
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          slot: 'name',
+          prop: 'name',
+          label: '名称',
+          align: 'center',
+          width: 130,
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          slot: 'code',
+          prop: 'code',
+          label: '编号',
+          align: 'center',
+          width: 160,
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'planStr',
+          label: '生产计划编码',
+          align: 'center',
+          width: 160,
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'orderStr',
+          label: '销售订单号',
+          align: 'center',
+          width: 160,
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'serialNoStr',
+          label: '客户代号',
+          align: 'center',
+          width: 120,
+          showOverflowTooltip: true
+        },
+        {
+          columnKey: 'status',
+          label: '状态',
+          align: 'center',
+          slot: 'status',
+          action: 'status',
+          width: 120,
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'approvalStatus',
+          label: '审批状态',
+          align: 'center',
+          slot: 'approvalStatus',
+          action: 'approvalStatus',
+          width: 120,
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'orderType',
+          label: '来源类型',
+          align: 'center',
+          slot: 'orderType',
+          action: 'orderType',
+          width: 120,
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'createUserName',
+          label: '创建人',
+          align: 'center',
+          width: 120,
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          width: 120,
+          showOverflowTooltip: true
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 250,
+          align: 'center',
+          resizable: false,
+          fixed: 'right',
+          slot: 'action'
+        }
+      ];
+    }
+  },
+  methods: {
+    statusFormatter(status) {
+      const obj = this.statusOpt[this.activeName].find(
+        (i) => i.value == status
+      );
+
+      return obj && obj.label;
+    },
+
+    approvalStatusFormatter(status) {
+      const obj = this.approvalStatusOpt[this.activeName].find(
+        (i) => i.value == status
+      );
+
+      return obj && obj.label;
+    },
+    reload(where = {}) {
+      if (where.statusList) {
+        where.statusList = where.statusList.split(',');
+      }
+      this.$nextTick(() => {
+        this.$refs.table11.reload({ page: 1, where });
+      });
+    },
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      where.type = 1;
+      return getList({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+    handleClick(tab) {
+      if (tab == 1) {
+        this.$refs.planEditDialogRef.open('add');
+      } else if (tab == 2) {
+        this.$refs.produceRef.open('add');
+      }
+    },
+    handleDetails(row) {
+      if (row.status == 0) {
+        this.$message.info('未提交没有审核流程');
+      } else {
+        this.$refs.detailRef.open(row.processInstanceId);
+      }
+    },
+    handleEdit(type, row) {
+      if (row.orderType == 1) {
+        this.$refs.planEditDialogRef.open(type, row);
+      } else if (row.orderType == 2) {
+        this.$refs.produceRef.open(type, row);
+      }
+    },
+    handleDel({ id }) {
+      this.$confirm('确认删除当前数据!', '提示').then(async () => {
+        await del([id]);
+        this.$message.success('删除成功!');
+        this.reload();
+      });
+    },
+
+    //提交
+    add(e) {
+      addUserPlan({id:e.id}).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('提交成功!')
+        }
+      })
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 4 - 4
src/views/materialPlan/components/produce-edit-dialog.vue

@@ -47,8 +47,8 @@
 
 
 
-        <template v-slot:action="{ row, $index }">
-          <template>
+        <template v-slot:action="{ row, $index }" v-if="type != 'detail'">
+          <template >
             <el-link type="primary" :underline="false" @click="categorySelect(row)">
               添加物料
             </el-link>
@@ -116,7 +116,7 @@
                  
               </template>
 
-              <template v-slot:action="{ row }">
+              <template v-slot:action="{ row }" v-if="type != 'detail'">
                 <el-popconfirm class="ele-action" title="确定要删除当前物料吗?" @confirm="remove2(row)">
                   <template v-slot:reference>
                     <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -136,7 +136,7 @@
 
     </el-form>
 
-    <div slot="footer">
+    <div slot="footer" v-if="type != 'detail'">
       <el-button @click="cancel">取消</el-button>
       <el-button type="primary" @click="confirm">确定</el-button>
     </div>

+ 23 - 13
src/views/materialPlan/usePlan.vue

@@ -9,7 +9,7 @@
       <ele-pro-table ref="table" :initLoad="false" :columns="columns" :datasource="datasource"
         cache-key="pickPlanTable">
         <template v-slot:toolbar>
-          <el-button type="primary" @click="handleEdit('add')">创建计划</el-button>
+          <el-button type="primary" @click="handleEdit('add')">新增</el-button>
         </template>
 
         <template v-slot:status="{ row }">
@@ -17,18 +17,22 @@
             {{ statusFormatter(row.status) }}
           </span>
         </template>
-
+        <template v-slot:code="{ row }">
+          <el-link type="primary" @click="handleEdit('detail', row)">{{
+            row.code
+          }}</el-link>
+        </template>
 
 
         <!-- 操作列 -->
-        <template v-slot:action="{ row }">
-          <el-link type="primary" :underline="false" @click="handleEdit('edit', row)">
+        <template v-slot:action="{ row }" >
+          <el-link type="primary" :underline="false" @click="add(row)" v-if="row.status != 200 && row.status != 201">
             提交
           </el-link>
-          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="handleEdit('edit', row)">
+          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="handleEdit('edit', row)" v-if="row.status != 200 && row.status != 201">
             修改计划
           </el-link>
-          <el-link @click="handleDel(row)" type="danger" :underline="false" icon="el-icon-delete">
+          <el-link @click="handleDel(row)" type="danger" :underline="false" icon="el-icon-delete" v-if="row.status != 200 && row.status != 201">
             删除
           </el-link>
 
@@ -44,7 +48,7 @@
 import materialPlanSearch from './components/materialPlan-search.vue';
 
 import produceEditDialog from './components/produce-edit-dialog'
-import { getList, del, } from '@/api/materialPlan/index';
+import { getList, del, addUserPlan } from '@/api/materialPlan/index';
 export default {
   components: {
 
@@ -67,9 +71,11 @@ export default {
         second: [
           { label: '所有状态', value: null },
           { label: '待排产', value: '1' },
-          { label: '待发布', value: '2' },
+          { label: '待提交', value: '2' },
           { label: '发布失败', value: '3' },
           { label: '已完成', value: '6' },
+          { label: '已申请', value: '200' },
+          { label: '已入库', value: '201' },
         ]
       },
 
@@ -97,6 +103,7 @@ export default {
         },
         {
           prop: 'code',
+          slot: 'code',
           label: '计划编号',
           align: 'center',
           showOverflowTooltip: true
@@ -165,8 +172,6 @@ export default {
       });
     },
 
-
-
     handleTabChange() {
       this.$refs.searchRef.reset();
     },
@@ -181,9 +186,14 @@ export default {
       });
     },
 
-
-
-
+    //提交
+    add(e) {
+      addUserPlan({id:e.id}).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('提交成功!')
+        }
+      })
+    }
   }
 };
 </script>