ysy 2 лет назад
Родитель
Сommit
52ef19eab1

+ 1 - 1
package.json

@@ -36,7 +36,7 @@
     "highlight.js": "9.18.5",
     "highlight.js": "9.18.5",
     "jsbarcode": "^3.11.5",
     "jsbarcode": "^3.11.5",
     "json-bigint": "^1.0.0",
     "json-bigint": "^1.0.0",
-    "mathjs": "11.11.0",
+    "mathjs": "^12.4.1",
     "nprogress": "^0.2.0",
     "nprogress": "^0.2.0",
     "tinymce": "^5.10.5",
     "tinymce": "^5.10.5",
     "vue": "^2.7.10",
     "vue": "^2.7.10",

+ 110 - 0
src/api/bpm/components/outsourcedWarehousing/index.js

@@ -0,0 +1,110 @@
+import request from '@/utils/request';
+
+/**
+ * 列表
+ */
+export async function getList (data) {
+  const res = await request.post('/aps/batchingplan/page', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 保存
+ */
+export async function save (data) {
+  const res = await request.post('/aps/batchingplan/save', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 修改
+ */
+export async function del (data) {
+  const res = await request.delete('/aps/batchingplan/delete', { data });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 发布信息返显
+ */
+export async function getById (id) {
+  const res = await request.get(`/aps/batchingplan/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 详情
+ */
+export async function getPlanInfoById (id) {
+  const res = await request.get(`/aps/batchingplan/getPlanInfoById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 发布信息返显
+ */
+export async function getReleaseInfoById (id) {
+  const res = await request.get(`/aps/batchingplan/getReleaseInfoById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+// 获取列表
+export async function getMaterialList(data) {
+  const res = await request.get(`/wms/outin/getRealTimeInventory`, {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+
+// 批量根据生产计划计算bom列表信息
+
+export async function listBomBySalesOrderIds(data) {
+  const res = await request.post(`/aps/batchingplandetail/listBomBySalesOrderIds`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+// 根据销售订单计算bom列表信息
+export async function listBomBySalesOrderId(data) {
+  const res = await request.post(`/aps/batchingplandetail/listBomBySalesOrderId`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 提交
+export async function submit(data) {
+  const res = await request.post(`/bpm/apspurchaseplan/submit`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 7 - 1
src/views/bpm/handleTask/components/materialPlan/detailDialog.vue

@@ -47,6 +47,12 @@
                 </el-link>
                 </el-link>
               </template>
               </template>
 
 
+              
+
+
+
+
+
 
 
               <template v-slot:imgUrl="{ row }">
               <template v-slot:imgUrl="{ row }">
                 <div v-if="row.imgUrl && row.imgUrl?.length">
                 <div v-if="row.imgUrl && row.imgUrl?.length">
@@ -132,7 +138,7 @@ export default {
           showOverflowTooltip: true
           showOverflowTooltip: true
         },
         },
         {
         {
-          prop: 'deliveryNum',
+          prop: 'serialNo',
           label: '客户代号',
           label: '客户代号',
           align: 'center',
           align: 'center',
           showOverflowTooltip: true
           showOverflowTooltip: true

+ 338 - 0
src/views/bpm/handleTask/components/outsourcedWarehousing/detailDialog.vue

@@ -0,0 +1,338 @@
+<template>
+  <div>
+
+    <headerTitle title="委外入库申请单"></headerTitle>
+    <el-form :model="formData" ref="formRef" label-width="120px" class="ele-body" :rules="rules">
+      <el-row :gutter="32">
+        <el-col :span="12">
+          <el-form-item label="配料计划名称" prop="name">
+            <el-input placeholder="请选择" v-model="formData.name"></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="备注" prop="remark">
+            <el-input placeholder="备注" v-model="formData.remark"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <el-form :model="formData" ref="tableForm">
+      <ele-pro-table ref="table" :needPage="false" :columns="columns" row-key="id">
+        <!-- 展开内容 -->
+        <template v-slot:expand="{ row }">
+          <div style="
+              width: calc(100% - 95px);
+              min-height: 60px;
+              margin-left: 95px;
+            " v-if="row.materialList.length > 0">
+            <ele-pro-table :toolbar="false" toolsTheme="none" ref="table2" :need-page="false"
+              :datasource="row.materialList" :columns="columns2" row-key="id">
+              <template v-slot:sort="{ $index }">
+                {{ $index }}
+              </template>
+
+              <template v-slot:deliveryMethod="{ row }">
+                {{ row.deliveryMethod == 1 ? '一次性到货' : '分批到货' }}
+              </template>
+
+              <template v-slot:requireDeliveryTime="{ row }">
+                <span v-if="row.deliveryMethod == 1">{{ row.requireDeliveryTime }}</span>
+
+
+                <el-link type="primary" :underline="false" v-if="row.deliveryMethod == 2"
+                  @click.native="handleMethod(row)">
+                  设置分批时间
+                </el-link>
+              </template>
+
+              
+
+
+
+
+
+
+              <template v-slot:imgUrl="{ row }">
+                <div v-if="row.imgUrl && row.imgUrl?.length">
+                  <el-link v-for="link in row.imgUrl" :key="link.id" type="primary" :underline="false"
+                    @click="downloadFile(link)">
+                    {{ link.name }}</el-link>
+                </div>
+              </template>
+
+              <template v-slot:files="{ row }">
+                <div v-if="row.files && row.files?.length">
+                  <el-link v-for="link in row.files" :key="link.id" type="primary" :underline="false"
+                    @click="downloadFile(link)">
+                    {{ link.name }}</el-link>
+                </div>
+              </template>
+
+
+
+
+
+
+            </ele-pro-table>
+          </div>
+        </template>
+      </ele-pro-table>
+    </el-form>
+
+    <timeDialog ref="timeDialogRef"></timeDialog>
+  </div>
+</template>
+  
+<script>
+import { getById } from '@/api/bpm/components/outsourcedWarehousing/index';
+import { getFile } from '@/api/system/file';
+import timeDialog from './timeDialog'
+
+export default {
+  components: {
+    timeDialog
+  },
+  props: {
+    businessId: {
+      default: ''
+    }
+  },
+  mixins: [],
+
+  data() {
+    return {
+      visible: false,
+      title: '采购配料计划',
+
+      // 表格列配置
+      columns: [
+        {
+          width: 45,
+          type: 'expand',
+          columnKey: 'materialList',
+          align: 'center',
+          slot: 'expand'
+        },
+
+        {
+          width: 50,
+          label: '序号',
+          type: 'index',
+          align: 'center',
+          slot: 'index'
+        },
+
+        {
+          prop: 'salesOrderCode',
+          label: '销售订单号',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 170
+        },
+        {
+          prop: 'customerName',
+          label: '客户名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'serialNo',
+          label: '客户代号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'productCode',
+          label: '产品编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+
+        {
+          prop: 'productName',
+          label: '产品名称',
+          align: 'center',
+          minWidth: 120
+        },
+
+        {
+          prop: 'model',
+          label: '型号',
+          align: 'center',
+          minWidth: 120
+        },
+
+        {
+          prop: 'brandNo',
+          label: '牌号',
+          align: 'center'
+        },
+
+        {
+          prop: 'deliveryTime',
+          label: '交付日期',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'contractNum',
+          label: '合同数量',
+          align: 'center'
+        },
+        {
+          prop: 'lackNum',
+          label: '欠交数量',
+          align: 'center'
+        },
+
+
+
+
+      ],
+
+      columns2: [
+        {
+          width: 50,
+          label: '序号',
+          prop: 'sort',
+          slot: 'sort',
+          align: 'center'
+        },
+
+        {
+          label: '物料名称',
+          prop: 'name',
+          align: 'center'
+        },
+
+        {
+          label: '物料编码',
+          prop: 'code',
+          align: 'center'
+        },
+        {
+          label: '牌号',
+          prop: 'brandNum',
+          align: 'center'
+        },
+        {
+          label: '型号',
+          prop: 'modelType',
+          align: 'center'
+        },
+
+        {
+          prop: 'inventoryQuantity',
+          label: '库存',
+          showOverflowTooltip: true,
+
+        },
+
+        {
+          prop: 'unit',
+          label: '计量单位',
+          showOverflowTooltip: true,
+          action: 'unit',
+        },
+
+        {
+          label: '需求数量',
+          prop: 'demandQuantity',
+          align: 'center',
+        },
+
+        {
+          label: '采购数量',
+          prop: 'purchaseQuantity',
+          align: 'center'
+        },
+
+        {
+          label: '到货方式',
+          slot: 'deliveryMethod',
+          action: 'deliveryMethod',
+          align: 'center'
+        },
+
+        {
+          label: '要求到货时间',
+          slot: 'requireDeliveryTime',
+          action: 'requireDeliveryTime',
+          align: 'center'
+        },
+
+
+
+        {
+          label: '图纸',
+          slot: 'imgUrl',
+          action: 'imgUrl',
+          align: 'center',
+        },
+
+
+        {
+          label: '附件',
+          slot: 'files',
+          action: ' files',
+          align: 'center',
+          minWidth: 140
+        },
+
+
+
+
+      ],
+
+      rules: {},
+
+      formData: {
+        name: '',
+        remark: '',
+        detailRemoveIds: [],
+        materialRemoveIds: []
+      }
+    };
+  },
+  created() {
+    this.getDetailData(this.businessId);
+  },
+  methods: {
+    downloadFile(file) {
+      getFile({ objectName: file.storePath }, file.name);
+    },
+    async getDetailData(id) {
+      this.loading = true;
+      const res = await getById(id);
+      this.loading = false;
+      if (res) {
+        this.$set(this.formData, 'name', res.name);
+        this.$set(this.formData, 'remark', res.remark);
+        this.formData['id'] = res.id;
+        this.$refs.table.setData([...res.salesOrderList]);
+        this.$nextTick(() => {
+          this.$refs.table.toggleRowExpansionAll()
+          this.$forceUpdate()
+        })
+      }
+    },
+
+    handleMethod(row) {
+      this.$refs.timeDialogRef.open(row)
+    },
+  }
+};
+</script>
+  
+<style lang="scss" scoped>
+:deep(.el-table__expanded-cell) {
+
+  padding-bottom: 30px !important;
+  border-bottom: 12px solid #CCFFCC !important;
+}
+</style>
+
+

+ 169 - 0
src/views/bpm/handleTask/components/outsourcedWarehousing/submit.vue

@@ -0,0 +1,169 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item label="采购员" prop="technicianId" style="margin-bottom: 20px" :rules="{
+        required: true,
+        message: '请选择',
+        trigger: 'change'
+      }">
+        <el-select v-model="form.technicianId" clearable style="width: 100%" :filterable="true">
+          <el-option v-for="item in userOptions" @click.native="form.userName = item.name" :key="item.id"
+            :label="item.name" :value="item.id" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="审批建议" prop="reason" style="margin-bottom: 20px" :rules="{
+        required: true,
+        message: '请选择',
+        trigger: 'change'
+      }">
+        <el-input type="textarea" v-model="form.reason" placeholder="请输入审批建议" />
+      </el-form-item>
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button icon="el-icon-edit-outline" type="success" size="mini" @click="handleAudit(1)">通过
+      </el-button>
+
+      <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(0)">驳回
+      </el-button>
+
+      <el-dropdown @command="(command) => handleCommand(command)" style="margin-left: 30px;">
+        <span class="el-dropdown-link">更多<i class="el-icon-arrow-down el-icon--right"></i></span>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="cancel">作废</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+
+
+    </div>
+
+  </el-col>
+</template>
+
+<script>
+
+import { apspurchaseplan, cancel } from '@/api/bpm/components/apsMeterialPlan';
+import { approveTaskWithVariables } from '@/api/bpm/task';
+import { listAllUserBind } from '@/api/system/organization';
+
+// 流程实例的详情页,可用于审批
+export default {
+  name: '',
+  components: {
+
+  },
+  props: {
+    businessId: {
+      default: ''
+    },
+    taskId: {
+      default: ''
+    },
+    id: {
+      default: ''
+    },
+
+    taskDefinitionKey: {
+      default: ''
+    }
+  },
+  data() {
+    return {
+      form: {
+        technicianId: '',
+        reason: ''
+      },
+      userOptions: []
+    };
+  },
+  created() {
+    this.userOptions = [];
+    listAllUserBind().then((data) => {
+      this.userOptions.push(...data);
+    });
+  },
+  methods: {
+
+
+    async handleAudit(status, type) {
+      //生产主管审批选择技术员
+
+      if (!this.form.technicianId && status == 1) {
+        this.$message.warning(`请选择采购员!`);
+        return;
+      }
+
+
+      this._approveTaskWithVariables(status);
+    },
+    async _approveTaskWithVariables(status) {
+
+
+      if (status == 1) {
+
+        apspurchaseplan({
+          businessId: this.businessId,
+          id: this.taskId,
+          userId: this.form.technicianId,
+          userName: this.form.userName,
+          reason: this.form.reason,
+          pass: true
+
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: ''
+            });
+          }
+        });
+      } else if (status == 0) {
+        approveTaskWithVariables({
+          id: this.taskId,
+          reason: this.form.reason,
+          pass: false
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: '驳回'
+            });
+          }
+        });
+      }
+
+    },
+
+    getTableValue() {
+      return new Promise((resolve, reject) => {
+        this.$emit('getTableValue', async (data) => {
+          resolve(await data);
+        });
+      });
+    },
+
+    //更多
+    handleCommand(command) {
+      if (command === 'cancel') {
+        this.$confirm("是否确认作废?", {
+          type: 'warning',
+          cancelButtonText: '取消',
+          confirmButtonText: '确定'
+        }).then(() => {
+          cancel({
+            id: this.taskId,
+            reason: this.form.reason,
+            businessId: this.businessId,
+          }).then(() => {
+            this.$emit('handleClose');
+          }).catch(() => {
+            this.$message.error("流程作废失败");
+          });
+        }).catch(() => {});
+      }
+    },
+
+  }
+};
+</script>
+
+<style lang="scss"></style>

+ 133 - 0
src/views/bpm/handleTask/components/outsourcedWarehousing/timeDialog.vue

@@ -0,0 +1,133 @@
+<template>
+    <el-dialog :title="title" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+        :close-on-press-escape="false" append-to-body width="35%">
+
+        <el-form :model="form" ref="tableForm" class="tableForm" :rules="tableFormRules">
+
+            <el-table ref="multipleTable" :data="form.timeList" tooltip-effect="dark" style="width: 100%" stripe
+                :header-cell-style="{ background: '#EEEEEE', border: 'none' }">
+
+
+
+                <el-table-column label="数量" prop="purchaseQuantity">
+                    <template slot-scope="{ row, $index }">
+                        <el-form-item :prop="'timeList.' + $index + '.purchaseQuantity'"
+                            >
+                            <el-input placeholder="请输入" disabled v-model="row.purchaseQuantity"></el-input>
+                        </el-form-item>
+
+                    </template>
+                </el-table-column>
+
+
+
+                <el-table-column label="到货时间">
+                    <template slot-scope="{ row, $index }">
+                        <el-form-item :prop="'timeList.' + $index + '.requireDeliveryTime'"
+                            :rules="tableFormRules.requireDeliveryTime">
+                            <el-date-picker disabled v-model="row.requireDeliveryTime"  value-format="timestamp"   placeholder="请选择日期">
+                            </el-date-picker>
+                        </el-form-item>
+                    </template></el-table-column>
+
+
+
+
+            </el-table>
+
+        </el-form>
+
+
+
+
+        <div class="btns">
+            <el-button size="small" @click="handleClose">取消</el-button>
+        </div>
+    </el-dialog>
+</template>
+  
+<script>
+
+
+
+
+export default {
+    components: {
+    },
+    data() {
+        return {
+            visible: false,
+            title: '设置分批时间',
+
+            current: null,
+            form: {
+                timeList: [
+                    {
+                        requireDeliveryTime: null,
+                        purchaseQuantity: null
+                    }
+                ]
+            },
+
+            tableFormRules: {
+                purchaseQuantity: {
+                    required: true,
+                    message: '请输入数量',
+                    trigger: 'blur'
+                },
+
+                requireDeliveryTime: {
+                    required: true,
+                    message: '请选择日期',
+                    trigger: 'change'
+                }
+            }
+
+
+        }
+    },
+
+    watch: {
+
+    },
+    methods: {
+
+
+
+        open(row) {
+
+            this.form.timeList = row.timeList
+            this.current = row;
+            this.visible = true
+
+        },
+
+
+
+
+
+
+
+        handleClose() {
+            this.visible = false
+            this.form.timeList = [{
+                requireDeliveryTime: null,
+                purchaseQuantity: null
+            }];
+        },
+
+    }
+}
+</script>
+  
+<style lang="scss" scoped>
+.btns {
+    margin-top: 20px;
+    text-align: center;
+}
+
+.el-form-item {
+    margin-bottom: 20px !important;
+}
+</style>
+