Z 2 лет назад
Родитель
Сommit
72972db819

+ 70 - 0
src/api/bpm/components/purchasingManage/outSourceSend.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request';
+import { download } from '@/utils/file';
+/**
+ * 获取信息列表分页
+ */
+export async function getPurchaseOutSourceSendPageAPI(params) {
+  const res = await request.get(`/eom/purchaseoutsourcesend/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情
+ */
+export async function getPurchaseOutSourceSendDetailAPI(id) {
+  const res = await request.get(`/eom/purchaseoutsourcesend/getById/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新信息
+ */
+export async function updatePurchaseOutSourceSendAPI(data) {
+  const res = await request.put(`/eom/purchaseoutsourcesend/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 新增信息
+ */
+export async function savePurchaseOutSourceSendAPI(data) {
+  const res = await request.post(`/eom/purchaseoutsourcesend/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ */
+export async function deletePurchaseOutSourceSendAPI(data) {
+  const res = await request.delete('/eom/purchaseoutsourcesend/delete', { 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/purchaseOutsourceSendApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 1 - 1
src/views/bpm/handleTask/components/contractBook/addDialog.vue

@@ -118,7 +118,7 @@
             </el-date-picker>
           </el-form-item>
           <el-form-item
-            :label="结算方式"
+            label="结算方式"
             prop="settlementMode"
             style="margin-bottom: 22px"
           >

+ 38 - 0
src/views/bpm/handleTask/components/contractBook/detailDialog.vue

@@ -18,6 +18,38 @@
           >
             {{ form.contractName }}
           </el-form-item>
+          <el-form-item
+            label="核价单:"
+            prop="sourceName"
+            style="margin-bottom: 22px"
+            v-if="form.sourceType == 2"
+          >
+            {{form.sourceName}}
+          </el-form-item>
+          <el-form-item
+            label="报价单:"
+            prop="sourceName"
+            style="margin-bottom: 22px"
+            v-if="form.sourceType == 1"
+          >
+            {{form.sourceName}}
+          </el-form-item>
+          <el-form-item
+            label="计划名称:"
+            prop="sourceName"
+            style="margin-bottom: 22px"
+            v-if="form.sourceType == 3"
+          >
+            {{form.sourceName}}
+          </el-form-item>
+          <el-form-item
+            label="商机名称:"
+            prop="sourceName"
+            style="margin-bottom: 22px"
+            v-if="form.sourceType == 4"
+          >
+            {{form.sourceName}}
+          </el-form-item>
           <el-form-item
             label="编码:"
             prop="contractNumber"
@@ -55,6 +87,12 @@
             >
               {{ form.settlementModeName }}
             </el-form-item>
+          <el-form-item
+            label="计价方式:"
+            prop="pricingWay"
+            style="margin-bottom: 22px">
+            {{form.pricingWay==1?'按数量计费':'按重量计费'}}
+          </el-form-item>
           <el-form-item prop="contractFile" label="合同附件:">
             <div v-if="form.contractFile && form.contractFile?.length">
               <el-link

+ 6 - 0
src/views/bpm/handleTask/components/purchaseOrder/detailDialog.vue

@@ -80,6 +80,12 @@
           >
             {{ form.requireUserName }}
           </el-form-item>
+          <el-form-item
+            label="计价方式:"
+            prop="pricingWay"
+            style="margin-bottom: 22px">
+            {{form.pricingWay==1?'按数量计费':'按重量计费'}}
+          </el-form-item>
           <el-form-item
             label="优惠总金额:"
             prop="payAmount"

+ 449 - 0
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/addOrEditDialog.vue

@@ -0,0 +1,449 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="addOrEditDialogFlag"
+    :title="title"
+    :close-on-click-modal="false"
+    width="80%"
+    @close="cancel"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <headerTitle title="发货信息"></headerTitle>
+
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item
+            label="选择订单"
+            prop="orderNo"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.orderNo"
+              @click.native="handleOrderBtn"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="外协单位"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            <el-input v-model="form.supplierName" disabled></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item
+            label="需求来源"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            <el-input v-model="form.sourceTypeName" disabled></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="外协单位联系人"
+            prop="linkName"
+            style="margin-bottom: 22px"
+          >
+            <el-input clearable v-model="form.linkName" placeholder="请输入"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item
+            label="计价方式"
+            style="margin-bottom: 22px">
+            <el-select v-model="form.pricingWay" disabled style="width: 100%">
+              <el-option label="按数量计费" :value="1"></el-option>
+              <el-option label="按重量计费" :value="2"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="外协单位电话"
+            prop="linkPhone"
+            style="margin-bottom: 22px"
+          >
+            <el-input clearable v-model="form.linkPhone" placeholder="请输入"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="车辆号" prop="carNo" style="margin-bottom: 22px">
+            <el-input clearable v-model="form.carNo" placeholder="请输入"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="送货单号"
+            prop="sendNoteNo"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.sendNoteNo"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item prop="sendFiles" label="附件">
+            <fileUpload
+              v-model="form.files"
+              module="main"
+              :showLib="false"
+              :limit="10"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+
+        </el-col>
+      </el-row>
+
+    </el-form>
+
+    <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
+    <inventoryTable
+      ref="inventoryTableref"
+      :orderId="form.orderId"
+    ></inventoryTable>
+
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="save('sub')">提交</el-button>
+
+      <el-button @click="cancel">返回</el-button>
+    </div>
+    <!--  采购订单  -->
+    <orderListDialog
+      :searchParams="orderSearchParams"
+      ref="orderListDialogRef"
+      @changeParent="changeOrder"
+    ></orderListDialog>
+  </ele-modal>
+</template>
+
+<script>
+
+import fileUpload from '@/components/upload/fileUpload';
+import dictMixins from '@/mixins/dictMixins';
+// import parentList from '@/views/saleManage/contact/components/parentList.vue';
+import {
+  savePurchaseOutSourceSendAPI,
+  updatePurchaseOutSourceSendAPI,
+  getPurchaseOutSourceSendDetailAPI,
+  submit
+} from '@/api/bpm/components/purchasingManage/outSourceSend';
+// import {getcontactlink} from '@/api/saleManage/businessFollow';
+import inventoryTable from './inventoryTable.vue';
+// import orderListDialog from '../../invoice/components/orderListDialog.vue';
+import {copyObj} from '@/utils/util';
+import {getpurchaseorderDetail} from "@/api/bpm/components/purchasingManage/purchaseOrder";
+
+export default {
+  props: {
+    addOrEditDialogFlag: Boolean
+  },
+  mixins: [dictMixins],
+  components: {
+    fileUpload,
+    inventoryTable,
+    orderListDialog,
+    parentList
+  },
+  data() {
+    return {
+      orderSearchParams: {
+        sourceType: '3,4',
+      },
+      detailData: {},
+      payWayOptions: [],
+      delDetailIds: [],
+      linkNameOptions: [],
+
+      title: '',
+      row: {},
+      form: {
+        id: '',
+        carNo: '',
+        files: [],
+        linkName: '',
+        linkPhone: '',
+        orderId: '',
+        orderNo: '',
+        pricingWay: '',
+        productList: [],
+        sendNoteNo: '',
+        sourceType: '',
+        sourceTypeName: '',
+        supplierId: '',
+        supplierName: '',
+
+      },
+      rules: {
+        partaName: [
+          {required: true, message: '请选择客户名称', trigger: 'change'}
+        ],
+        linkName: [
+          {required: true, message: '请输入', trigger: ['blur', 'change']}
+        ],
+        linkPhone: [
+          {required: true, message: '请输入', trigger: ['blur', 'change']}
+        ],
+        orderNo: [
+          {required: true, message: '请选择', trigger: 'change'}
+        ],
+        receiveAddress: [
+          {required: true, message: '请输入', trigger: 'change'}
+        ],
+      },
+
+      // 提交状态
+      loading: false,
+      // 是否是修改
+      isUpdate: false,
+      businessId: ''
+    };
+  },
+
+  methods: {
+    //打开新增编辑弹框
+    async open(type, row, orderId) {
+      this.title = type === 'add' ? '新增委外发货单' : '修改';
+      this.row = row;
+      if (orderId) {
+        await this.getPurchaseOrderDetail(orderId);
+      }
+      if (row && row?.id) {
+        await this.getSendSaleOrderDetail(row?.id);
+      }
+
+      this.isUpdate = type !== 'add';
+    },
+    //选择订单弹框
+    handleOrderBtn(e) {
+      if (e.target.nodeName == 'I') {
+        this.form = Object.assign({}, this.form, {
+          supplierId: '',
+          supplierName: '',
+          linkName: '',
+          linkPhone: '',
+          orderNo: '',
+          orderId: '',
+          sourceTypeName: '',
+          sourceType: '',
+          productList: [],
+          pricingWay: ''
+        });
+        this.$refs.inventoryTableref &&
+        this.$refs.inventoryTableref.putTableValue([]);
+        return
+      }
+      this.$refs.orderListDialogRef.open();
+    },
+    //选择订单回调
+    changeOrder(obj) {
+      this.getPurchaseOrderDetail(obj.id);
+    },
+    //获取订单详情
+    async getPurchaseOrderDetail(id) {
+      this.loading = true;
+      const data = await getpurchaseorderDetail(id);
+      this.loading = false;
+      if (data) {
+        this.$nextTick(() => {
+          let {
+            partbId,
+            partbName,
+            partbTel,
+            orderNo,
+            id,
+            partbLinkName,
+            productList,
+            sourceTypeName,
+            sourceType,
+            pricingWay
+          } = data;
+          if (productList && productList.length > 0) {
+            productList.forEach((v) => {
+              v.orderTotalCount = v.orderTotalCount || v.totalCount;
+            });
+          }
+          this.form = Object.assign({}, this.form, {
+            supplierId: partbId,
+            supplierName: partbName,
+            linkName: partbLinkName,
+            linkPhone: partbTel,
+            orderNo,
+            orderId: id,
+            sourceTypeName,
+            sourceType,
+            productList,
+            pricingWay
+          });
+          this.$refs.inventoryTableref &&
+          this.$refs.inventoryTableref.putTableValue(productList);
+        });
+      }
+    },
+
+    //发货单详情
+    async getSendSaleOrderDetail(id) {
+      this.businessId = id;
+
+      this.loading = true;
+      const data = await getPurchaseOutSourceSendDetailAPI(id);
+      this.loading = false;
+      if (data) {
+        this.$nextTick(() => {
+          this.form = data;
+          this.$refs.inventoryTableref &&
+          this.$refs.inventoryTableref.putTableValue(data.productList);
+        });
+      }
+    },
+
+    //更新联系人数据
+    async getLinkInfo(contactId) {
+      const data = await getcontactlink({contactId});
+      if (data && data?.length) {
+        this.linkNameOptions = data;
+      }
+    },
+    selectFocus() {
+      if (this.linkNameOptions.length === 0) {
+        return this.$message.error('请先选择名称');
+      }
+    },
+
+    handHead() {
+      let item = {
+        id: this.form.partbLinkId
+      };
+      this.$refs.headRef.open(item);
+    },
+
+
+    salesmanChange(val, info) {
+      this.otherForm.salesmanName = info.name;
+    },
+
+
+    getValidate() {
+      return Promise.all([
+        new Promise((resolve, reject) => {
+          this.$refs.form.validate((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        }),
+        new Promise((resolve, reject) => {
+          this.$refs.inventoryTableref.validateForm((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        })
+      ]);
+    },
+    async save(type) {
+      try {
+        await this.getValidate();
+        // 表单验证通过,执行保存操作
+        this.loading = true;
+        if (!this.isUpdate) {
+          delete this.form.id;
+        }
+        this.form.files = this.form.files || [];
+        // this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
+        let commitData = Object.assign({}, this.form, {
+          productList: this.$refs.inventoryTableref.getTableValue()
+        });
+
+        if (this.isUpdate) {
+          updatePurchaseOutSourceSendAPI(commitData)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success('修改成功');
+              if (type === 'sub') {
+                this.sendSubmit(res);
+                return;
+              }
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
+            });
+        } else {
+          savePurchaseOutSourceSendAPI(commitData)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success('新增成功');
+              if (type === 'sub') {
+                this.sendSubmit(res);
+                return;
+              }
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
+            });
+        }
+      } catch (error) {
+        console.log(error);
+        // 表单验证未通过,不执行保存操作
+      }
+    },
+    sendSubmit(res) {
+      submit({
+        businessId: this.businessId || res
+        // productionSupervisorId
+      }).then((res) => {
+        this.cancel();
+        this.$emit('done');
+      });
+    },
+    cancel() {
+      this.$emit('update:addOrEditDialogFlag', false)
+    }
+  }
+};
+</script>
+<style scoped lang="scss">
+.TotalAmount {
+  font-size: 16px;
+  padding-right: 30px;
+}
+
+.headbox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 20px;
+  }
+}
+</style>

+ 366 - 0
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/detailDialog.vue

@@ -0,0 +1,366 @@
+<template>
+ <div>
+   <el-form ref="form" :model="form" label-width="130px">
+     <headerTitle title="发货信息"></headerTitle>
+     <el-row :gutter="20">
+       <el-col :span="12">
+         <el-form-item
+           label="选择订单:"
+           prop="orderNo"
+           style="margin-bottom: 22px"
+         >
+           {{ form.orderNo }}
+         </el-form-item>
+       </el-col>
+       <el-col :span="12">
+         <el-form-item
+           label="外协单位:"
+           prop="contactName"
+           style="margin-bottom: 22px"
+         >
+           {{ form.supplierName }}
+         </el-form-item>
+       </el-col>
+     </el-row>
+     <el-row :gutter="20">
+       <el-col :span="12">
+         <el-form-item
+           label="需求来源:"
+           prop="contactName"
+           style="margin-bottom: 22px"
+         >
+           {{ form.sourceTypeName }}
+         </el-form-item>
+       </el-col>
+       <el-col :span="12">
+         <el-form-item
+           label="外协单位联系人:"
+           prop="linkName"
+           style="margin-bottom: 22px"
+         >
+           {{ form.linkName }}
+         </el-form-item>
+       </el-col>
+     </el-row>
+     <el-row :gutter="20">
+       <el-col :span="12">
+         <el-form-item
+           label="计价方式:"
+           style="margin-bottom: 22px">
+           {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
+         </el-form-item>
+       </el-col>
+       <el-col :span="12">
+         <el-form-item
+           label="外协单位电话:"
+           prop="linkPhone"
+           style="margin-bottom: 22px"
+         >
+           {{ form.linkPhone }}
+         </el-form-item>
+       </el-col>
+     </el-row>
+     <el-row :gutter="20">
+       <el-col :span="12">
+         <el-form-item label="车辆号:" prop="carNo" style="margin-bottom: 22px">
+           {{ form.carNo }}
+         </el-form-item>
+       </el-col>
+       <el-col :span="12">
+         <el-form-item
+           label="送货单号:"
+           prop="sendNoteNo"
+           style="margin-bottom: 22px"
+         >
+           {{ form.sendNoteNo }}
+         </el-form-item>
+       </el-col>
+     </el-row>
+     <el-row :gutter="20">
+       <el-col :span="12">
+         <el-form-item prop="files" label="附件:">
+           <div v-if="form.files && form.files?.length">
+             <el-link
+               v-for="link in form.files"
+               :key="link.id"
+               type="primary"
+               :underline="false"
+               @click="downloadFile(link)">
+               {{ link.name }}
+             </el-link>
+           </div>
+         </el-form-item>
+       </el-col>
+       <el-col :span="12">
+
+       </el-col>
+     </el-row>
+   </el-form>
+   <headerTitle title="产品清单"></headerTitle>
+   <ele-pro-table
+     ref="table"
+     :needPage="false"
+     :columns="competAnalysisListcolumns"
+     :toolkit="[]"
+     :datasource="detailData.productList"
+     row-key="id"
+   >
+     <!-- <template v-slot:toolbar>
+       <div class="headbox">
+       <span class="amount">总计:{{detailData.totalAmount}}元</span>
+       <span class="amount">应付金额:{{detailData.payAmount}}元</span>
+     </div>
+     </template> -->
+     <template v-slot:technicalDrawings="{ row }">
+       <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+         <el-link
+           v-for="link in row.technicalDrawings"
+           :key="link.id"
+           type="primary"
+           :underline="false"
+           @click="downloadFile(link)"
+         >
+           {{ link.name }}
+         </el-link
+         >
+       </div>
+     </template>
+   </ele-pro-table>
+ </div>
+</template>
+
+<script>
+import {getFile} from '@/api/system/file';
+import {
+  getPurchaseOutSourceSendDetailAPI,
+} from '@/api/bpm/components/purchasingManage/outSourceSend';
+
+
+export default {
+  props: {
+    businessId: {
+      default: ''
+    }
+  },
+  data() {
+    return {
+      detailId: '',
+      form: {},
+      detailData: {},
+      competAnalysisListcolumns: [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          minWidth: 140,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName',
+          align: "center"
+        },
+        {
+          minWidth: 120,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode',
+          align: "center"
+        },
+        {
+          minWidth: 100,
+          prop: 'productCategoryName',
+          label: '类型',
+          slot: 'productCategoryName',
+          align: "center"
+        },
+        {
+          width: 160,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand',
+          align: "center"
+        },
+        {
+          width: 120,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType',
+          align: "center"
+        },
+        {
+          width: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification',
+          align: "center"
+        },
+        {
+          width: 200,
+          prop: 'customerMark',
+          label: '客户代号',
+          slot: 'customerMark',
+          align: "center"
+        },
+        {
+          width: 200,
+          prop: 'warehouseName',
+          label: '仓库名称',
+          slot: 'warehouseName',
+          align: "center"
+        },
+
+        {
+          width: 120,
+          prop: 'totalCount',
+          label: '发货数量',
+          slot: 'totalCount',
+          align: "center"
+        },
+        {
+          width: 120,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          slot: 'measuringUnit',
+          align: "center"
+        },
+        {
+          width: 160,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice',
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'discountSinglePrice',
+          label: '折让单价',
+          slot: 'discountSinglePrice',
+          align: "center"
+        },
+
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '合计',
+          slot: 'totalPrice',
+          formatter: (_row, _column, cellValue) => {
+            return _row.totalPrice + '元';
+          },
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'discountTotalPrice',
+          label: '折让合计',
+          slot: 'discountTotalPrice',
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'sendTotalWeight',
+          label: '发货总重',
+          slot: 'sendTotalWeight',
+          align: "center"
+        },
+        {
+          width: 120,
+          prop: 'deliveryDays',
+          label: '交期(天)',
+          slot: 'deliveryDays',
+          align: "center"
+        },
+        {
+          width: 200,
+          prop: 'guaranteePeriod',
+          label: '质保期',
+          slot: 'guaranteePeriod',
+          formatter: (_row, _column, cellValue) => {
+            return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
+          },
+          align: "center"
+        },
+        // {
+        //   width: 120,
+        //   prop: 'guaranteePeriodUnitCode',
+        //   label: '',
+        //   slot: 'guaranteePeriodUnitCode'
+        // },
+        {
+          width: 120,
+          prop: 'technicalAnswerName',
+          label: '技术答疑人',
+          slot: 'technicalAnswerName',
+          align: "center"
+        },
+        {
+          width: 220,
+          prop: 'technicalParams',
+          label: '技术参数',
+          slot: 'technicalParams',
+          align: "center"
+        },
+        {
+          width: 240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings',
+          formatter: (_row, _column, cellValue) => {
+            return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
+          },
+          align: "center"
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark',
+          align: "center"
+        }
+      ]
+    };
+  },
+  created() {
+    this.getDetailData(this.businessId);
+  },
+  methods: {
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
+    },
+    async getDetailData(id) {
+      this.loading = true;
+      const data = await getPurchaseOutSourceSendDetailAPI(id);
+      this.loading = false;
+      if (data) {
+        this.form = data;
+        this.detailData = data;
+      }
+    },
+    getTableValue(){
+      return Promise.resolve(this.form)
+    }
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.ele-dialog-form {
+  .el-form-item {
+    margin-bottom: 10px;
+  }
+}
+
+.headbox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 20px;
+  }
+}
+</style>

+ 703 - 0
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/inventoryTable.vue

@@ -0,0 +1,703 @@
+<template>
+  <el-form ref="form" :model="form" :rules="rules">
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :toolkit="[]"
+      :datasource="form.datasource"
+      cache-key="systemRoleTable17"
+      class="time-form"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <div class="headbox" v-if="!contractId&&isShowAdd">
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="handlAdd"
+          >
+            新增
+          </el-button>
+        </div>
+      </template>
+      <template v-slot:technicalDrawings="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.technicalDrawings'"
+        >
+          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
+            <el-link
+              v-for="link in row.technicalDrawings"
+              :key="link.id"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(link)"
+            >
+              {{ link.name }}
+            </el-link
+            >
+          </div>
+        </el-form-item>
+      </template>
+      <template v-slot:industryArtFiles="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.industryArtFiles'"
+        >
+          <div v-if="row.industryArtFiles && row.industryArtFiles?.length">
+            <el-link
+              v-for="link in row.industryArtFiles"
+              :key="link.id"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(link)"
+            >
+              {{ link.name }}
+            </el-link
+            >
+          </div>
+        </el-form-item>
+      </template>
+      <template v-slot:otherFiles="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.otherFiles'"
+        >
+          <div v-if="row.otherFiles && row.otherFiles?.length">
+            <el-link
+              v-for="link in row.otherFiles"
+              :key="link.id"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(link)"
+            >
+              {{ link.name }}
+            </el-link
+            >
+          </div>
+        </el-form-item>
+      </template>
+      <template v-slot:customerReqFiles="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.customerReqFiles'"
+        >
+          <div v-if="row.customerReqFiles && row.customerReqFiles?.length">
+            <el-link
+              v-for="link in row.customerReqFiles"
+              :key="link.id"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(link)"
+            >
+              {{ link.name }}
+            </el-link
+            >
+          </div>
+        </el-form-item>
+      </template>
+
+      <template v-slot:remark="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.remark'"
+        >
+          <el-input
+            clearable
+            v-model="row.remark"
+            type="textarea"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </template>
+      <template v-slot:totalCount="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.totalCount'"
+          :rules="[
+            { required: true, message: '请输入数字', trigger: 'blur' },
+
+          ]"
+        >
+          <!--           { validator: validateTotalCount(scope.row), trigger: 'blur' }-->
+          <el-input
+            v-model="scope.row.totalCount"
+            @input="(val) => changeNum(val, scope.$index)"
+          ></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:warehouseId="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.warehouseId'"
+          :rules="[{ required: true, message: '请选择仓库', trigger: 'blur' }]"
+        >
+          <el-select
+            v-model="scope.row.warehouseId"
+            placeholder="请选择"
+            @change="warehouseChange(scope.$index, scope.row)"
+          >
+            <el-option
+              v-for="item in warehouseList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </template>
+      <template v-slot:warehouseNum="scope">
+        <el-form-item style="margin-bottom: 20px">
+          {{ scope.row.warehouseNum }}
+        </el-form-item>
+      </template>
+      <template v-slot:headerTotalCount="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:headerWarehouseId="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="scope">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除吗?"
+          @confirm="remove(scope.$index)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+    <product-list
+      ref="productListRef"
+      :orderId="orderId"
+      @changeParent="changeParent"
+    ></product-list>
+  </el-form>
+</template>
+<script>
+import {emailReg, phoneReg, numberReg} from 'ele-admin';
+import dictMixins from '@/mixins/dictMixins';
+import productList from './product-list.vue';
+import {
+  getWarehouseList,
+  getWarehouseOutStock
+} from '@/api/bpm/components/saleManage/saleorder';
+
+import {copyObj} from '@/utils/util';
+import {getFile} from "@/api/system/file";
+
+export default {
+  mixins: [dictMixins],
+  props: {
+    orderId: String,
+    isShowAdd: {
+      type: Boolean,
+      default: true
+    }
+  },
+  components: {
+    productList
+  },
+  data() {
+    const defaultForm = {
+      key: null,
+      endTime: '',
+      isFirst: 0,
+      name: '',
+      startTime: '',
+      workHour: '',
+      technicalDrawings: []
+      // warehouseCode:"",
+      // warehouseId:'',
+      // warehouseName:'',
+    };
+    return {
+      discountTotalPrice: 0.0,
+      allPrice: 0.0,
+      numberReg,
+      defaultForm,
+      warehouseList: [],
+      form: {
+        datasource: []
+      },
+      rules: {},
+
+      columns: [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          minWidth: 200,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName',
+          align: "center"
+        },
+        {
+          minWidth: 120,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode',
+          align: "center"
+        },
+        {
+          minWidth: 150,
+          prop: 'productCategoryName',
+          label: '类型',
+          slot: 'productCategoryName',
+          align: "center"
+        },
+        {
+          minWidth: 100,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand',
+          align: "center"
+        },
+        {
+          minWidth: 120,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType',
+          align: "center"
+        },
+        {
+          minWidth: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification',
+          align: "center"
+        },
+        {
+          minWidth: 150,
+          prop: 'customerMark',
+          label: '客户代号',
+          slot: 'customerMark',
+          align: "center"
+        },
+        {
+          minWidth: 200,
+          prop: 'warehouseId',
+          label: '仓库名称',
+          slot: 'warehouseId',
+          headerSlot: 'headerWarehouseId',
+          align: "center"
+        },
+        {
+          minWidth: 80,
+          prop: 'warehouseNum',
+          label: '库存',
+          slot: 'warehouseNum',
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'totalCount',
+          label: '发货数量',
+          slot: 'totalCount',
+          headerSlot: 'headerTotalCount',
+          align: "center"
+        },
+        // {
+        //   width: 120,
+        //   prop: 'orderTotalCount',
+        //   label: '总数量',
+        //   slot: 'orderTotalCount'
+        // },
+        {
+          minWidth: 100,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          slot: 'measuringUnit',
+          align: "center"
+        },
+        {
+          width: 80,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice',
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'discountSinglePrice',
+          label: '折让单价',
+          slot: 'discountSinglePrice',
+          align: "center"
+        },
+        {
+          width: 80,
+          prop: 'totalPrice',
+          label: '合计',
+          slot: 'totalPrice',
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'discountTotalPrice',
+          label: '折让合计',
+          slot: 'discountTotalPrice',
+          align: "center"
+        },
+        // {
+        //   width: 120,
+        //   prop: 'singleWeight',
+        //   label: '单重',
+        //   slot: 'singleWeight'
+        // },
+        // {
+        //   width: 120,
+        //   prop: 'totalWeight',
+        //   label: '总重',
+        //   slot: 'totalWeight'
+        // },
+        {
+          width: 100,
+          prop: 'sendTotalWeight',
+          label: '发货总重',
+          slot: 'sendTotalWeight',
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'weightUnit',
+          label: '重量单位',
+          slot: 'weightUnit',
+          align: "center"
+        },
+        // {
+        //   width: 80,
+        //   prop: 'deliveryDays',
+        //   label: '交期(天)',
+        //   slot: 'deliveryDays'
+        // },
+        // {
+        //   width: 160,
+        //   prop: 'deliveryDeadline',
+        //   label: '交期截止日期',
+        //   slot: 'deliveryDeadline',
+        //   show: this.isDeliveryDeadline
+        // },
+        {
+          minWidth: 140,
+          prop: 'customerExpectDeliveryDeadline',
+          label: '客户期望交期',
+          slot: 'customerExpectDeliveryDeadline',
+          headerSlot: 'headerCustomerExpectDeliveryDeadline',
+          align: "center"
+        },
+        {
+          minWidth: 140,
+          prop: 'produceDeliveryDeadline',
+          label: '生产交付交期',
+          slot: 'produceDeliveryDeadline',
+          align: "center"
+        },
+        {
+          width: 100,
+          prop: 'guaranteePeriod',
+          label: '质保期',
+          slot: 'guaranteePeriod',
+          formatter: (_row, _column, cellValue) => {
+            return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
+          },
+          align: "center"
+        },
+        {
+          minWidth: 120,
+          prop: 'guaranteePeriodDeadline',
+          label: '质保截止日期',
+          align: "center"
+        },
+        {
+          minWidth: 200,
+          prop: 'customerReqFiles',
+          label: '客户需求',
+          slot: 'customerReqFiles',
+          align: "center"
+        },
+        {
+          width: 130,
+          prop: 'technicalAnswerName',
+          label: '技术答疑人',
+          slot: 'technicalAnswerName',
+          align: "center"
+        },
+        {
+          width: 220,
+          prop: 'technicalParams',
+          label: '技术参数',
+          slot: 'technicalParams',
+          align: "center"
+        },
+        {
+          width: 240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings',
+          align: "center"
+        },
+        {
+          width: 240,
+          prop: 'industryArtFiles',
+          label: '工艺附件',
+          slot: 'industryArtFiles',
+          align: "center"
+        },
+        {
+          width: 240,
+          prop: 'otherFiles',
+          label: '其他附件',
+          slot: 'otherFiles',
+          align: "center"
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark',
+          align: "center"
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          fixed: 'right',
+          showOverflowTooltip: true
+        }
+      ]
+    };
+  },
+  created() {
+    getWarehouseList().then((res) => {
+      this.warehouseList = res;
+    });
+  },
+  computed: {
+    canHandl() {
+      return this.form.datasource.length;
+    },
+    contractId() {
+      return this.$store.state.order.contractId;
+    }
+  },
+  methods: {
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
+    },
+    async warehouseChange(index, row) {
+      let warehouseIds =
+        this.form.datasource
+          .filter(
+            (item, i) => row.productCode == item.productCode && index != i
+          )
+          .map((item) => item.warehouseId) || [];
+      const data = this.warehouseList.find(
+        (item) => item.id == row.warehouseId
+      );
+      if (warehouseIds.length > 0 && warehouseIds.includes(row.warehouseId)) {
+        row.warehouseId = '';
+        return this.$message.error('同一个产品不能选择相同的仓库');
+      }
+
+      this.$set(this.form.datasource[index], 'warehouseName', data.name);
+      this.$set(this.form.datasource[index], 'warehouseCode', data.code);
+      const warehouseOutStock = await getWarehouseOutStock({
+        warehouseId: data.id,
+        code: row.productCode
+      });
+      this.$set(
+        this.form.datasource[index],
+        'warehouseNum',
+        warehouseOutStock
+      );
+    },
+
+    //修改数量更新合计
+    changeNum(val, index) {
+      this.$set(
+        this.form.datasource[index],
+        'totalPrice',
+        (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
+      );
+    },
+    //选择产品回调
+    changeParent(obj, idx) {
+      obj.orderTotalCount = obj.totalCount;
+      obj.id = '';
+      this.$set(
+        this.form.datasource,
+        this.form.datasource.length,
+        copyObj(obj)
+      );
+    },
+    validateTotalCount(row) {
+      return (rule, value, callback) => {
+        if (isNaN(value) || Number(value) <= 0) {
+          this.$message.error('请输入大于0的数');
+          callback(new Error('请输入大于0的数字'));
+        } else if (Number(value) > row.warehouseNum) {
+          // this.$message.error('输入的数字不能大于仓库物品数');
+          // callback(new Error('输入的数字不能大于仓库物品数'));
+          callback();
+        } else if (Number(value) > row.orderTotalCount) {
+          this.$message.error('输入的数字不能大于最大发货值');
+          callback(new Error('输入的数字不能大于最大发货值'));
+        } else {
+          callback();
+        }
+      };
+    },
+    // 返回列表数据
+    getTableValue() {
+      let comitDatasource = this.form.datasource;
+      if (comitDatasource.length === 0) return [];
+      comitDatasource.forEach(async (v) => {
+        v.totalCount = Number(v.totalCount);
+        v.technicalDrawings = Array.isArray(v.technicalDrawings)
+          ? v.technicalDrawings
+          : [];
+        v.customerReqFiles = Array.isArray(v.customerReqFiles)
+          ? v.customerReqFiles
+          : [];
+        v.industryArtFiles = v.industryArtFiles || [];
+        v.otherFiles = v.otherFiles || [];
+      });
+      return comitDatasource;
+    },
+    getPrice() {
+      return [this.allPrice];
+    },
+
+    //修改回显
+    putTableValue(data) {
+      if (data) {
+        this.form.datasource = data;
+        data.forEach(async (item, index) => {
+          if (item.warehouseId) {
+            this.$set(
+              this.form.datasource[index],
+              'warehouseNum',
+              await getWarehouseOutStock({
+                warehouseId: item.warehouseId,
+                code: item.productCode
+              })
+            );
+          }
+        });
+      }
+    },
+    //选择产品
+    handParent(row, index) {
+      let item = {
+        id: row.productCode
+      };
+      this.$refs.productListRef.open(item, index);
+    },
+    //选择技术人回调
+    changeAnswer(obj, idx) {
+      this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
+      this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
+    },
+    handHead(row, index) {
+      let item = {
+        id: row.technicalAnswerId
+      };
+      this.$refs.headRef.open(item, index);
+    },
+
+    remove(i) {
+      this.form.datasource.splice(i, 1);
+      this.setSort();
+    },
+    // 清空表格
+    restTable() {
+      this.form.datasource = [];
+    },
+    // 重新排序
+    setSort() {
+      this.form.datasource.forEach((n, index) => {
+        n.key = index + 1;
+      });
+    },
+    // 添加
+    handlAdd() {
+      if (!this.orderId) return this.$message.error('请先选择订单');
+      this.$refs.productListRef.open(this.form.datasource);
+    },
+
+    validateForm(callback) {
+      //开始表单校验
+      this.$refs.form.validate((valid) => {
+        callback(valid);
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    padding-right: 30px;
+  }
+}
+
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
+
+::v-deep .period {
+  display: flex;
+
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
+    }
+  }
+
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
+  }
+}
+
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
+
+.pricebox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-weight: bold;
+}
+</style>

+ 244 - 0
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/product-list.vue

@@ -0,0 +1,244 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    top="5vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <el-card shadow="never">
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        height="calc(100vh - 350px)"
+        class="dict-table"
+        @cell-click="cellClick"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:action="{ row }">
+          <el-radio class="radio" v-model="radio" :label="row.id"
+          ><i></i
+          ></el-radio>
+        </template>
+      </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 {getSaleOrderDetail} from '@/api/saleManage/saleorder';
+import {getpurchaseorderDetail} from '@/api/bpm/components/purchasingManage/purchaseOrder';
+// import {getReceiveSaleOrderrecordDetail} from '@/api/purchasingManage/purchaseorderreceive';
+// import {getSendSaleOrderrecordDetail} from '@/api/saleManage/saleordersendrecord';
+
+export default {
+  props: {
+    orderId: String,
+    type: String
+  },
+
+  data() {
+    return {
+      visible: false,
+      currentIndex: null,
+      currentData: [], //已经存在的产品
+      datasource: [],
+      columns: [
+        {
+          action: 'action',
+          slot: 'action',
+          align: 'center',
+          label: '选择',
+          width: 50,
+        },
+        {
+          columnKey: 'index',
+          type: 'index',
+          width: 50,
+          align: 'center',
+          showOverflowTooltip: true,
+          label: '序号'
+        },
+        {
+          width: 200,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName',
+          align: "center"
+        },
+        {
+          width: 200,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode',
+          align: "center"
+        },
+        {
+          width: 200,
+          prop: 'productCategoryName',
+          label: '类型',
+          slot: 'productCategoryName',
+          align: "center"
+        },
+        {
+          width: 150,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand',
+          align: "center"
+        },
+        {
+          minWidth: 120,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType',
+          align: "center"
+        },
+        {
+          minWidth: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification',
+          align: "center"
+        },
+
+        {
+          width: 80,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice',
+          align: "center"
+        },
+        {
+          width: 80,
+          prop: 'totalCount',
+          label: '数量',
+          slot: 'totalCount',
+          align: "center"
+        },
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '采购总金额',
+          slot: 'totalPrice',
+          formatter: (_row, _column, cellValue) => {
+            return _row.totalPrice + '元';
+          },
+          align: "center"
+        }
+      ],
+
+      radio: null
+    };
+  },
+
+  watch: {
+    orderId(id) {
+      if (id) {
+        this.getSaleOrderDetail(id);
+      }
+    }
+  },
+  methods: {
+    open(data) {
+      this.currentData = data || [];
+      this.visible = true;
+    },
+    //获取订单详情
+    async getSaleOrderDetail(id) {
+      this.loading = true;
+      const data = await getpurchaseorderDetail(id)
+      this.loading = false;
+      if (data) {
+        this.$nextTick(() => {
+          let {productList} = data;
+          this.datasource = productList;
+        });
+      }
+    },
+
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({pageNum: 1, where: where});
+    },
+
+    handleNodeClick(data, node) {
+      this.curNodeData = data;
+      this.reload({categoryLevelId: data.id});
+    },
+
+    // 单击获取id
+    cellClick(row) {
+      this.current = row;
+      this.radio = row.id;
+    },
+    handleClose() {
+      this.visible = false;
+      this.current = null;
+      this.radio = '';
+    },
+
+    selected() {
+      if (!this.current) {
+        return this.$message.warning('请至少选择一条数据');
+      }
+      let idKey =
+        this.type == 'receive' ? 'receiveProductId' : 'sendProductId';
+      console.log(this.current);
+      console.log(this.currentData);
+      // return;
+      let index = this.currentData.findIndex(
+        (r) => r[idKey] == this.current.id
+      );
+      if (index != -1 && ['receive', 'send'].includes(this.type)) {
+        return this.$message.error('选择的产品已经存在列表了');
+      }
+      this.$emit('changeParent', this.current, this.currentIndex);
+      this.handleClose();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.tree_col {
+  border: 1px solid #eee;
+  padding: 10px 0;
+  box-sizing: border-box;
+  height: 500px;
+  overflow: auto;
+}
+
+.table_col {
+  padding-left: 10px;
+
+  ::v-deep .el-table th.el-table__cell {
+    background: #f2f2f2;
+  }
+}
+
+.pagination {
+  text-align: right;
+  padding: 10px 0;
+}
+
+.btns {
+  text-align: center;
+  padding: 10px 0;
+}
+
+.topsearch {
+  margin-bottom: 15px;
+}
+</style>

+ 189 - 0
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/submit.vue

@@ -0,0 +1,189 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <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)"
+        v-if="!['starter'].includes(taskDefinitionKey)"
+      >驳回
+      </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>
+
+      <!-- <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleBackList"
+        >退回
+      </el-button> -->
+      <!-- <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleAudit(0)"
+        v-if="taskDefinitionKey != 'productionSupervisorApprove1'"
+        >不通过
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="primary"
+        size="mini"
+        v-if="taskDefinitionKey != 'productionSupervisorApprove1'"
+        @click="handleUpdateAssignee"
+        >转办
+      </el-button> -->
+    </div>
+  </el-col>
+</template>
+
+<script>
+import {cancel} from "@/api/bpm/components/financialManage/fee-manage/fee-application";
+import {approveTaskWithVariables} from '@/api/bpm/task';
+import {getWarehouseListByIds} from "@/api/bpm/components/saleManage/saleorder";
+
+// 流程实例的详情页,可用于审批
+export default {
+  name: '',
+  components: {
+    //   Parser
+  },
+  props: {
+    businessId: {
+      default: ''
+    },
+    taskId: {
+      default: ''
+    },
+    id: {
+      default: ''
+    },
+    taskDefinitionKey: {
+      default: ''
+    }
+  },
+  data() {
+    return {
+      form: {
+        reason: '',
+      },
+      tabOptions: [
+        {key: 'starter', permissionType: 'update', name: '发起人申请'},
+        {key: 'deptLeaderApprove', permissionType: 'view', name: '部门主管审批'},
+        {key: 'storeman', permissionType: 'view', name: '仓管出库'},
+      ],
+    };
+  },
+  created() {
+  },
+  methods: {
+    /** 处理转办审批人 */
+    handleUpdateAssignee() {
+      this.$emit('handleUpdateAssignee');
+    },
+    /** 退回 */
+    handleBackList() {
+      this.$emit('handleBackList');
+    },
+
+    async handleAudit(status) {
+      let storemanIds= ''
+      let permissionType = this.tabOptions.find(item => item.key == this.taskDefinitionKey)?.permissionType
+      if (permissionType === 'update') {
+        const id = await this.getTableValue();
+        if (typeof id !== 'string') return
+      }
+      if (this.taskDefinitionKey === 'deptLeaderApprove') {
+        let arr = await this.getTableValue();
+        console.log(arr);
+        let ids = arr.productList.map((item) => item.warehouseId);
+        let data = await getWarehouseListByIds(ids || []);
+        storemanIds = [...new Set(data.map(item => item.ownerId))].join(',')
+      }
+      await this._approveTaskWithVariables(status, storemanIds);
+    },
+    async _approveTaskWithVariables(status,storemanIds) {
+      let variables = {
+        pass: !!status,
+        storemanIds
+      };
+      approveTaskWithVariables({
+        id: this.taskId,
+        reason: this.form.reason,
+        variables
+      }).then((res) => {
+        if (res.data.code != '-1') {
+          this.$emit('handleAudit', {
+            status,
+            title: status === 0 ? '驳回' : ''
+          });
+        }
+      });
+    },
+
+    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>