Просмотр исходного кода

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt into dengfei

695593266@qq.com 6 месяцев назад
Родитель
Сommit
40e2bfb310
20 измененных файлов с 648 добавлено и 210 удалено
  1. 9 0
      src/api/tickets/index.js
  2. 1 0
      src/utils/dict/warehouse.js
  3. 5 2
      src/views/bpm/handleTask/components/financialManage/invoiceManage/components/detailDialog.vue
  4. 130 22
      src/views/bpm/handleTask/components/financialManage/invoiceManage/components/tableInfoNew.vue
  5. 1 0
      src/views/bpm/handleTask/components/financialManage/payableManage/components/detailDialog.vue
  6. 1 0
      src/views/bpm/handleTask/components/financialManage/receivableManage/components/detailDialog.vue
  7. 241 77
      src/views/bpm/handleTask/components/inspectionProjectRequest/detailDialog.vue
  8. 7 7
      src/views/bpm/handleTask/components/purchaseOrder/detailDialog.vue
  9. 42 2
      src/views/bpm/handleTask/components/requirementOrderPick/detailDialog.vue
  10. 75 10
      src/views/bpm/handleTask/components/requirementOrderPick/submit.vue
  11. 18 17
      src/views/bpm/handleTask/components/saleOrder/detailDialog.vue
  12. 51 41
      src/views/bpm/handleTask/components/saleOrder/entrustedReceive/boxTabPage.vue
  13. 18 24
      src/views/bpm/handleTask/components/saleOrder/entrustedReceive/detailDialog.vue
  14. 3 4
      src/views/bpm/handleTask/components/saleOrder/entrustedReceive/submit.vue
  15. 3 0
      src/views/bpm/handleTask/components/saleOrder/returnGoods/submit.vue
  16. 3 0
      src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/submit.vue
  17. 3 0
      src/views/bpm/handleTask/components/salesServiceManagement/recycle/submit.vue
  18. 3 0
      src/views/bpm/handleTask/components/salesServiceManagement/return/submit.vue
  19. 4 0
      src/views/bpm/outgoingManagement/outbound.vue
  20. 30 4
      src/views/bpm/tickets/patrolInspection/index.vue

+ 9 - 0
src/api/tickets/index.js

@@ -119,3 +119,12 @@ export async function acceptance(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+export async function startExecuting(params) {
+  const res = await request.post(`/eam/PdaWorkOrder/startExecuting`, params);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 1 - 0
src/utils/dict/warehouse.js

@@ -68,6 +68,7 @@ export const outputSceneState = [
   { code: 11, label: '自选领用出库' },
   { code: 12, label: '配料出库' },
   { code: 13, label: '质检出库' },
+  { code: 14, label: '物料需求清单出库' },
   { code: 99, label: '其他出库' }
 ];
 // 紧急状态

+ 5 - 2
src/views/bpm/handleTask/components/financialManage/invoiceManage/components/detailDialog.vue

@@ -332,7 +332,10 @@
             width: 150,
             prop: 'paymentRatio',
             label: '比例',
-            align: 'center'
+            align: 'center',
+            formatter: (row) => {
+              return row.paymentRatio ? row.paymentRatio + '%' : ''
+            }
           },
           {
             width: 170,
@@ -355,7 +358,7 @@
           {
             width: 160,
             prop: 'invoiceAmount',
-            label: '开票金额',
+            label: '本次开票金额',
             align: 'center',
             // slot: 'invoiceAmount',
             fixed: 'right'

+ 130 - 22
src/views/bpm/handleTask/components/financialManage/invoiceManage/components/tableInfoNew.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-tabs type="border-card">
+    <!-- <el-tabs type="border-card">
       <el-tab-pane :label="item.key" v-for="(item, idx) in tableForm.detailList" :key="idx">
         <el-form :ref="'form' + idx" :model="tableForm">
           <ele-pro-table
@@ -76,8 +76,80 @@
           </ele-pro-table>
         </el-form>
       </el-tab-pane>
-    </el-tabs>
-    
+    </el-tabs> -->
+    <el-form :ref="'form'" :model="tableForm">
+      <ele-pro-table
+        ref="table"
+        :needPage="false"
+        :columns="columns"
+        :datasource="tableForm.detailList"
+        row-key="id"
+        class="time-form"
+      >
+        <template v-slot:toolbar>
+          <span>本次开票合计:{{ totalAmountTotalPrice }}</span>
+        </template>
+        
+        <template v-slot:invoiceAmount="scope">
+        <el-form-item
+          style="width: 100%;"
+          :prop="'detailList.' + scope.$index + '.invoiceAmount'"
+          :rules="[
+            {
+              required: true,
+              message: '请输入开票金额',
+              trigger: 'blur'
+            },
+            {
+              validator: (rule, value, callback) => {
+                if (value === undefined || value === null || value === '') {
+                  callback('请输入开票金额');
+                } else if (parseFloat(value) < 0 || parseFloat(value) > scope.row.defaultAmountTotalPrice) {
+                  callback('开票金额不能小于0且小于等于本次开票合计');  
+                } else {
+                  callback();
+                }
+              },
+              trigger: 'blur'
+            }
+          ]"
+        > 
+          <span v-if="dialogType === 'view'"> {{ scope.row.invoiceAmount }}</span>
+          <el-input v-else v-model="scope.row.invoiceAmount" type="number" @input="(val) => invoiceAmountChange(val, scope.row, scope.$index)"></el-input>
+        </el-form-item>
+      </template>
+
+      <template v-slot:taxRate="scope">
+        <el-form-item
+          style="width: 100%;"
+          :prop="'detailList.' + scope.$index + '.taxRate'"
+          :rules="[
+            {
+              required: true,
+              message: '请输入税率',
+              trigger: 'blur'
+            },
+            {
+              validator: (rule, value, callback) => {
+                if (value === undefined || value === null || value === '') {
+                  callback('请输入税率');
+                } else if (parseFloat(value) < 0) {
+                  callback('税率不能小于0');
+                } else {
+                  callback();
+                }
+              },
+              trigger: 'blur'
+            }
+          ]"
+        > 
+          <span v-if="dialogType === 'view'"> {{ scope.row.taxRate }}</span>
+          <el-input v-else v-model="scope.row.taxRate" type="number" @input="getNotaxSinglePrice(scope.row, 0, scope.$index)" style="width: 80%;"></el-input>%
+        </el-form-item>
+      </template>
+
+      </ele-pro-table>
+    </el-form>
   </div>
 </template>
 <script>
@@ -192,8 +264,8 @@
           {
             minWidth: 150,
             prop: 'invoiceAmount',
-            label: '开票金额',
-            slot: 'invoiceAmount',
+            label: '本次开票金额',
+            // slot: 'invoiceAmount',
             align: 'center'
           },
           {
@@ -207,12 +279,12 @@
             prop: 'taxRate',
             label: '税率',
             align: 'center',
-            slot: 'taxRate',
-            // formatter: (_row, _column, cellValue) => {
-            //   return _row.taxRate
-            //     ? _row.taxRate+'%'
-            //     : '';
-            // },
+            // slot: 'taxRate',
+            formatter: (_row, _column, cellValue) => {
+              return _row.taxRate
+                ? _row.taxRate+'%'
+                : '';
+            },
           },
           {
             minWidth: 100,
@@ -338,15 +410,48 @@
   },
     methods: {
       convertToArrayFormat(data) {
-          return Object.keys(data.productMap).map(key => {
-            console.log('key', key);
-              const paymentItem = data.receiptPayments?.filter(item => item?.relatedOrderNo == key)|| [];
-              return {
-                  key: key,
-                  amountTotalPrice: paymentItem.length ? paymentItem.reduce((acc, cur) => acc + cur.invoiceAmount, 0) : 0,
-                  details: data.productMap[key] || []
-              };
+          const result = [];
+          Object.keys(data.productMap).forEach(key => {
+            console.log('key!!!', key);
+            const paymentItem = data.receiptPayments?.filter(item => item?.relatedOrderNo == key) || [];
+            console.log('paymentItem', paymentItem);
+            const amountTotalPrice = paymentItem.length ? paymentItem.reduce((acc, cur) => acc + cur.invoiceAmount, 0) : 0;
+            const defaultAmountTotalPrice = paymentItem.length ? paymentItem.reduce((acc, cur) => acc + cur.unInvoiceAmount, 0) : 0;
+            const details = data.productMap[key] || [];
+            
+            details.forEach(detail => {
+              result.push({
+                key: key,
+                amountTotalPrice: amountTotalPrice,
+                defaultAmountTotalPrice: defaultAmountTotalPrice,
+                ...detail,
+                invoiceAmount: '',
+              });
+            });
           });
+          
+          // Allocate defaultAmountTotalPrice to invoiceAmount for each key group
+          const uniqueKeys = [...new Set(result.map(item => item.key))];
+          uniqueKeys.forEach(key => {
+            const sameKeyItems = result.filter(item => item.key === key);
+            if (sameKeyItems.length > 0) {
+              const defaultAmountTotalPrice = parseFloat(sameKeyItems[0].defaultAmountTotalPrice) || 0;
+              let remainingTotal = defaultAmountTotalPrice;
+              
+              sameKeyItems.forEach(item => {
+                if (remainingTotal <= 0) {
+                  item.invoiceAmount = 0;
+                } else {
+                  const unInvoiceAmount = parseFloat(item.unInvoiceAmount) || 0;
+                  const allocateAmount = Math.min(remainingTotal, unInvoiceAmount);
+                  item.invoiceAmount = allocateAmount.toFixed(2);
+                  remainingTotal -= allocateAmount;
+                }
+              });
+            }
+          });
+          
+          return result;
       },
       // 校验发票金额
       invoiceAmountChange(val, item, idx, index) {
@@ -425,9 +530,12 @@
         this.setSelectData(row);
       },
       putValue(data) {
-        console.log('tableInfoNew putValue', data);
-        data.detailList = this.convertToArrayFormat(data);
-        this.tableForm = data;
+        let tempData = JSON.parse(JSON.stringify(data));
+        console.log('tableInfoNew putValue', tempData);
+        tempData.detailList = this.convertToArrayFormat(tempData);
+        console.log('data.detailList', data.detailList);
+        this.tableForm = tempData;
+        console.log('tableInfoNew putValue~~~', this.tableForm);
       },
       setValue(data) {
         data.detailList = this.convertToArrayFormat(data);

+ 1 - 0
src/views/bpm/handleTask/components/financialManage/payableManage/components/detailDialog.vue

@@ -212,6 +212,7 @@
         if (!val) return (this.form.accountingSubjectName = '');
         let data = this.$refs.treeSelect?.$refs?.tree?.getCurrentNode() || {};
         this.form.accountingSubjectName = data.name;
+        this.$refs.form.validateField('accountingSubjectId');
       },
       getTableValue() {
         return new Promise((resolve, reject) => {

+ 1 - 0
src/views/bpm/handleTask/components/financialManage/receivableManage/components/detailDialog.vue

@@ -222,6 +222,7 @@
         if (!val) return (this.form.accountingSubjectName = '');
         let data = this.$refs.treeSelect?.$refs?.tree?.getCurrentNode() || {};
         this.form.accountingSubjectName = data.name;
+        this.$refs.form.validateField('accountingSubjectId');
       },
       getTableValue() {
         return new Promise((resolve, reject) => {

+ 241 - 77
src/views/bpm/handleTask/components/inspectionProjectRequest/detailDialog.vue

@@ -1,6 +1,8 @@
 <template>
   <div>
-    <header-title title="质检项信息"></header-title>
+    <header-title
+      :title="form.recordingMethod == 1 ? '质检项信息' : '样品信息'"
+    ></header-title>
     <ele-pro-table
       :needPage="false"
       :columns="tableColumns"
@@ -9,16 +11,10 @@
       ref="table"
     ></ele-pro-table>
     <header-title title="派单信息"></header-title>
-    <el-form
-      ref="form"
-      :model="form"
-      :rules="rules"
-      class="el-form-box"
-      label-width="120px"
-    >
+    <el-form ref="form" :model="form" class="el-form-box" label-width="120px">
       <el-row>
         <el-col :span="8">
-          <el-form-item label="质检请托单号" prop="code">
+          <el-form-item label="质检请托单号" prop="code">
             <el-input
               v-model="form.code"
               placeholder=" "
@@ -81,83 +77,251 @@
     data() {
       return {
         form: {},
-        list: [],
-        tableColumns: [
-          {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            minWidth: 150,
-            prop: 'qualitySchemeTemplateCode',
-            align: 'center',
-            label: '质检方案编码',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 120,
-            prop: 'qualitySchemeTemplateName',
-            align: 'center',
-            label: '质检方案名称',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 100,
-            prop: 'categoryLevelClassName',
-            align: 'center',
-            label: '质检类型',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 130,
-            prop: 'inspectionCode',
-            align: 'center',
-            label: '质检项编码',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 120,
-            prop: 'inspectionName',
-            align: 'center',
-            label: '质检项名称',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 150,
-            prop: 'defaultValue',
-            align: 'center',
-            label: '工艺参数',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 150,
-            prop: 'status',
-            align: 'center',
-            formatter: (row) => {
-              return (
-                inspectionProjectStatus.find(
-                  (item) => item.value === row.status
-                )?.label || ''
-              );
-            },
-
-            label: '状态',
-            showOverflowTooltip: true
-          }
-        ]
+        list: []
       };
     },
+    computed: {
+      tableColumns() {
+        return this.form.recordingMethod == 1
+          ? [
+              {
+                width: 45,
+                type: 'index',
+                columnKey: 'index',
+                align: 'center',
+                fixed: 'left'
+              },
+
+              {
+                minWidth: 150,
+                prop: 'qualitySchemeTemplateCode',
+                align: 'center',
+                label: '质检方案编码',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 120,
+                prop: 'qualitySchemeTemplateName',
+                align: 'center',
+                label: '质检方案名称',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 100,
+                prop: 'categoryLevelClassName',
+                align: 'center',
+                label: '质检类型',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 130,
+                prop: 'inspectionCode',
+                align: 'center',
+                label: '质检项编码',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 120,
+                prop: 'inspectionName',
+                align: 'center',
+                label: '质检项名称',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 150,
+                prop: 'defaultValue',
+                align: 'center',
+                label: '工艺参数',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 150,
+                prop: 'status',
+                align: 'center',
+                formatter: (row) => {
+                  return (
+                    inspectionProjectStatus.find(
+                      (item) => item.value === row.status
+                    )?.label || ''
+                  );
+                },
+
+                label: '状态',
+                showOverflowTooltip: true
+              }
+            ]
+          : [
+              {
+                width: 45,
+                type: 'index',
+                columnKey: 'index',
+                align: 'center',
+                fixed: 'left'
+              },
 
+              {
+                label: '样品编码',
+                prop: 'sampleCode',
+                minWidth: '200',
+                align: 'center',
+                fixed: 'left'
+              },
+              {
+                label: '编码',
+                minWidth: '200',
+                prop: 'categoryCode',
+                align: 'center',
+                fixed: 'left'
+              },
+              {
+                label: '名称',
+                minWidth: '150',
+                prop: 'categoryName',
+                align: 'center'
+              },
+              {
+                label: '批次号',
+                minWidth: '150',
+                prop: 'batchNo',
+                align: 'center'
+              },
+              {
+                label: '发货条码',
+                minWidth: '150',
+                prop: 'barcodes',
+                align: 'center'
+              },
+              {
+                label: '包装编码',
+                minWidth: '150',
+                prop: 'packageNo',
+                align: 'center'
+              },
+              {
+                label: '包装数量',
+                minWidth: '150',
+                prop: 'packingQuantity',
+                align: 'center'
+              },
+              { label: '包装单位', prop: 'packingUnit', align: 'center' },
+              { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+              { label: '计量单位', prop: 'measureUnit', align: 'center' },
+              {
+                label: '供应商名称',
+                prop: 'supplierName',
+                align: 'center',
+                width: '120'
+              },
+              {
+                label: '供应商代号',
+                prop: 'supplierCode',
+                align: 'center',
+                width: '120'
+              },
+              {
+                label: '物料代号',
+                prop: 'materielDesignation',
+                align: 'center',
+                slot: 'materielDesignation',
+                width: '120'
+              },
+              {
+                label: '客户代号',
+                prop: 'clientCode',
+                align: 'center',
+                slot: 'clientCode',
+                width: '120'
+              },
+              {
+                label: '刻码',
+                prop: 'engrave',
+                align: 'center',
+                slot: 'engrave',
+                width: '120'
+              },
+              {
+                label: '机型',
+                prop: 'modelKey',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '颜色',
+                prop: 'colorKey',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '型号',
+                prop: 'modelType',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '规格',
+                prop: 'specification',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '电压等级',
+                prop: 'voltage',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '重量',
+                prop: 'weight',
+                align: 'center',
+                slot: 'weight',
+                width: '120'
+              },
+              {
+                label: '重量单位',
+                prop: 'weightUnit',
+                align: 'center',
+                width: 100
+              },
+              {
+                label: '仓库',
+                prop: 'warehouseName',
+                align: 'center',
+                width: 100
+              },
+              { label: '货区', prop: 'areaName', align: 'center' },
+              { label: '货架', prop: 'goodsShelfName', align: 'center' },
+              { label: '货位', prop: 'goodsAllocationName', align: 'center' },
+              { label: '生产日期', prop: 'productionDate', align: 'center' },
+              { label: '采购日期', prop: 'purchaseDate', align: 'center' },
+              {
+                minWidth: 150,
+                prop: 'status',
+                align: 'center',
+                formatter: (row) => {
+                  return (
+                    inspectionProjectStatus.find(
+                      (item) => item.value === row.status
+                    )?.label || ''
+                  );
+                },
+
+                label: '状态',
+                fixed: 'right',
+                showOverflowTooltip: true
+              }
+            ];
+      }
+    },
     created() {
       this.init();
     },
     methods: {
       async init() {
         this.form = await getById(this.businessId);
-        this.list = this.form.templateList;
+        this.list =
+          this.form.recordingMethod == 1
+            ? this.form.templateList
+            : this.form.sampleList;
       }
     }
   };

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

@@ -61,13 +61,13 @@
         </el-col>
 
         <el-col :span="8">
-          <el-form-item label="交易方式" prop="transactionMode">
+          <el-form-item label="交易方式" prop="transactionMode">
               {{ transactionMethodsOp.find(item => item.value == form.transactionMode)?.label }}
             </el-form-item>
         </el-col>
 
         <el-col :span="8">
-          <el-form-item label="收货模式" prop="deliveryMode">
+          <el-form-item label="收货模式" prop="deliveryMode">
               {{ shippingModePurchaseOp.find(item => item.value == form.deliveryMode)?.label }}
             </el-form-item>
         </el-col>
@@ -79,26 +79,26 @@
         </el-col>
 
         <el-col :span="8" v-if="form.settlementMode == 1">
-          <el-form-item label="结算日期范围" prop="settlementDate">
+          <el-form-item label="结算日期范围" prop="settlementDate">
               {{ form.settlementDate }}
             </el-form-item>
         </el-col>
 
         <el-col :span="8" v-if="form.settlementMode == 2">
-          <el-form-item label="结算月份范围" prop="settlementDate">
+          <el-form-item label="结算月份范围" prop="settlementDate">
               {{ form.settlementDate }}
             </el-form-item>
         </el-col>
 
         <el-col :span="8" v-if="form.settlementMode == 2">
-          <el-form-item label="收款日期" prop="receiptDate">
+          <el-form-item label="收款日期" prop="receiptDate">
               每月{{ form.receiptDate }}日
             </el-form-item>
         </el-col>
 
         <el-col :span="8">
           <el-form-item
-              label="期数"
+              label="期数"
               prop="issueNumber"
             >
               {{ form.issueNumber }}期
@@ -253,7 +253,7 @@
     </el-tabs>
 
     <headerTitle
-        title="款计划"
+        title="款计划"
         style="margin-top: 30px"
       ></headerTitle>
       <PaymentCollectionPlan

+ 42 - 2
src/views/bpm/handleTask/components/requirementOrderPick/detailDialog.vue

@@ -119,11 +119,22 @@
         <span v-else></span>
       </template>
     </ele-pro-table>
+
+    <add
+        ref="add"
+        v-if="taskDefinitionKey == 'apsStoreman'"
+        :form="outFormData || {}"
+        :sourceBizNo="outFormData.code || ''"
+        :bizType="14"
+        :detailList="outDetailList || []"
+        type="物料需求清单出库"
+      ></add>
   </div>
 </template>
 
 <script>
   import { pickingOrderInfo } from '@/api/bpm/components/requirementPick/index';
+  import add from '@/views/bpm/outgoingManagement/outbound.vue'
 
   const COMPONENT_ATTRIBUTE_MAP = {
     1: '自制件',
@@ -149,10 +160,16 @@
     props: {
       businessId: {
         default: ''
-      }
+      },
+      taskDefinitionKey: {
+        type: String,
+        default: ''
+      },
     },
     mixins: [],
-
+    components: {
+      add
+    },
     data() {
       return {
         title: 'mes领料单',
@@ -161,6 +178,7 @@
         produceTypeMap: PRODUCE_TYPE_MAP,
         tableHeight: 'calc(100vh - 595px)',
         formData: {},
+        outDetailList: [],
 
         // 表格列配置
         columns: [
@@ -297,6 +315,28 @@
       async getDetailData(id) {
         this.loading = true;
         this.formData = (await pickingOrderInfo(id)) || {};
+        this.outFormData = JSON.parse(JSON.stringify(this.formData));
+        this.outFormData.executorDeptId =  this.formData.executorGroupId;
+        this.outFormData.executorDeptName =  this.formData.executorDeptName;
+        this.outFormData.categoryLevelTopId =  this.formData.categoryLevelId;
+        this.outFormData.categoryLevelTopName =  this.formData.categoryLevelName;
+        this.outDetailList = this.formData?.detailList.map(item => {
+          return {
+            ...item,
+            demandQuantity: item.quantity,
+            batchNo: ''
+          }
+        }) || [];
+      },
+
+      async getTableValue() {
+        console.log(this.$refs['add']);
+        return {
+          form: this.form,
+          returnStorageData: this.$refs['add'].getReturnStorage
+            ? await this.$refs['add'].getReturnStorage()
+            : {}
+        };
       },
 
       fullscreenChange(fullscreen) {

+ 75 - 10
src/views/bpm/handleTask/components/requirementOrderPick/submit.vue

@@ -49,9 +49,20 @@
         size="mini"
         @click="handleAudit(1)"
         v-click-once
+        v-if="taskDefinitionKey != 'apsStoreman'"
         >通过
       </el-button>
 
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isLoading"
+        @click="handleAudit(1)"
+        v-if="taskDefinitionKey == 'apsStoreman'"
+        >申请出库
+      </el-button>
+
       <el-button
         icon="el-icon-circle-close"
         type="danger"
@@ -86,6 +97,7 @@
     cancelTask
   } from '@/api/bpm/task';
   import { listAllUserBind } from '@/api/system/organization';
+  import storageApi from '@/api/warehouseManagement';
 
   // 流程实例的详情页,可用于审批
   export default {
@@ -112,7 +124,8 @@
           // technicianId: '',
           reason: ''
         },
-        userOptions: []
+        userOptions: [],
+        isLoading: false
       };
     },
     created() {
@@ -122,16 +135,68 @@
       });
     },
     methods: {
-      async handleAudit(status, type) {
-        //生产主管审批选择技术员
+      async handleAudit(status) {
+        let data = await this.getTableValue();
+        let storageData = data.returnStorageData;
+        if (!!status) {
+          if (!storageData?.extInfo?.verifyDeptCode) {
+            this.$message.error('请选择部门');
+            return false;
+          }
+          if (!storageData?.fromUser) {
+            this.$message.error('请选择领料人');
+            return false;
+          }
+        }
+        if (!this.form.reason && !!status) {
+          this.$message.error('请输入审批意见');
+          return false;
+        }
+        if (this.taskDefinitionKey === 'apsStoreman' && !!status) {
+          // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
+          storageData.isSkip = 1;
+          console.log('storageData~~~', storageData);
+          try {
+            this.isLoading = true;
+            const res = await storageApi.outStorage(storageData);
+          
+            if (res.code == 0) {
+              let API = !!status ? approveTaskWithVariables : rejectTask;
+              API({
+                id: this.taskId,
+                reason: this.form.reason,
+                variables: {
+                  pass: !!status
+                }
+              }).then((res) => {
+                if (res.code != '-1') {
+                  this.$emit('handleAudit', {
+                    status: status,
+                    title: !status ? '驳回' : ''
+                  });
+                }
+                this.isLoading = false;
+              });
+            }
+          } catch (error) {
+            this.isLoading = false;
+            console.error('保存失败:', error);
+          }
+        } else {
+          // await this._approveTaskWithVariables(status, storemanIds);
+          await this._approveTaskWithVariables(status);
+        }
+      },
+      // async handleAudit(status, type) {
+      //   //生产主管审批选择技术员
 
-        // if (!this.form.technicianId && status == 1) {
-        //   this.$message.warning(`请选择采购员!`);
-        //   return;
-        // }
+      //   // if (!this.form.technicianId && status == 1) {
+      //   //   this.$message.warning(`请选择采购员!`);
+      //   //   return;
+      //   // }
 
-        this._approveTaskWithVariables(status);
-      },
+      //   this._approveTaskWithVariables(status);
+      // },
       rejectTask(status) {
         rejectTask({
           id: this.taskId,
@@ -156,7 +221,7 @@
             reason: this.form.reason,
             pass: true
           }).then((res) => {
-            if (res.data.code != '-1') {
+            if (res.data.code != '-1') { 
               this.$emit('handleAudit', {
                 status,
                 title: ''

+ 18 - 17
src/views/bpm/handleTask/components/saleOrder/detailDialog.vue

@@ -110,34 +110,34 @@
               {{ form.contractNumber }}
             </el-form-item>
             <el-form-item
-              label="总数"
+              label="总数"
               prop="totalPlanNum"
               v-if="form.needProduce == 4"
             >
               {{ form.totalPlanNum }}
               {{ form.planNumUnit }}
             </el-form-item>
-            <el-form-item label="交易方式" prop="transactionMode">
+            <el-form-item label="交易方式" prop="transactionMode">
               {{ transactionMethodsOp.find(item => item.value == form.transactionMode)?.label }}
             </el-form-item>
-            <el-form-item label="发货模式" prop="deliveryMode">
+            <el-form-item label="发货模式" prop="deliveryMode">
               {{ shippingModeOp.find(item => item.value == form.deliveryMode)?.label }}
             </el-form-item>
-            <el-form-item label="结算方式" prop="settlementMode">
+            <el-form-item label="结算方式" prop="settlementMode">
               {{ detailData.settlementModeName }}
             </el-form-item>
-            <el-form-item v-if="form.settlementMode == 1" label="结算日期范围" prop="settlementDate">
+            <el-form-item v-if="form.settlementMode == 1" label="结算日期范围" prop="settlementDate">
               {{ form.settlementDate }}
             </el-form-item>
 
-            <el-form-item v-if="form.settlementMode == 2" label="结算月份范围" prop="settlementDate">
+            <el-form-item v-if="form.settlementMode == 2" label="结算月份范围" prop="settlementDate">
               {{ form.settlementDate }}
             </el-form-item>
-            <el-form-item  v-if="form.settlementMode == 2" label="收款日期" prop="receiptDate">
+            <el-form-item  v-if="form.settlementMode == 2" label="收款日期" prop="receiptDate">
               每月{{ form.receiptDate }}日
             </el-form-item>
             <el-form-item
-              label="期数"
+              label="期数"
               prop="issueNumber"
             >
               {{ form.issueNumber }}期
@@ -248,15 +248,16 @@
         type="view"
       ></typeList>
 
-      <headerTitle
-        title="收款计划"
-        style="margin-top: 30px"
-      ></headerTitle>
-      <PaymentCollectionPlan
-        ref="paymentCollectionPlanRef"
-        menu="sale"
-        type="view"
-      ></PaymentCollectionPlan>
+      <div v-if="form.needProduce != 2 && form.needProduce != 4" style="margin-top: 30px">
+        <headerTitle
+          title="收款计划"
+        ></headerTitle>
+        <PaymentCollectionPlan
+          ref="paymentCollectionPlanRef"
+          menu="sale"
+          type="view"
+        ></PaymentCollectionPlan>
+      </div>
     </div>
     <div v-show="activeComp == '1'">
       <bomList :tableList="orderBomList2"></bomList>

+ 51 - 41
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/boxTabPage.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+    <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
       <el-tab-pane
         v-for="item in tabOption"
         :label="item.label"
@@ -16,7 +16,17 @@
         ref="componentRef"
         v-bind="activeNameProps"
       />
-    </keep-alive>
+    </keep-alive> -->
+    <div v-for="item in tabOption" :label="item.label" :name="item.name">
+      <component
+        v-if="form.id"
+        :is="item.name"
+        :key="item.name"
+        :ref="'componentRef' + item.name"
+        type="sourceBizNo"
+        v-bind="activeNameProps(item.name)"
+      />
+    </div>
   </div>
 </template>
 
@@ -65,37 +75,7 @@
         ]
       };
     },
-    computed: {
-      activeNameProps() {
-        switch (this.activeName) {
-          case 'tab1':
-            return {
-              taskDefinitionKey: this.taskDefinitionKey,
-              activeComp: this.activeComp,
-              businessId: this.businessId,
-              infoData: this.form,
-              permissionType: this.permissionType
-            };
-          case 'tab2':
-            return {
-              form: this.form,
-              bizType: 7,
-              sourceBizNo: this.form.code,
-              saleProductList: this.form.productList
-            };
-          case 'tab3':
-            return {
-              taskDefinitionKey: this.taskDefinitionKey,
-              businessId: this.form.code
-            };
-          case 'tab4':
-            return {
-              businessId: this.form.code,
-              isUpload: this.isUpload
-            };
-        }
-      }
-    },
+    computed: {},
     async created() {
       await this.getSendSaleOrderDetail(this.businessId);
       switch (this.taskDefinitionKey) {
@@ -132,6 +112,35 @@
       }
     },
     methods: {
+      activeNameProps(activeName) {
+        switch (activeName) {
+          case 'tab1':
+            return {
+              taskDefinitionKey: this.taskDefinitionKey,
+              activeComp: this.activeComp,
+              businessId: this.businessId,
+              infoData: this.form,
+              permissionType: this.permissionType
+            };
+          case 'tab2':
+            return {
+              form: this.form,
+              bizType: 7,
+              sourceBizNo: this.form.code,
+              saleProductList: this.form.productList
+            };
+          case 'tab3':
+            return {
+              taskDefinitionKey: this.taskDefinitionKey,
+              businessId: this.form.code
+            };
+          case 'tab4':
+            return {
+              businessId: this.form.code,
+              isUpload: this.isUpload
+            };
+        }
+      },
       isValidComponent(componentName) {
         const validComponents = ['tab1', 'tab2', 'tab3', 'tab4'];
         return validComponents.includes(componentName);
@@ -150,18 +159,19 @@
         }
       },
       async getTableValue() {
-        console.log(this.$refs.componentRef);
+        console.log(this.$refs.componentReftab2);
+        console.log(this.$refs['componentReftab2'][0].getReturnStorage);
         return {
-          form: this.$refs.componentRef.form,
-          returnStorageData: this.$refs.componentRef.getReturnStorage
-            ? await this.$refs.componentRef.getReturnStorage()
+          form: this.$refs['componentReftab1'][0].form,
+          returnStorageData: this.$refs.componentReftab2 && this.$refs['componentReftab2'][0].getReturnStorage
+            ? await this.$refs['componentReftab2'][0].getReturnStorage()
             : '',
           isAllChecked:
-            this.$refs.componentRef.getStatus &&
-            this.$refs.componentRef.getStatus(),
+            this.$refs.componentReftab3 && this.$refs['componentReftab3'][0].getStatus &&
+            this.$refs['componentReftab3'][0].getStatus(),
           qualityInspector:
-            (this.$refs.componentRef.getQualityFile &&
-              this.$refs.componentRef.getQualityFile()) ||
+            (this.$refs.componentReftab4 && this.$refs['componentReftab4'][0].getQualityFile &&
+              this.$refs['componentReftab4'][0].getQualityFile()) ||
             {}
         };
       },

+ 18 - 24
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/detailDialog.vue

@@ -3,81 +3,75 @@
     <el-form ref="form" :model="form" label-width="130px">
       <headerTitle title="收货信息"></headerTitle>
       <el-row :gutter="20">
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="选择订单:"
             prop="orderNo"
-            style="margin-bottom: 22px"
           >
             {{ form.orderNo }}
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="客户名称:"
             prop="contactName"
-            style="margin-bottom: 22px"
           >
             {{ form.contactName }}
           </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-col :span="8">
           <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-row> -->
       <el-row :gutter="20">
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item
             label="车辆号:"
             prop="carNo"
-            style="margin-bottom: 22px"
           >
             {{ form.carNo }}
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="8">
           <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-col :span="8">
           <el-form-item
             label="收货日期:"
             prop="receiveDate"
-            style="margin-bottom: 22px"
           >
             {{ form.receiveDate }}
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="8">
           <el-form-item
             label="收货单号:"
             prop="sendNoteNo"
-            style="margin-bottom: 22px"
           >
             {{ form.sendNoteNo }}
           </el-form-item>
         </el-col>
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item prop="files" label="附件:">
             <fileMain v-model="form.files" type="view"></fileMain>
             <!--            <div v-if="form.files && form.files?.length">-->

+ 3 - 4
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/submit.vue

@@ -58,9 +58,7 @@
         size="mini"
         :loading="isSaveLoading"
         v-if="
-          taskDefinitionKey == 'storeManagerApprove' &&
-          activeComp == 'inoutBound'
-        "
+          taskDefinitionKey == 'storeManagerApprove'"
         @click="handleAudit(1)"
         >申请入库
       </el-button>
@@ -176,6 +174,7 @@
       };
     },
     created() {
+      console.log('taskDefinitionKey!!!', this.taskDefinitionKey);
       this.userOptions = [];
       listAllUserBind().then((data) => {
         this.userOptions.push(...data);
@@ -257,7 +256,7 @@
         if (this.taskDefinitionKey === 'storeManagerApprove' && status) {
           let res = await this.getTableValue();
           let storageData = res.returnStorageData;
-          console.log(storageData);
+          console.log('storageData~~~', res);
           // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
           storageData.isSkip = 1;
           try {

+ 3 - 0
src/views/bpm/handleTask/components/saleOrder/returnGoods/submit.vue

@@ -22,6 +22,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        v-click-once
         @click="handleAudit(1)"
         v-if="outInData.verifyStatus == 2 || !['warehouseManager'].includes(taskDefinitionKey)"
         >通过
@@ -30,6 +31,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        v-click-once
         @click="storemanApprove"
         v-if="
           (['storemanApprove'].includes(taskDefinitionKey) &&
@@ -42,6 +44,7 @@
         icon="el-icon-circle-close"
         type="danger"
         size="mini"
+        v-click-once
         @click="handleAudit(0)"
         v-if="
           !((['starter'].includes(taskDefinitionKey) &&

+ 3 - 0
src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/submit.vue

@@ -22,6 +22,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        v-click-once
         @click="handleAudit(1)"
         v-if="taskDefinitionKey != 'storemanApprove'"
         >通过
@@ -30,6 +31,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        v-click-once
         @click="storemanApprove"
         v-if="
           taskDefinitionKey == 'storemanApprove' && activeComp == 'inoutBound'
@@ -40,6 +42,7 @@
         icon="el-icon-circle-close"
         type="danger"
         size="mini"
+        v-click-once
         @click="approveTaskWithVariables(0)"
         v-if="
           !['starter'].includes(taskDefinitionKey) &&

+ 3 - 0
src/views/bpm/handleTask/components/salesServiceManagement/recycle/submit.vue

@@ -22,6 +22,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        v-click-once
         @click="handleAudit(1)"
         v-if="taskDefinitionKey != 'storemanApprove'"
         >通过
@@ -30,6 +31,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        v-click-once
         @click="storemanApprove"
         v-if="taskDefinitionKey == 'storemanApprove'"
         >申请入库
@@ -38,6 +40,7 @@
         icon="el-icon-circle-close"
         type="danger"
         size="mini"
+        v-click-once
         @click="approveTaskWithVariables(0)"
         >驳回
       </el-button>

+ 3 - 0
src/views/bpm/handleTask/components/salesServiceManagement/return/submit.vue

@@ -22,6 +22,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        v-click-once
         @click="handleAudit(1)"
         v-if="taskDefinitionKey != 'storemanApprove'"
         >通过
@@ -30,6 +31,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        v-click-once
         @click="storemanApprove"
         v-if="taskDefinitionKey == 'storemanApprove'"
         >申请入库
@@ -38,6 +40,7 @@
         icon="el-icon-circle-close"
         type="danger"
         size="mini"
+        v-click-once
         @click="approveTaskWithVariables(0)"
         >驳回
       </el-button>

+ 4 - 0
src/views/bpm/outgoingManagement/outbound.vue

@@ -1073,6 +1073,7 @@
           console.log(this.saleProductList, 'this.saleProductList33333');
           let pData = {
             type: '1',
+            deliveryNo: this.formData.sourceBizNo,
             builders: this.detailList.map((item) => {
               return {
                 categoryId:
@@ -1085,6 +1086,7 @@
           };
           let pData2 = {
             type: this.wwType,
+            deliveryNo: this.formData.sourceBizNo,
             taskIds: this.extractedList.map((item) => item.taskId),
             workOrderIds: this.extractedList.map((item) => item.workOrderId),
             
@@ -1092,12 +1094,14 @@
           let pData3 = {
             //销售退货处理 外协出库
             type: 3,
+            deliveryNo: this.formData.sourceBizNo,
             outInIds: this.form?.returnInReceiptId?.split(','),
             packageNos: this.detailList.map((item) => item.packageNo)
           };
           let pData4 = {
             //受托退货
             type: 3,
+            deliveryNo: this.formData.sourceBizNo,
             ids: this.detailList.map((item) => item.packageId)?.toString()
           };
           let api = this.bizType == 8 ? 'getHierarchyList' : 'getHierarchyFifo';

+ 30 - 4
src/views/bpm/tickets/patrolInspection/index.vue

@@ -21,7 +21,20 @@
           <!-- 操作列 -->
           <template v-slot:action="{ row }">
             <el-link
-              v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+              v-if="row.orderStatus == 0"
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="startExecuting(row)"
+            >
+              接收
+            </el-link>
+            <el-link
+              v-if="
+                row.orderStatus !== 3 &&
+                row.orderStatus !== 4 &&
+                row.orderStatus != 0
+              "
               type="primary"
               :underline="false"
               icon="el-icon-edit"
@@ -30,7 +43,11 @@
               报工
             </el-link>
             <el-link
-              v-if="row.orderStatus !== 3 && row.orderStatus !== 4&&row.isGroup != 1"
+              v-if="
+                row.orderStatus !== 3 &&
+                row.orderStatus !== 4 &&
+                row.isGroup != 1
+              "
               type="primary"
               :underline="false"
               icon="el-icon-edit"
@@ -55,7 +72,11 @@
   import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
   import redeployOther from '../components/redeployOther.vue';
   import signingUpWork from '../components/signingUpWork.vue';
-  import { ticketStatus, resultStatus } from '@/utils/dict/tickets';
+  import {
+    ticketStatus,
+    resultStatus,
+    startExecuting
+  } from '@/utils/dict/tickets';
   import { getWorkOrderPage, getRule } from '@/api/tickets';
   import pagenation from '@/components/Pagination';
 
@@ -240,7 +261,7 @@
               return { label: item.label, value: item.id };
             }),
             placeholder: ' '
-          },
+          }
 
           // {
           //   label: '开始结束时间:',
@@ -315,6 +336,11 @@
       getData() {
         this.search(this.searchForm);
       },
+      startExecuting(row) {
+        startExecuting({ id: row.id }).then((res) => {
+          this.getData();
+        });
+      },
       // 计算实际工时
       time_interval(dt1, dt2) {
         if (!dt1 || !dt2) {