yusheng 1 년 전
부모
커밋
0056aa0a3b

+ 1 - 1
lib/vue-form-making/src/components/GenerateForm.vue

@@ -789,7 +789,7 @@ export default {
             params: {},
             data: {}
           }
-
+console.log(currentDataSource,'headers')
           let optionsHeaders = {}
           currentDataSource.headers && Object.keys(currentDataSource.headers).forEach(key => {
             if (isExpression(currentDataSource.headers[key])) {

+ 5 - 2
lib/vue-form-making/src/components/componentsConfig.js

@@ -301,7 +301,9 @@ export const basicComponents = [
       customProps: {},
       tip: '',
       extendProps: {},
-      remoteDataSource: 'getUserPage'
+      remoteDataSource: 'getUserPage',
+      headers: headers,
+
     },
     events: {
       onMounted: '',
@@ -916,7 +918,8 @@ export const basicComponents = [
       customProps: {},
       tip: '',
       extendProps: {},
-      remoteDataSource: 'getDeptTree'
+      remoteDataSource: 'getDeptTree',
+      headers: headers,
     },
     events: {
       onMounted: '',

+ 68 - 57
src/views/bpm/collaborative/detail.vue

@@ -1,7 +1,6 @@
 <template>
   <ele-modal
     :visible="formDetailDialogFlag"
-
     width="400px"
     :centered="true"
     :close-on-click-modal="false"
@@ -10,19 +9,25 @@
   >
     <template slot="title">
       <div>
-       <span style="margin-right: 5px">{{form.name}}</span>
+        <span style="margin-right: 5px">{{ form.name }}</span>
         <span style="color: #a6a7ab">发起人:</span>
-        <span style="margin-right: 10px;color: #a6a7ab">{{form.startUserName}}</span>
-        <el-tag size="medium" :type="getTimelineItemType(getDictValue('流程实例的结果', form.result))">
+        <span style="margin-right: 10px; color: #a6a7ab">{{
+          form.startUserName
+        }}</span>
+        <el-tag
+          size="medium"
+          :type="
+            getTimelineItemType(getDictValue('流程实例的结果', form.result))
+          "
+        >
           {{ getDictValue('流程实例的结果', form.result) }}
         </el-tag>
       </div>
-
     </template>
     <div class="eleModalBox">
       <fm-generate-form
         v-if="Object.keys(form?.formJson || {}).length !== 0"
-        :data="JSON.parse(form.formJson.makingJson)"
+        :data="jsonData"
         :value="form.valueJson"
         :edit="false"
         ref="generateForm"
@@ -33,65 +38,71 @@
     <div slot="footer" class="footer">
       <el-button @click="cancel">返回</el-button>
     </div>
-
-
   </ele-modal>
 </template>
 <script>
+  import dictMixins from '@/mixins/dictMixins';
+  import { getToken } from '@/utils/token-util';
 
-import dictMixins from "@/mixins/dictMixins";
-
-export default {
-  name: 'formDetailDialog',
-  components: {},
-  props: {
-    formDetailDialogFlag: {
-      type: Boolean,
-      default: false
-    },
-  },
-  mixins: [dictMixins],
-  data() {
-    return {
-      form: {}
-    }
-  },
-  methods: {
-    open(row) {
-      this.form = _.cloneDeep(row)
-    },
-    getTimelineItemType(result) {
-      if (result === '通过') {
-        return 'success';
-      }
-      if (result === '不通过') {
-        return 'danger';
-      }
-      if (result === '取消') {
-        return 'info';
+  export default {
+    name: 'formDetailDialog',
+    components: {},
+    props: {
+      formDetailDialogFlag: {
+        type: Boolean,
+        default: false
       }
-      if (result === '处理中') {
-        return 'warning';
-      }
-
-      return '';
     },
-    cancel() {
-      this.$emit('update:formDetailDialogFlag', false);
+    mixins: [dictMixins],
+    data() {
+      return {
+        form: {},
+        jsonData:{}
+      };
     },
-  }
-};
+    methods: {
+      open(row) {
+        this.form = _.cloneDeep(row);
+        this.jsonData = JSON.parse(this.form.formJson.makingJson);
+        this.jsonData.config.dataSource &&
+          this.jsonData.config.dataSource.forEach((item) => {
+            item.headers = {
+              Authorization: getToken()
+            };
+            // item.url = item.url && item.url.replace('/api', this.APIUrl);
+          });
+      },
+      getTimelineItemType(result) {
+        if (result === '通过') {
+          return 'success';
+        }
+        if (result === '不通过') {
+          return 'danger';
+        }
+        if (result === '取消') {
+          return 'info';
+        }
+        if (result === '处理中') {
+          return 'warning';
+        }
+
+        return '';
+      },
+      cancel() {
+        this.$emit('update:formDetailDialogFlag', false);
+      }
+    }
+  };
 </script>
 <style scoped lang="scss">
-.eleModalBox {
-  max-height: 500px;
-  min-width: 300px;
-  overflow: auto;
-
-}
+  .eleModalBox {
+    max-height: 500px;
+    min-width: 300px;
+    overflow: auto;
+  }
 
-::v-deep .el-dialog__header {
-  display: flex;
-  justify-content: space-between;
-}
+  ::v-deep .el-dialog__header {
+    display: flex;
+    justify-content: space-between;
+  }
 </style>

+ 14 - 19
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/addReturnGoodsDialog.vue

@@ -18,6 +18,8 @@
               v-model="form.receiveNo"
               @click.native="handleOrderBtn"
               placeholder="请输入"
+              :disabled="isView"
+              
             />
           </el-form-item>
 
@@ -29,6 +31,7 @@
             <el-input
               clearable
               v-model="form.receiveAddress"
+              :disabled="isView"
               placeholder="请输入"
             />
           </el-form-item>
@@ -43,17 +46,13 @@
               clearable
               v-model="form.remark"
               type="textarea"
+              :disabled="isView"
               placeholder="请输入"
             />
           </el-form-item>
           <el-form-item prop="returnFiles" label="附件">
-            <fileMain v-model="form.returnFiles"></fileMain>
-<!--            <fileUpload-->
-<!--              v-model="form.returnFiles"-->
-<!--              module="main"-->
-<!--              :showLib="false"-->
-<!--              :limit="10"-->
-<!--            />-->
+            <fileMain v-model="form.returnFiles" :type="isView?'view':'add'"></fileMain>
+
           </el-form-item>
         </el-col>
 
@@ -63,24 +62,18 @@
             prop="linkName"
             style="margin-bottom: 22px"
           >
-            <el-input clearable v-model="form.linkName" placeholder="请输入" />
+              
+            <el-input clearable v-model="form.linkName" placeholder="请输入" :disabled="isView" />
           </el-form-item>
           <el-form-item
             label="供应商联系电话"
             prop="linkPhone"
             style="margin-bottom: 22px"
           >
-            <el-input clearable v-model="form.linkPhone" placeholder="请输入" />
+            <el-input clearable v-model="form.linkPhone" placeholder="请输入" :disabled="isView" />
             <!-- {{ form.linkPhone }} -->
           </el-form-item>
-          <!-- <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-row>
       <headerTitle title="物品清单" style="margin-top: 30px"></headerTitle>
@@ -93,6 +86,7 @@
         :payAmount.sync="form.payAmount"
         ref="inventoryTableref"
         :receiveId="form.receiveId"
+        :isView="isView"
       ></inventoryTable>
       <el-row style="margin-top: 20px">
         <el-col :span="12">
@@ -110,7 +104,7 @@
             prop="payAmount"
             style="margin-bottom: 22px"
           >
-            <el-input clearable v-model="form.payAmount" placeholder="请输入" />
+            <el-input clearable v-model="form.payAmount" placeholder="请输入" :disabled="isView" />
           </el-form-item>
         </el-col>
       </el-row>
@@ -146,7 +140,8 @@ export default {
     props: {
       businessId: {
         default: ''
-      }
+      },
+      isView:''
     },
     data() {
       let formDef = {

+ 169 - 222
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/detailDialog.vue

@@ -1,186 +1,160 @@
 <template>
   <div>
-    <div class="switch">
-      <div class="switch_left">
-        <ul>
-          <li
-            v-for="item in tabOptions"
-            :key="item.key"
-            :class="{ active: activeComp == item.key }"
-            @click="changeActive(item)"
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <div class="title"> 退货单信息</div>
+     
+      <el-row>
+        
+        <el-col :span="8">
+          <el-form-item
+            label="供应商名称:"
+            prop="supplierName"
+            style="margin-bottom: 5px"
           >
-            {{ item.name }}
-          </li>
-        </ul>
-      </div>
-    </div>
-    <div v-show="activeComp == 'main'">
-      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <headerTitle title="退货信息"></headerTitle>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item
-              label="供应商名称:"
-              prop="supplierName"
-              style="margin-bottom: 16px"
-            >
-              {{ form.supplierName }}
-            </el-form-item>
+            {{ form.supplierName }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="退货单编码:"
+            prop="returnNo"
+            style="margin-bottom: 5px"
+          >
+            {{ form.returnNo }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="收货单编码:"
+            prop="receiveNo"
+            style="margin-bottom: 5px"
+          >
+            {{ form.receiveNo }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item prop="orderNo" label="订单编码:">
+            {{ form.orderNo }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            prop="linkPhone"
+            label-width="150px"
+            label="供应商联系电话:"
+          >
+            {{ form.linkPhone }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            prop="receiveAddress"
+            label-width="150px"
+            label="供应商收货地址:"
+          >
+            {{ form.receiveAddress }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="供应商联系人:"
+            prop="linkName"
+            style="margin-bottom: 5px"
+          >
+            {{ form.linkName }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="金额:"
+            prop="payAmount"
+            style="margin-bottom: 5px"
+          >
+            {{ form.payAmount }}元
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="总金额:"
+            prop="totalAmount"
+            style="margin-bottom: 5px"
+          >
+            {{ form.totalAmount }}元
+          </el-form-item>
+        </el-col>
+ 
+        <el-col :span="8">
+          <el-form-item
+            label="创建时间:"
+            prop="createTime"
+            style="margin-bottom: 5px"
+          >
+            {{ form.createTime }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="制单人:"
+            prop="makerName"
+            style="margin-bottom: 5px"
+          >
+            {{ form.makerName }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="taskDefinitionKey == 'purchaserUploadReceipt'||!taskDefinitionKey">
+          <el-form-item
+            prop="repliedFiles"
+            label="回执附件"
+            :rules="[{ required: true, trigger: 'blur' }]"
+          >
+            <fileMain v-model="form.repliedFiles" :type="taskDefinitionKey == 'purchaserUploadReceipt'?'add':'view'"></fileMain>
+          </el-form-item>
+        </el-col>
 
-            <el-form-item
-              label="金额:"
-              prop="payAmount"
-              style="margin-bottom: 16px"
-            >
-              {{ form.payAmount }}元
-            </el-form-item>
-            <el-form-item
-              label="总金额:"
-              prop="totalAmount"
-              style="margin-bottom: 16px"
-            >
-              {{ form.totalAmount }}元
-            </el-form-item>
-            <el-form-item
-              label="供应商联系人:"
-              prop="linkName"
-              style="margin-bottom: 16px"
-            >
-              {{ form.linkName }}
-            </el-form-item>
-            <el-form-item
-              label="备注:"
-              prop="remark"
-              style="margin-bottom: 16px"
-            >
-              {{ form.remark }}
-            </el-form-item>
-            <el-form-item
-              label="创建时间:"
-              prop="createTime"
-              style="margin-bottom: 16px"
-            >
-              {{ form.createTime }}
-            </el-form-item>
-            <el-form-item
-              label="制单人:"
-              prop="makerName"
-              style="margin-bottom: 16px"
-            >
-              {{ form.makerName }}
-            </el-form-item>
-            <el-form-item
-              v-if="taskDefinitionKey == 'purchaserUploadReceipt'"
-              prop="repliedFiles"
-              label="回执附件"
-              :rules="[{ required: true, trigger: 'blur' }]"
-            >
-              <fileMain v-model="form.repliedFiles"></fileMain>
-<!--              <fileUpload-->
-<!--                v-model="form.repliedFiles"-->
-<!--                module="main"-->
-<!--                :showLib="false"-->
-<!--                :limit="10"-->
-<!--              />-->
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item
-              label="退货单编码:"
-              prop="returnNo"
-              style="margin-bottom: 16px"
-            >
-              {{ form.returnNo }}
-            </el-form-item>
-            <el-form-item
-              label="收货单编码:"
-              prop="receiveNo"
-              style="margin-bottom: 16px"
-            >
-              {{ form.receiveNo }}
-            </el-form-item>
-            <el-form-item prop="orderNo" label="订单编码:">
-              {{ form.orderNo }}
-            </el-form-item>
-            <el-form-item
-              prop="linkPhone"
-              label-width="150px"
-              label="供应商联系电话:"
-            >
-              {{ form.linkPhone }}
-            </el-form-item>
+       
+        <el-col :span="8">
+          <el-form-item
+            label="审核状态:"
+            prop="reviewStatus"
+            style="margin-bottom: 5px"
+          >
+            {{ reviewStatusEnum[form.reviewStatus]?.label }}
+          </el-form-item>
+        </el-col>
+   
+        <el-col :span="8">
+          <el-form-item label="备注:" prop="remark" style="margin-bottom: 5px">
+            {{ form.remark }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item
+            label="附件:"
+            prop="returnFiles"
+            style="margin-bottom: 5px"
+          >
+            <fileMain v-model="detailData.returnFiles" type="view"></fileMain>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
 
-            <el-form-item
-              label="审核状态:"
-              prop="reviewStatus"
-              style="margin-bottom: 16px"
-            >
-              {{ reviewStatusEnum[form.reviewStatus]?.label }}
-            </el-form-item>
-            <el-form-item
-              prop="receiveAddress"
-              label-width="150px"
-              label="供应商收货地址:"
-            >
-              {{ form.receiveAddress }}
-            </el-form-item>
-            <el-form-item
-              label="附件:"
-              prop="returnFiles"
-              style="margin-bottom: 16px"
-            >
-              <div
-                v-if="detailData.returnFiles && detailData.returnFiles?.length"
-              >
-                <el-link
-                  v-for="link in detailData.returnFiles"
-                  :key="link.id"
-                  type="primary"
-                  :underline="false"
-                  @click="downloadFile(link)"
-                >
-                  {{ link.name }}</el-link
-                >
-              </div>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
+    <headerTitle title="物品清单"></headerTitle>
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :toolkit="[]"
+      :datasource="detailData.productList"
+      row-key="id"
+    >
+    </ele-pro-table>
+    <div class="title"> 出库单信息</div>
 
-      <headerTitle title="物品清单"></headerTitle>
-      <ele-pro-table
-        ref="table"
-        :needPage="false"
-        :columns="columns"
-        :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>
     <keep-alive>
       <add
         ref="add"
-        v-if="activeComp == 'outBound'"
+        v-if="taskDefinitionKey == 'storemanApprove'"
         :form="form"
         :sourceBizNo="form.returnNo"
         :bizType="10"
@@ -189,7 +163,8 @@
     <detailDialog
       type="sourceBizNo"
       :businessId="form.returnNo"
-      v-if="activeComp == 'outBoundView'"
+      ref="outgoingDetai"
+      v-if="taskDefinitionKey == 'purchaserUploadReceipt' || !taskDefinitionKey"
     ></detailDialog>
   </div>
 </template>
@@ -204,7 +179,7 @@
   import add from '@/views/bpm/outgoingManagement/outbound.vue';
   import detailDialog from '@/views/bpm/outgoingManagement/details.vue';
   import { reviewStatusEnum } from '@/enum/dict';
-  import fileMain from "@/components/addDoc/index.vue";
+  import fileMain from '@/components/addDoc/index.vue';
   export default {
     components: {
       fileMain,
@@ -225,7 +200,7 @@
         row: {},
         activeName: 'base',
         form: {
-          orderFiles: [{ name: '222' }]
+          orderFiles: []
         },
         rules: {},
         detailData: {},
@@ -344,8 +319,11 @@
             slot: 'pricingWay',
             align: 'center',
             formatter: (row, column) => {
-              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
-
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
             }
           },
           {
@@ -360,11 +338,9 @@
             prop: 'taxRate',
             label: '税率',
             formatter: (_row, _column, cellValue) => {
-              return _row.taxRate
-                ? _row.taxRate+'%'
-                : '';
+              return _row.taxRate ? _row.taxRate + '%' : '';
             },
-            align: 'center',
+            align: 'center'
           },
           {
             width: 160,
@@ -409,44 +385,6 @@
                 : '';
             }
           },
-          // {
-          //   width: 140,
-          //   prop: 'returnType',
-          //   label: '退货类型',
-          //   slot: 'returnType'
-          // },
-
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays'
-          // },
-          // {
-          //   width: 200,
-          //   prop: 'guaranteePeriod',
-          //   label: '质保期',
-          //   slot: 'guaranteePeriod'
-          // },
-
-          // {
-          //   width: 130,
-          //   prop: 'technicalAnswerName',
-          //   label: '技术答疑人',
-          //   slot: 'technicalAnswerName'
-          // },
-          // {
-          //   width: 220,
-          //   prop: 'technicalParams',
-          //   label: '技术参数',
-          //   slot: 'technicalParams'
-          // },
-          // {
-          //   width: 240,
-          //   prop: 'technicalDrawings',
-          //   label: '技术图纸',
-          //   slot: 'technicalDrawings'
-          // },
           {
             width: 220,
             prop: 'remark',
@@ -520,6 +458,10 @@
           });
           this.detailData = data;
           this.form = data;
+          this.$nextTick(() => {
+            this.$refs.add?.initFormData();
+            this.$refs.outgoingDetai?._getInfo(data.returnNo);
+          });
         }
       },
       save(data) {
@@ -532,7 +474,12 @@
   };
 </script>
 
-<style scoped lang="scss">
+<style scoped lang="scss">  
+.title {
+  font-size: 22px;
+  font-weight: 800;
+  margin-top: 15px;
+}
   .ele-dialog-form {
     .el-form-item {
       margin-bottom: 10px;

+ 711 - 656
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/inventoryTable.vue

@@ -18,6 +18,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="handlAdd"
+            v-if="!isView"
           >
             新增
           </el-button>
@@ -50,6 +51,7 @@
             clearable
             v-model="row.returnReason"
             type="textarea"
+            :disabled="isView"
             placeholder="请输入"
           />
         </el-form-item>
@@ -62,53 +64,29 @@
           <el-input
             clearable
             v-model="row.remark"
+            :disabled="isView"
             type="textarea"
             placeholder="请输入"
           />
         </el-form-item>
       </template>
-      <!-- <template v-slot:returnType="{ row, $index }">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + $index + '.returnType'"
-        >
-          <DictSelection
-            dictName="退货类型"
-            clearable
-            v-model="row.returnType"
-          />
-        </el-form-item>
-      </template> -->
-      <!--      <template v-slot:singlePrice="{ row, $index }">-->
-      <!--        <el-form-item-->
-      <!--          style="margin-bottom: 20px"-->
-      <!--          :prop="'datasource.' + $index + '.singlePrice'"-->
-      <!--        >-->
-      <!--          <el-input-->
-      <!--            type="number"-->
-      <!--            clearable-->
-      <!--            v-model="row.singlePrice"-->
-      <!--            @input="(val) => changeNumSinglePrice(val, $index)"-->
-      <!--            placeholder="请输入"-->
-      <!--          />-->
-      <!--        </el-form-item>-->
-      <!--      </template>-->
 
       <template v-slot:totalPrice="{ row, $index }">
         <el-form-item
-          v-if="returnSourceType==2"
+          v-if="returnSourceType == 2"
           style="margin-bottom: 20px"
           :prop="'datasource.' + $index + '.totalPrice'"
         >
           <el-input
             type="number"
             clearable
+            :disabled="isView"
             v-model="row.totalPrice"
             @input="(val) => changeTotalPrice(val, $index)"
             placeholder="请输入"
           />
         </el-form-item>
-        <span v-else>{{row.totalPrice}}</span>
+        <span v-else>{{ row.totalPrice }}</span>
       </template>
 
       <template v-slot:totalCount="scope">
@@ -122,6 +100,7 @@
         >
           <el-input
             v-model="scope.row.totalCount"
+            :disabled="isView"
             @input="(val) => changeNum(val, scope.$index)"
           ></el-input>
         </el-form-item>
@@ -132,22 +111,28 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.sendTotalWeight'"
           :rules="[
-            { required: [2,3].includes(Number(sourceType))&&outsourceSendCode, message: '请输入数字', trigger: 'blur' }
+            {
+              required:
+                [2, 3].includes(Number(sourceType)) && outsourceSendCode,
+              message: '请输入数字',
+              trigger: 'blur'
+            }
           ]"
         >
-          <el-input v-model="scope.row.sendTotalWeight" @blur="changeSendTotalWeight(scope.$index)"
-                    :disabled="!outsourceSendCode"
-                    style="width: 60%; margin-right: 10px">
-
+          <el-input
+            v-model="scope.row.sendTotalWeight"
+            @blur="changeSendTotalWeight(scope.$index)"
+            :disabled="!outsourceSendCode||isView"
+            style="width: 60%; margin-right: 10px"
+          >
           </el-input>
           <el-button
             size="small"
             type="primary"
-            v-if="[2,3].includes(Number(sourceType))&&outsourceSendCode"
-            @click.native="(e)=>handleOutBound(e,scope.row,scope.$index)"
-          >选择
-          </el-button
-          >
+            v-if="[2, 3].includes(Number(sourceType)) && outsourceSendCode&&!isView"
+            @click.native="(e) => handleOutBound(e, scope.row, scope.$index)"
+            >选择
+          </el-button>
         </el-form-item>
       </template>
       <!--   收货总重   -->
@@ -156,50 +141,38 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.receiveTotalWeight'"
           :rules="[
-            { required: [2,3].includes(Number(sourceType))&&pricingWay==2, message: '请输入数字', trigger: 'blur' }
+            {
+              required: [2, 3].includes(Number(sourceType)) && pricingWay == 2,
+              message: '请输入数字',
+              trigger: 'blur'
+            }
           ]"
         >
-          <el-input v-model="scope.row.receiveTotalWeight" @blur="changeReceiveTotalWeight(scope.$index)"
-                    style="width: 60%; margin-right: 10px">
-
+          <el-input
+            v-model="scope.row.receiveTotalWeight"
+            @blur="changeReceiveTotalWeight(scope.$index)"
+            style="width: 60%; margin-right: 10px"
+            :disabled="isView"
+          >
           </el-input>
           <el-button
+          v-if="!isView"
             size="small"
             type="primary"
-            @click.native="(e)=>handleInnerBound(e,scope.row,scope.$index)"
-          >选择
-          </el-button
-          >
+            @click.native="(e) => handleInnerBound(e, scope.row, scope.$index)"
+            >选择
+          </el-button>
         </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="请选择"
-            disabled
-            @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:headerTotalCount="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
       <template v-slot:headerSendTotalWeight="{ column }">
-        <span :class="{'is-required':outsourceSendCode}">{{ column.label }}</span>
+        <span :class="{ 'is-required': outsourceSendCode }">{{
+          column.label
+        }}</span>
       </template>
       <template v-slot:action="{ row }">
         <el-popconfirm
@@ -222,229 +195,237 @@
       @changeParent="changeParent"
     ></product-list>
     <!--出库详情-->
-    <outbound-details-dialog v-if="outboundDetailsDialogFlag" ref="outboundDetailsDialogRef"
-                             :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
-                             @saveDate="saveDate"></outbound-details-dialog>
+    <outbound-details-dialog
+      v-if="outboundDetailsDialogFlag"
+      ref="outboundDetailsDialogRef"
+      :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
+      @saveDate="saveDate"
+    ></outbound-details-dialog>
     <!--入库详情-->
-    <innertboundDetailsDialog v-if="innerboundDetailsDialogFlag" ref="innerboundDetailsDialogRef"
-                              :innerboundDetailsDialogFlag.sync="innerboundDetailsDialogFlag"
-                              @saveDate="saveInnerDate"></innertboundDetailsDialog>
+    <innertboundDetailsDialog
+      v-if="innerboundDetailsDialogFlag"
+      ref="innerboundDetailsDialogRef"
+      :innerboundDetailsDialogFlag.sync="innerboundDetailsDialogFlag"
+      @saveDate="saveInnerDate"
+    ></innertboundDetailsDialog>
   </el-form>
 </template>
 <script>
-import {numberReg} from 'ele-admin';
-import dictMixins from '@/mixins/dictMixins';
-import productList from '@/views/bpm/handleTask/components/saleOrder/invoice/product-list.vue';
-import innertboundDetailsDialog from './innerboundDetailsDialog.vue'
-import {getWarehouseOutStock} from '@/api/bpm/components/saleManage/saleorder';
-import OutboundDetailsDialog from "@/views/bpm/handleTask/components/purchaseOrder/invoice/outboundDetailsDialog.vue";
+  import { numberReg } from 'ele-admin';
+  import dictMixins from '@/mixins/dictMixins';
+  import productList from '@/views/bpm/handleTask/components/saleOrder/invoice/product-list.vue';
+  import innertboundDetailsDialog from './innerboundDetailsDialog.vue';
+  import { getWarehouseOutStock } from '@/api/bpm/components/saleManage/saleorder';
+  import OutboundDetailsDialog from '@/views/bpm/handleTask/components/purchaseOrder/invoice/outboundDetailsDialog.vue';
 
-export default {
-  mixins: [dictMixins],
-  props: {
-    receiveId: String,
-    payAmount: [Number,String],
-    returnSourceType: [Number,String],
-    pricingWay: [Number, String],
-    sourceType: [Number, String],
-    outsourceSendCode: [Number, String],
-    receiveNo: [Number, String],
-  },
-  components: {
-    OutboundDetailsDialog,
-    productList,
-    innertboundDetailsDialog
-  },
-  data() {
-    const defaultForm = {
-      key: null,
-      endTime: '',
-      isFirst: 0,
-      name: '',
-      startTime: '',
-      workHour: '',
-      technicalDrawings: []
-    };
-    return {
-      discountTotalPrice: 0.0,
-      allPrice: 0.0,
-      totalAmount: 0.0,
-      outboundDetailsDialogFlag: false,
-      innerboundDetailsDialogFlag: false,
-      numberReg,
-      defaultForm,
-      // warehouseList: [],
-      form: {
-        datasource: []
-      },
-      rules: {},
-
-      columns: [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          width: 200,
-          prop: 'productName',
-          label: '名称',
-          slot: 'productName',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'productCode',
-          label: '编码',
-          slot: 'productCode',
-          align: "center"
-        },
-        {
-          width: 200,
-          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: 'warehouseName',
-          label: '仓库名称',
-          slot: 'warehouseName',
-          align: "center",
-        },
-        {
-          width: 100,
-          prop: 'warehouseNum',
-          label: '库存',
-          slot: 'warehouseNum',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'receiveTotalCount',
-          label: '收货数量',
-          slot: 'receiveTotalCount',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'totalCount',
-          label: '退货数量',
-          slot: 'totalCount',
-          headerSlot: 'headerTotalCount',
-          align: "center"
-        },
-        {
-          width: 80,
-          prop: 'measuringUnit',
-          label: '计量单位',
-          slot: 'measuringUnit',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'singleWeight',
-          label: '单重',
-          slot: 'singleWeight',
-          align: "center"
-        },
-        {
-          width: 200,
-          prop: 'sendTotalWeight',
-          label: '发货总重',
-          slot: 'sendTotalWeight',
-          align: "center",
-          headerSlot: 'headerSendTotalWeight'
-        },
-        {
-          width: 200,
-          prop: 'receiveTotalWeight',
-          label: '收货总重',
-          slot: 'receiveTotalWeight',
-          align: "center"
-        },
-        {
-          width: 100,
-          prop: 'increaseTotalWeight',
-          label: '增重重量',
-          slot: 'increaseTotalWeight',
-          align: "center"
+  export default {
+    mixins: [dictMixins],
+    props: {
+      receiveId: String,
+      payAmount: [Number, String],
+      returnSourceType: [Number, String],
+      pricingWay: [Number, String],
+      sourceType: [Number, String],
+      outsourceSendCode: [Number, String],
+      receiveNo: [Number, String],
+      isView: ''
+    },
+    components: {
+      OutboundDetailsDialog,
+      productList,
+      innertboundDetailsDialog
+    },
+    data() {
+      const defaultForm = {
+        key: null,
+        endTime: '',
+        isFirst: 0,
+        name: '',
+        startTime: '',
+        workHour: '',
+        technicalDrawings: []
+      };
+      return {
+        discountTotalPrice: 0.0,
+        allPrice: 0.0,
+        totalAmount: 0.0,
+        outboundDetailsDialogFlag: false,
+        innerboundDetailsDialogFlag: false,
+        numberReg,
+        defaultForm,
+        // warehouseList: [],
+        form: {
+          datasource: []
         },
-        {
+        rules: {},
+
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            width: 200,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode',
+            align: 'center'
+          },
+          {
+            width: 200,
+            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: 'warehouseName',
+            label: '仓库名称',
+            slot: 'warehouseName',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'warehouseNum',
+            label: '库存',
+            slot: 'warehouseNum',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'receiveTotalCount',
+            label: '收货数量',
+            slot: 'receiveTotalCount',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'totalCount',
+            label: '退货数量',
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
+            align: 'center'
+          },
+          {
+            width: 80,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'singleWeight',
+            label: '单重',
+            slot: 'singleWeight',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'sendTotalWeight',
+            label: '发货总重',
+            slot: 'sendTotalWeight',
+            align: 'center',
+            headerSlot: 'headerSendTotalWeight'
+          },
+          {
+            width: 200,
+            prop: 'receiveTotalWeight',
+            label: '收货总重',
+            slot: 'receiveTotalWeight',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'increaseTotalWeight',
+            label: '增重重量',
+            slot: 'increaseTotalWeight',
+            align: 'center'
+          },
+          {
             width: 160,
             prop: 'pricingWay',
             label: '计价方式',
             slot: 'pricingWay',
             align: 'center',
             formatter: (row, column) => {
-              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
-
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
             }
           },
-        {
-          width: 160,
-          prop: 'singlePrice',
-          label: '单价',
-          slot: 'singlePrice',
-          align: "center"
-        },
-        {
+          {
+            width: 160,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice',
+            align: 'center'
+          },
+          {
             width: 120,
             prop: 'taxRate',
             label: '税率',
             formatter: (_row, _column, cellValue) => {
-              return _row.taxRate
-                ? _row.taxRate+'%'
-                : '';
+              return _row.taxRate ? _row.taxRate + '%' : '';
             },
-            align: 'center',
+            align: 'center'
           },
-        {
-          width: 160,
-          prop: 'discountSinglePrice',
-          label: '折后单价',
-          slot: 'discountSinglePrice',
-          align: "center"
-        },
-        {
-          width: 140,
-          prop: 'totalPrice',
-          label: '合计',
-          slot: 'totalPrice',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'discountTotalPrice',
-          label: '折后合计',
-          slot: 'discountTotalPrice',
-          align: "center"
-        },
-        {
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice',
+            align: 'center'
+          },
+          {
+            width: 140,
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice',
+            align: 'center'
+          },
+          {
             prop: 'provenance',
             label: '产地',
             slot: 'provenance',
@@ -459,432 +440,506 @@ export default {
                 : '';
             }
           },
-        {
-          width: 200,
-          prop: 'returnReason',
-          label: '退货原因',
-          slot: 'returnReason',
-          align: "center"
-        },
-        // {
-        //   width: 140,
-        //   prop: 'returnType',
-        //   label: '退货类型',
-        //   slot: 'returnType'
-        // },
+          {
+            width: 200,
+            prop: 'returnReason',
+            label: '退货原因',
+            slot: 'returnReason',
+            align: 'center'
+          },
+          // {
+          //   width: 140,
+          //   prop: 'returnType',
+          //   label: '退货类型',
+          //   slot: 'returnType'
+          // },
 
-        // {
-        //   width: 80,
-        //   prop: 'deliveryDays',
-        //   label: '交期(天)',
-        //   slot: 'deliveryDays'
-        // },
-        // {
-        //   width: 200,
-        //   prop: 'guaranteePeriod',
-        //   label: '质保期',
-        //   slot: 'guaranteePeriod'
-        // },
+          // {
+          //   width: 80,
+          //   prop: 'deliveryDays',
+          //   label: '交期(天)',
+          //   slot: 'deliveryDays'
+          // },
+          // {
+          //   width: 200,
+          //   prop: 'guaranteePeriod',
+          //   label: '质保期',
+          //   slot: 'guaranteePeriod'
+          // },
 
-        // {
-        //   width: 130,
-        //   prop: 'technicalAnswerName',
-        //   label: '技术答疑人',
-        //   slot: 'technicalAnswerName'
-        // },
-        // {
-        //   width: 220,
-        //   prop: 'technicalParams',
-        //   label: '技术参数',
-        //   slot: 'technicalParams'
-        // },
-        // {
-        //   width: 240,
-        //   prop: 'technicalDrawings',
-        //   label: '技术图纸',
-        //   slot: 'technicalDrawings'
-        // },
-        {
-          width: 220,
-          prop: 'remark',
-          label: '备注',
-          slot: 'remark',
-          align: "center"
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed: 'right',
-          showOverflowTooltip: true
-        }
-      ]
-    };
-  },
-  computed: {
-    contractId() {
-      return this.$store.state.order.contractId;
-    }
-  },
-  created() {
-    this.requestDict('产地');
-  },
-  methods: {
-    changeNumSinglePrice(val,index){
-      if(!val){
-        this.$set(this.form.datasource[index], 'singlePrice', 0)
-        this.$set(this.form.datasource[index], 'discountSinglePrice', 0)
-      }else {
-        this.$set(this.form.datasource[index], 'discountSinglePrice', val)
-      }
-      let totalCount = this.form.datasource[index].totalCount
-      this.changeNum(totalCount,index)
+          // {
+          //   width: 130,
+          //   prop: 'technicalAnswerName',
+          //   label: '技术答疑人',
+          //   slot: 'technicalAnswerName'
+          // },
+          // {
+          //   width: 220,
+          //   prop: 'technicalParams',
+          //   label: '技术参数',
+          //   slot: 'technicalParams'
+          // },
+          // {
+          //   width: 240,
+          //   prop: 'technicalDrawings',
+          //   label: '技术图纸',
+          //   slot: 'technicalDrawings'
+          // },
+          {
+            width: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            show: !this.isView,
+            showOverflowTooltip: true
+          }
+        ]
+      };
     },
-    changeTotalPrice(val,index){
-      if(!val){
-        this.$set(this.form.datasource[index], 'totalPrice', 0)
-        this.$set(this.form.datasource[index], 'discountTotalPrice', 0)
-      }else {
-        this.$set(this.form.datasource[index], 'discountTotalPrice', val)
+    computed: {
+      contractId() {
+        return this.$store.state.order.contractId;
       }
-      this.gettotalAmount()
     },
-    //修改数量更新合计/总重
-    changeNum(val, index) {
-      this.curIndex = index
-      if (this.pricingWay == 2) {
-        if (val != this.form.datasource[index].receiveTotalCount) {
-          this.$set(this.form.datasource[index], 'sendTotalWeight', '')
-          this.$set(this.form.datasource[index], 'receiveTotalWeight', '')
-          this.$set(this.form.datasource[index], 'increaseTotalWeight', '')
-          this.getWeightPrice()
+    created() {
+      this.requestDict('产地');
+    },
+    methods: {
+      changeNumSinglePrice(val, index) {
+        if (!val) {
+          this.$set(this.form.datasource[index], 'singlePrice', 0);
+          this.$set(this.form.datasource[index], 'discountSinglePrice', 0);
         } else {
-          let find = this.oldSendTotalWeightList.find(key => key.productCode == this.form.datasource[index].productCode) || {}
-          this.$set(this.form.datasource[index], 'sendTotalWeight', find.oldSendTotalWeight)
-          this.$set(this.form.datasource[index], 'receiveTotalWeight', find.oldReceiveTotalWeight)
-          this.setIcreaseTotalWeight()
+          this.$set(this.form.datasource[index], 'discountSinglePrice', val);
         }
-      } else {
-        if (val != this.form.datasource[index].receiveTotalCount) {
-          this.$set(this.form.datasource[index], 'sendTotalWeight', '')
-          this.$set(this.form.datasource[index], 'receiveTotalWeight', '')
-          this.$set(this.form.datasource[index], 'increaseTotalWeight', '')
+        let totalCount = this.form.datasource[index].totalCount;
+        this.changeNum(totalCount, index);
+      },
+      changeTotalPrice(val, index) {
+        if (!val) {
+          this.$set(this.form.datasource[index], 'totalPrice', 0);
+          this.$set(this.form.datasource[index], 'discountTotalPrice', 0);
         } else {
-          let find = this.oldSendTotalWeightList.find(key => key.productCode == this.form.datasource[index].productCode) || {}
-          this.$set(this.form.datasource[index], 'sendTotalWeight', find.oldSendTotalWeight)
-          this.$set(this.form.datasource[index], 'receiveTotalWeight', find.oldReceiveTotalWeight)
-          this.setIcreaseTotalWeight()
+          this.$set(this.form.datasource[index], 'discountTotalPrice', val);
         }
+        this.gettotalAmount();
+      },
+      //修改数量更新合计/总重
+      changeNum(val, index) {
+        this.curIndex = index;
+        if (this.pricingWay == 2) {
+          if (val != this.form.datasource[index].receiveTotalCount) {
+            this.$set(this.form.datasource[index], 'sendTotalWeight', '');
+            this.$set(this.form.datasource[index], 'receiveTotalWeight', '');
+            this.$set(this.form.datasource[index], 'increaseTotalWeight', '');
+            this.getWeightPrice();
+          } else {
+            let find =
+              this.oldSendTotalWeightList.find(
+                (key) =>
+                  key.productCode == this.form.datasource[index].productCode
+              ) || {};
+            this.$set(
+              this.form.datasource[index],
+              'sendTotalWeight',
+              find.oldSendTotalWeight
+            );
+            this.$set(
+              this.form.datasource[index],
+              'receiveTotalWeight',
+              find.oldReceiveTotalWeight
+            );
+            this.setIcreaseTotalWeight();
+          }
+        } else {
+          if (val != this.form.datasource[index].receiveTotalCount) {
+            this.$set(this.form.datasource[index], 'sendTotalWeight', '');
+            this.$set(this.form.datasource[index], 'receiveTotalWeight', '');
+            this.$set(this.form.datasource[index], 'increaseTotalWeight', '');
+          } else {
+            let find =
+              this.oldSendTotalWeightList.find(
+                (key) =>
+                  key.productCode == this.form.datasource[index].productCode
+              ) || {};
+            this.$set(
+              this.form.datasource[index],
+              'sendTotalWeight',
+              find.oldSendTotalWeight
+            );
+            this.$set(
+              this.form.datasource[index],
+              'receiveTotalWeight',
+              find.oldReceiveTotalWeight
+            );
+            this.setIcreaseTotalWeight();
+          }
 
-        this.$set(this.form.datasource[index], 'totalPrice', (Number(this.form.datasource[index].singlePrice) * val).toFixed(2));
-        this.$set(this.form.datasource[index], 'discountTotalPrice', (Number(this.form.datasource[index].discountSinglePrice) * val).toFixed(2));
+          this.$set(
+            this.form.datasource[index],
+            'totalPrice',
+            (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
+          );
+          this.$set(
+            this.form.datasource[index],
+            'discountTotalPrice',
+            (
+              Number(this.form.datasource[index].discountSinglePrice) * val
+            ).toFixed(2)
+          );
 
-        this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
+          this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
+          this.gettotalAmount();
+        }
+      },
+      getWeightPrice() {
+        let increaseTotalWeight =
+          this.form.datasource[this.curIndex].increaseTotalWeight;
+        let singlePrice = this.form.datasource[this.curIndex].singlePrice;
+        let discountSinglePrice =
+          this.form.datasource[this.curIndex].discountSinglePrice;
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'totalPrice',
+          (Number(increaseTotalWeight) * Number(singlePrice)).toFixed(2)
+        );
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'discountTotalPrice',
+          (Number(discountSinglePrice) * Number(increaseTotalWeight)).toFixed(2)
+        );
         this.gettotalAmount();
-      }
-    },
-    getWeightPrice() {
-      let increaseTotalWeight = this.form.datasource[this.curIndex].increaseTotalWeight
-      let singlePrice = this.form.datasource[this.curIndex].singlePrice
-      let discountSinglePrice = this.form.datasource[this.curIndex].discountSinglePrice
-      this.$set(this.form.datasource[this.curIndex], 'totalPrice', (Number(increaseTotalWeight) * Number(singlePrice)).toFixed(2));
-      this.$set(this.form.datasource[this.curIndex], 'discountTotalPrice', (Number(discountSinglePrice) * Number(increaseTotalWeight)).toFixed(2));
-      this.gettotalAmount();
-    },
+      },
 
-    //出库单详情
-    handleOutBound(e, rows, index) {
-      this.curIndex = index
-      this.outboundDetailsDialogFlag = true
-      this.$nextTick(() => {
-        let row = {
-          sendNo: this.outsourceSendCode,
-          productCode: rows.productCode
-        }
-        this.$refs.outboundDetailsDialogRef.init(row)
-      })
-    },
-    //选择退货信息回调
-    saveDate(data = []) {
-      let totalWeight = data.reduce((num, row) => {
-        num += Number(row.weight)
-        return num
-      }, 0)
-      this.$set(this.form.datasource[this.curIndex], 'sendTotalWeight', totalWeight);
-      this.setIcreaseTotalWeight()
-    },
+      //出库单详情
+      handleOutBound(e, rows, index) {
+        this.curIndex = index;
+        this.outboundDetailsDialogFlag = true;
+        this.$nextTick(() => {
+          let row = {
+            sendNo: this.outsourceSendCode,
+            productCode: rows.productCode
+          };
+          this.$refs.outboundDetailsDialogRef.init(row);
+        });
+      },
+      //选择退货信息回调
+      saveDate(data = []) {
+        let totalWeight = data.reduce((num, row) => {
+          num += Number(row.weight);
+          return num;
+        }, 0);
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'sendTotalWeight',
+          totalWeight
+        );
+        this.setIcreaseTotalWeight();
+      },
 
-    //入库单详情
-    handleInnerBound(e, rows, index) {
-      this.curIndex = index
-      this.innerboundDetailsDialogFlag = true
-      this.$nextTick(() => {
-        let row = {
-          sendNo: this.receiveNo,
-          productCode: rows.productCode
-        }
-        this.$refs.innerboundDetailsDialogRef.init(row)
-      })
-    },
-    //选择入库单信息
-    saveInnerDate(data = []) {
-      let totalWeight = data.reduce((num, row) => {
-        num += Number(row.weight)
-        return num
-      }, 0)
-      this.$set(this.form.datasource[this.curIndex], 'receiveTotalWeight', totalWeight);
-      this.setIcreaseTotalWeight()
-    },
-    //修改发货总重
-    changeSendTotalWeight(index) {
-      this.curIndex = index
-      this.setIcreaseTotalWeight()
-    },
-    //修改收货总重
-    changeReceiveTotalWeight(index) {
-      this.curIndex = index
-      this.setIcreaseTotalWeight()
-    },
-    //设置增重总重
-    setIcreaseTotalWeight() {
-      let receiveTotalWeight = Number(this.form.datasource[this.curIndex].receiveTotalWeight)
-      let sendTotalWeight = Number(this.form.datasource[this.curIndex].sendTotalWeight)
-      if ([2, 3].includes(Number(this.sourceType))) {
-        if (this.pricingWay == 2) {
-          if ((!receiveTotalWeight || !sendTotalWeight)) {
-            return this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', '');
+      //入库单详情
+      handleInnerBound(e, rows, index) {
+        this.curIndex = index;
+        this.innerboundDetailsDialogFlag = true;
+        this.$nextTick(() => {
+          let row = {
+            sendNo: this.receiveNo,
+            productCode: rows.productCode
+          };
+          this.$refs.innerboundDetailsDialogRef.init(row);
+        });
+      },
+      //选择入库单信息
+      saveInnerDate(data = []) {
+        let totalWeight = data.reduce((num, row) => {
+          num += Number(row.weight);
+          return num;
+        }, 0);
+        this.$set(
+          this.form.datasource[this.curIndex],
+          'receiveTotalWeight',
+          totalWeight
+        );
+        this.setIcreaseTotalWeight();
+      },
+      //修改发货总重
+      changeSendTotalWeight(index) {
+        this.curIndex = index;
+        this.setIcreaseTotalWeight();
+      },
+      //修改收货总重
+      changeReceiveTotalWeight(index) {
+        this.curIndex = index;
+        this.setIcreaseTotalWeight();
+      },
+      //设置增重总重
+      setIcreaseTotalWeight() {
+        let receiveTotalWeight = Number(
+          this.form.datasource[this.curIndex].receiveTotalWeight
+        );
+        let sendTotalWeight = Number(
+          this.form.datasource[this.curIndex].sendTotalWeight
+        );
+        if ([2, 3].includes(Number(this.sourceType))) {
+          if (this.pricingWay == 2) {
+            if (!receiveTotalWeight || !sendTotalWeight) {
+              return this.$set(
+                this.form.datasource[this.curIndex],
+                'increaseTotalWeight',
+                ''
+              );
+            } else {
+              this.$set(
+                this.form.datasource[this.curIndex],
+                'increaseTotalWeight',
+                (receiveTotalWeight - sendTotalWeight).toFixed(2)
+              );
+            }
           } else {
-            this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', (receiveTotalWeight - sendTotalWeight).toFixed(2));
+            this.$set(
+              this.form.datasource[this.curIndex],
+              'increaseTotalWeight',
+              (receiveTotalWeight - sendTotalWeight).toFixed(2)
+            );
           }
         } else {
-          this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', (receiveTotalWeight - sendTotalWeight).toFixed(2));
+          this.$set(
+            this.form.datasource[this.curIndex],
+            'increaseTotalWeight',
+            receiveTotalWeight
+          );
         }
-      } else {
-        this.$set(this.form.datasource[this.curIndex], 'increaseTotalWeight', receiveTotalWeight);
-      }
-      if (this.pricingWay == 2) {
-        this.getWeightPrice()
-      }
+        if (this.pricingWay == 2) {
+          this.getWeightPrice();
+        }
+      },
+      //获取订单总金额
+      gettotalAmount() {
+        let productData = this.form.datasource;
+        if (productData.length) {
+          let sum = productData
+            .reduce((sum, item) => {
+              return sum + Number(item.totalPrice);
+            }, 0)
+            .toFixed(2);
+          this.totalAmount = productData
+            .reduce((sum, item) => {
+              return sum + Number(item.discountTotalPrice);
+            }, 0)
+            .toFixed(2);
+          this.$emit('update:payAmount', this.totalAmount);
+          this.$store.commit('returnGoods/setAllcountAmount', sum);
+        } else {
+          this.$store.commit('returnGoods/setAllcountAmount', 0);
+        }
+      },
+      //选择产品回调
+      async changeParent(obj, idx) {
+        obj.receiveTotalCount = obj.totalCount;
+        obj.receiveProductId = obj.id;
+        obj.id = '';
 
-    },
-    //获取订单总金额
-    gettotalAmount() {
-      let productData = this.form.datasource;
-      if (productData.length) {
-        let sum = productData
-          .reduce((sum, item) => {
-            return sum + Number(item.totalPrice);
-          }, 0)
-          .toFixed(2);
-        this.totalAmount = productData.reduce((sum, item) => {
-          return sum + Number(item.discountTotalPrice);
-        }, 0).toFixed(2)
-        this.$emit('update:payAmount', this.totalAmount)
-        this.$store.commit('returnGoods/setAllcountAmount', sum);
-      } else {
-        this.$store.commit('returnGoods/setAllcountAmount', 0);
-      }
-    },
-    //选择产品回调
-    async changeParent(obj, idx) {
-      obj.receiveTotalCount = obj.totalCount;
-      obj.receiveProductId = obj.id;
-      obj.id = '';
+        if (obj.warehouseId) {
+          obj['warehouseNum'] = await getWarehouseOutStock({
+            warehouseId: obj.warehouseId,
+            code: obj.productCode
+          });
+        }
+        this.$set(this.form.datasource, this.form.datasource.length, obj);
+      },
 
-      if (obj.warehouseId) {
-        obj['warehouseNum'] = await getWarehouseOutStock({
-          warehouseId: obj.warehouseId,
-          code: obj.productCode
-        });
-      }
-      this.$set(this.form.datasource, this.form.datasource.length, obj);
-    },
+      // 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('同一个产品不能选择相同的仓库');
+      //   }
 
-    // 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
+      //   );
+      // },
 
-    //   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
-    //   );
-    // },
+      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.receiveTotalCount) {
+            this.$message.error('退货数量不能大于收货数量');
+            callback(new Error('退货数量不能大于收货数量'));
+          } else {
+            callback();
+          }
+        };
+      },
+      // else if (this.getTotalCount(row)> row.warehouseNum) {
+      //       this.$message.error('退货数量不能大于库存');
+      //       callback(new Error('退货数量不能大于库存'));
+      //     }
+      getTotalCount(row) {
+        let num = 0;
+        this.form.datasource
+          .filter((item) => item.warehouseId == row.warehouseId)
+          .forEach((item) => {
+            num += Number(item.totalCount);
+          });
 
-    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.receiveTotalCount) {
-          this.$message.error('退货数量不能大于收货数量');
-          callback(new Error('退货数量不能大于收货数量'));
-        } else {
-          callback();
-        }
-      };
-    },
-    // else if (this.getTotalCount(row)> row.warehouseNum) {
-    //       this.$message.error('退货数量不能大于库存');
-    //       callback(new Error('退货数量不能大于库存'));
-    //     }
-    getTotalCount(row) {
-      let num = 0;
-      this.form.datasource
-        .filter((item) => item.warehouseId == row.warehouseId)
-        .forEach((item) => {
-          num += Number(item.totalCount);
+        return num;
+      },
+      // 返回列表数据
+      getTableValue() {
+        let comitDatasource = this.form.datasource;
+        if (comitDatasource.length === 0) return [];
+        comitDatasource.forEach((v) => {
+          v.totalCount = Number(v.totalCount);
+          v.technicalDrawings = Array.isArray(v.technicalDrawings)
+            ? v.technicalDrawings
+            : [];
         });
+        return comitDatasource;
+      },
+      getPrice() {
+        return [this.allPrice];
+      },
 
-      return num;
-    },
-    // 返回列表数据
-    getTableValue() {
-      let comitDatasource = this.form.datasource;
-      if (comitDatasource.length === 0) return [];
-      comitDatasource.forEach((v) => {
-        v.totalCount = Number(v.totalCount);
-        v.technicalDrawings = Array.isArray(v.technicalDrawings)
-          ? v.technicalDrawings
-          : [];
-      });
-      return comitDatasource;
-    },
-    getPrice() {
-      return [this.allPrice];
-    },
+      //修改回显
+      putTableValue(data) {
+        if (data && data?.length) {
+          data.forEach((v, index) => {
+            v.receiveTotalCount = v.receiveTotalCount || v.totalCount;
+            v.receiveProductId = v.receiveProductId || v.id;
+          });
+          this.oldSendTotalWeightList = data.map((item) => {
+            return {
+              productCode: item.productCode,
+              oldSendTotalWeight: item.sendTotalWeight,
+              oldReceiveTotalWeight: item.receiveTotalWeight
+            };
+          });
+          this.form.datasource = data;
+          this.form.datasource.forEach(async (v, index) => {
+            if (v.warehouseId) {
+              this.$set(
+                this.form.datasource[index],
+                'warehouseNum',
+                await getWarehouseOutStock({
+                  warehouseId: v.warehouseId,
+                  code: v.productCode
+                })
+              );
+            }
+          });
+          this.gettotalAmount();
+        }
+      },
 
-    //修改回显
-    putTableValue(data) {
-      if (data && data?.length) {
-        data.forEach((v, index) => {
-          v.receiveTotalCount = v.receiveTotalCount || v.totalCount;
-          v.receiveProductId = v.receiveProductId || v.id;
-        });
-        this.oldSendTotalWeightList = data.map(item => {
-          return {
-            productCode: item.productCode,
-            oldSendTotalWeight: item.sendTotalWeight,
-            oldReceiveTotalWeight: item.receiveTotalWeight
-          }
-        })
-        this.form.datasource = data;
-        this.form.datasource.forEach(async (v, index) => {
-          if (v.warehouseId) {
-            this.$set(
-              this.form.datasource[index],
-              'warehouseNum',
-              await getWarehouseOutStock({
-                warehouseId: v.warehouseId,
-                code: v.productCode
-              })
-            );
-          }
+      remove(row) {
+        let index = this.form.datasource.findIndex((n) => n.key == row.key);
+        if (index !== -1) {
+          this.form.datasource.splice(index, 1);
+          this.setSort();
+          this.gettotalAmount();
+        }
+      },
+      // 清空表格
+      restTable() {
+        this.form.datasource = [];
+      },
+      // 重新排序
+      setSort() {
+        this.form.datasource.forEach((n, index) => {
+          n.key = index + 1;
         });
-        this.gettotalAmount();
-      }
-    },
+      },
+      // 添加
+      handlAdd() {
+        if (!this.receiveId) return this.$message.error('请先选择收货单');
+        this.$refs.productListRef.open(this.form.datasource);
+      },
 
-    remove(row) {
-      let index = this.form.datasource.findIndex((n) => n.key == row.key);
-      if (index !== -1) {
-        this.form.datasource.splice(index, 1);
-        this.setSort();
-        this.gettotalAmount();
+      validateForm(callback) {
+        //开始表单校验
+        this.$refs.form.validate((valid) => {
+          callback(valid);
+        });
       }
-    },
-    // 清空表格
-    restTable() {
-      this.form.datasource = [];
-    },
-    // 重新排序
-    setSort() {
-      this.form.datasource.forEach((n, index) => {
-        n.key = index + 1;
-      });
-    },
-    // 添加
-    handlAdd() {
-      if (!this.receiveId) 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;
+  .headbox {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
-    padding-right: 30px;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      padding-right: 30px;
+    }
   }
-}
 
-.time-form .el-form-item {
-  margin-bottom: 0 !important;
-}
+  .time-form .el-form-item {
+    margin-bottom: 0 !important;
+  }
 
-::v-deep .period {
-  display: flex;
+  ::v-deep .period {
+    display: flex;
 
-  .borderleftnone {
-    .el-input--medium .el-input__inner {
-      border-top-right-radius: 0;
-      border-bottom-right-radius: 0;
+    .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;
+    .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 tbody > tr:hover > td {
+    background-color: transparent !important;
+  }
 
-::v-deep .time-form .el-table tr {
-  background-color: #ffffff;
-}
+  ::v-deep .time-form .el-table tr {
+    background-color: #ffffff;
+  }
 
-.pricebox {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
-  font-weight: bold;
-}
+  .pricebox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+    font-weight: bold;
+  }
 </style>

+ 202 - 179
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/submit.vue

@@ -2,29 +2,54 @@
   <el-col :span="16" :offset="6">
     <el-form label-width="100px" ref="formRef" :model="form" :rules="rules">
       <el-form-item label="审批建议" prop="reason" style="margin-bottom: 20px">
-        <el-input type="textarea" v-model="form.reason" placeholder="请输入审批建议" />
+        <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" v-if="
-        taskDefinitionKey != 'storemanApprove' ||
-        (taskDefinitionKey == 'storemanApprove' &&
-          outInData.verifyStatus == 2)
-      " @click="handleAudit(1)">通过
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        v-if="
+          taskDefinitionKey != 'storemanApprove' ||
+          (taskDefinitionKey == 'storemanApprove' &&
+            outInData.verifyStatus == 2)
+        "
+        @click="handleAudit(1)"
+        >通过
       </el-button>
-      <el-button icon="el-icon-edit-outline" type="success" size="mini" :loading="isSaveLoading"
-        @click="storemanApprove" v-if="
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="storemanApprove"
+        v-if="
           ['storemanApprove'].includes(taskDefinitionKey) &&
-          activeComp == 'outBound' &&
           ([0, 3].includes(outInData.verifyStatus) || !outInData.verifyStatus)
-        ">申请出库
+        "
+        >申请出库
       </el-button>
-      <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleAudit(0)"
-        v-if="['storemanApprove'].includes(taskDefinitionKey)">驳回
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleAudit(0)"
+        v-if="['storemanApprove'].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
+        @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>
@@ -58,190 +83,188 @@
 </template>
 
 <script>
-import {
-  UpdateReturnInformation,
-  uploadReceipt,
-  cancel
-} from '@/api/bpm/components/purchasingManage/returnGoods';
-import { approveTaskWithVariables, rejectTask } from '@/api/bpm/task';
-import { getReturnSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/returnGoods';
-import { getOutInBySourceBizNo } from '@/api/classifyManage';
-import storageApi from '@/api/warehouseManagement';
-// 流程实例的详情页,可用于审批
-export default {
-  name: '',
-  components: {
-    //   Parser
-  },
-  props: {
-    businessId: {
-      default: ''
-    },
-    taskId: {
-      default: ''
+  import {
+    UpdateReturnInformation,
+    uploadReceipt,
+    cancel
+  } from '@/api/bpm/components/purchasingManage/returnGoods';
+  import { approveTaskWithVariables, rejectTask } from '@/api/bpm/task';
+  import { getReturnSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/returnGoods';
+  import { getOutInBySourceBizNo } from '@/api/classifyManage';
+  import storageApi from '@/api/warehouseManagement';
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    components: {
+      //   Parser
     },
-    id: {
-      default: ''
-    },
-    id: {
-      default: ''
-    },
-    taskDefinitionKey: {
-      default: ''
-    }
-  },
-  data() {
-    return {
-      isSaveLoading: false,
-      form: {
-        technicianId: '',
-        reason: ''
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
       },
-      activeComp: '',
-      outInData: {
-        verifyStatus: ''
+      id: {
+        default: ''
       },
-      rules: {
-        reason: [
-          { required: true, message: '请输入审批建议', trigger: 'blur' },
-        ],
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
       }
-    };
-  },
-  async created() {
-    if (this.taskDefinitionKey == 'storemanApprove') {
-      let data = await getReturnSaleOrderrecordDetail(this.businessId);
-      try {
-        this.outInData = await getOutInBySourceBizNo(data.returnNo);
-      } catch (error) {
-        this.outInData.verifyStatus = 0;
+    },
+    data() {
+      return {
+        isSaveLoading: false,
+        form: {
+          technicianId: '',
+          reason: ''
+        },
+        activeComp: '',
+        outInData: {
+          verifyStatus: ''
+        },
+        rules: {
+          reason: [
+            { required: true, message: '请输入审批建议', trigger: 'blur' }
+          ]
+        }
+      };
+    },
+    async created() {
+      if (this.taskDefinitionKey == 'storemanApprove') {
+        let data = await getReturnSaleOrderrecordDetail(this.businessId);
+        try {
+          this.outInData = await getOutInBySourceBizNo(data.returnNo);
+        } catch (error) {
+          this.outInData.verifyStatus = 0;
+        }
       }
-    }
-  },
-  methods: {
-    async storemanApprove() {
-      this.$refs.formRef.validate(async (valid) => {
-        if (valid) {
-          let res = await this.getTableValue();
-          console.log(res, 'resresresresres12')
-          let storageData = res.returnStorageData;
+    },
+    methods: {
+      async storemanApprove() {
+        this.$refs.formRef.validate(async (valid) => {
+          if (valid) {
+            let res = await this.getTableValue();
+            console.log(res, 'resresresresres12');
+            let storageData = res.returnStorageData;
 
-          // 出库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
-          storageData.isSkip = 1;
-          try {
-            this.isSaveLoading = true;
+            // 出库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
+            storageData.isSkip = 1;
+            try {
+              this.isSaveLoading = true;
 
-            await storageApi.outStorage(storageData);
-            approveTaskWithVariables({
-              id: this.taskId,
-              reason: this.form.reason,
-              variables: {
-                pass: true
-              }
-            }).then((res) => {
-              if (res.code != '-1') {
-                this.$emit('handleAudit', {
-                  status: 1,
-                  title: '出库'
-                });
-              }
+              await storageApi.outStorage(storageData);
+              approveTaskWithVariables({
+                id: this.taskId,
+                reason: this.form.reason,
+                variables: {
+                  pass: true
+                }
+              }).then((res) => {
+                if (res.code != '-1') {
+                  this.$emit('handleAudit', {
+                    status: 1,
+                    title: '出库'
+                  });
+                }
+                this.isSaveLoading = false;
+              });
+            } catch (error) {
               this.isSaveLoading = false;
-            });
-          } catch (error) {
-            this.isSaveLoading = false;
-            console.error('保存失败:', error);
+              console.error('保存失败:', error);
+            }
+          }
+        });
+      },
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+      activeCompChange(activeComp) {
+        console.log(activeComp, 'activeComp');
+        this.activeComp = activeComp;
+      },
+      async handleAudit(status) {
+        //发起人补充
+        if (this.taskDefinitionKey === 'starter') {
+          let arr = await this.getTableValue();
+          if (!arr) {
+            return;
           }
-        }
-
-      })
 
-    },
-    /** 处理转办审批人 */
-    handleUpdateAssignee() {
-      this.$emit('handleUpdateAssignee');
-    },
-    /** 退回 */
-    handleBackList() {
-      this.$emit('handleBackList');
-    },
-    activeCompChange(activeComp) {
-      console.log(activeComp, 'activeComp')
-      this.activeComp = activeComp;
-    },
-    async handleAudit(status) {
-      //发起人补充
-      if (this.taskDefinitionKey === 'starter') {
-        let arr = await this.getTableValue();
-        if (!arr) {
-          return;
+          await UpdateReturnInformation(arr);
         }
-
-        await UpdateReturnInformation(arr);
-      }
-      if (this.taskDefinitionKey === 'purchaserUploadReceipt') {
-        let data = await this.getTableValue();
-        if (data.repliedFiles.length == 0) {
-          this.$message.error('回执附件不能为空');
-          return;
+        if (this.taskDefinitionKey === 'purchaserUploadReceipt') {
+          let data = await this.getTableValue();
+          if (data.repliedFiles.length == 0) {
+            this.$message.error('回执附件不能为空');
+            return;
+          }
+          await uploadReceipt(data);
         }
-        await uploadReceipt(data);
-      }
-      this._approveTaskWithVariables(status);
-    },
-    async _approveTaskWithVariables(status) {
-      let variables = {
-        pass: !!status
-      };
+        this._approveTaskWithVariables(status);
+      },
+      async _approveTaskWithVariables(status) {
+        let variables = {
+          pass: !!status
+        };
 
-      let API = !!status ? approveTaskWithVariables : rejectTask;
-      API({
-        id: this.taskId,
-        reason: this.form.reason,
-        variables
-      }).then((res) => {
-        if (res.data.code != '-1') {
-          this.$emit('handleAudit', {
-            status,
-            title: status === 0 ? '驳回' : ''
-          });
-        }
-      });
-    },
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          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);
+      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('流程作废失败');
-              });
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
           })
-          .catch(() => { });
+            .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>

+ 174 - 164
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div class="switch">
+    <!-- <div class="switch">
       <div class="switch_left">
         <ul>
           <li
@@ -13,172 +13,170 @@
           </li>
         </ul>
       </div>
-    </div>
-    <div v-show="activeComp == 'main'">
-      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <headerTitle title="发货信息"></headerTitle>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item
-              label="客户名称:"
-              prop="contactName"
-              style="margin-bottom: 16px"
-            >
-              {{ form.contactName }}
-            </el-form-item>
-            <el-form-item
-              label="客户联系人:"
-              prop="linkName"
-              style="margin-bottom: 16px"
-            >
-              {{ form.linkName }}
-            </el-form-item>
-            <el-form-item
-              label="客户电话:"
-              prop="linkPhone"
-              style="margin-bottom: 16px"
-            >
-              {{ form.linkPhone }}
-            </el-form-item>
+    </div> -->
+    <!-- <div v-show="activeComp == 'main'"> -->
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+      <div class="title"> 发货单信息</div>
 
-            <el-form-item
-              label="客户地址:"
-              prop="partaAddress"
-              style="margin-bottom: 16px"
-            >
-              {{ form.receiveAddress }}
-            </el-form-item>
-            <el-form-item
-              label="发货附件:"
-              prop="sendFiles"
-              style="margin-bottom: 16px"
-            >
-              <fileMain v-model="detailData.sendFiles" type="view"></fileMain>
-            
-            </el-form-item>
-            <el-form-item
-              label="回执附件:"
-              prop="sendFiles"
-              style="margin-bottom: 16px"
-            >
-              <fileMain
-                v-model="detailData.repliedFiles"
-                type="view"
-              ></fileMain>
-             
-            </el-form-item>
-            <el-form-item label="计价方式:" style="margin-bottom: 22px">
-              {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
-            </el-form-item>
-          </el-col>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item
+            label="客户名称:"
+            prop="contactName"
+            style="margin-bottom: 5px"
+          >
+            {{ form.contactName }}
+          </el-form-item>
+          <el-form-item
+            label="客户联系人:"
+            prop="linkName"
+            style="margin-bottom: 5px"
+          >
+            {{ form.linkName }}
+          </el-form-item>
+          <el-form-item
+            label="客户电话:"
+            prop="linkPhone"
+            style="margin-bottom: 5px"
+          >
+            {{ form.linkPhone }}
+          </el-form-item>
 
-          <el-col :span="12">
-            <el-form-item
-              label="车牌号:"
-              prop="carNo"
-              style="margin-bottom: 16px"
-            >
-              {{ form.carNo }}
-            </el-form-item>
-            <el-form-item
-              label="发货单据编码:"
-              prop="docNo"
-              style="margin-bottom: 16px"
-            >
-              {{ form.docNo }}
-            </el-form-item>
-            <el-form-item
-              label="制单人:"
-              prop="makerName"
-              style="margin-bottom: 16px"
-            >
-              {{ form.makerName }}
-            </el-form-item>
-            <el-form-item prop="orderNo" label="订单编码:">
-              {{ form.orderNo }}
-            </el-form-item>
-            <el-form-item prop="replied" label="是否回执:">
-              {{ form.replied == 1 ? '是' : '否' }}
-            </el-form-item>
+          <el-form-item
+            label="客户地址:"
+            prop="partaAddress"
+            style="margin-bottom: 5px"
+          >
+            {{ form.receiveAddress }}
+          </el-form-item>
+        </el-col>
 
-            <el-form-item
-              label="审核状态:"
-              prop="reviewStatus"
-              style="margin-bottom: 16px"
-            >
-              {{ reviewStatusEnum[form.reviewStatus]?.label }}
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
+        <el-col :span="8">
+          <el-form-item
+            label="车牌号:"
+            prop="carNo"
+            style="margin-bottom: 5px"
+          >
+            {{ form.carNo }}
+          </el-form-item>
+          <el-form-item
+            label="发货单据编码:"
+            prop="docNo"
+            style="margin-bottom: 5px"
+          >
+            {{ form.docNo }}
+          </el-form-item>
+          <el-form-item
+            label="制单人:"
+            prop="makerName"
+            style="margin-bottom: 5px"
+          >
+            {{ form.makerName }}
+          </el-form-item>
+          <el-form-item prop="orderNo" label="订单编码:">
+            {{ form.orderNo }}
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item prop="replied" label="是否回执:">
+            {{ form.replied == 1 ? '是' : '否' }}
+          </el-form-item>
 
-      <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:stockLedger="scope">
-          <el-popover placement="right" width="60%" trigger="hover">
-            <ele-pro-table
-              :ref="'childrenTable' + scope.$index"
-              row-key="id"
-              max-height="300px"
-              :needPage="false"
-              :columns="childrenColumns"
-              :toolkit="[]"
-              :datasource="scope.row.sendProductDetail"
-              cache-key="stockLedgerRoleTable"
-              class="time-form"
-            >
-            </ele-pro-table>
-            <el-button type="text" slot="reference">明细</el-button>
-          </el-popover>
-        </template>
-        <template v-slot:industryArtFiles="{ row, $index }">
           <el-form-item
-            style="margin-bottom: 20px"
-            :prop="'datasource.' + $index + '.industryArtFiles'"
+            label="审核状态:"
+            prop="reviewStatus"
+            style="margin-bottom: 5px"
           >
-            <fileMain v-model="row.industryArtFiles" type="view"></fileMain>
-         
+            {{ reviewStatusEnum[form.reviewStatus]?.label }}
           </el-form-item>
-        </template>
-        <template v-slot:otherFiles="{ row, $index }">
           <el-form-item
-            style="margin-bottom: 20px"
-            :prop="'datasource.' + $index + '.otherFiles'"
+            label="发货附件:"
+            prop="sendFiles"
+            style="margin-bottom: 5px"
           >
-            <fileMain v-model="row.otherFiles" type="view"></fileMain>
-           
+            <fileMain v-model="detailData.sendFiles" type="view"></fileMain>
           </el-form-item>
-        </template>
-        <template v-slot:technicalDrawings="{ row }">
-          <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
-       
-        </template>
-      </ele-pro-table>
-    </div>
+          <el-form-item
+            label="回执附件:"
+            prop="sendFiles"
+            style="margin-bottom: 5px"
+          >
+            <fileMain v-model="detailData.repliedFiles" type="view"></fileMain>
+          </el-form-item>
+        </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:stockLedger="scope">
+        <el-popover placement="right" width="60%" trigger="hover">
+          <ele-pro-table
+            :ref="'childrenTable' + scope.$index"
+            row-key="id"
+            max-height="300px"
+            :needPage="false"
+            :columns="childrenColumns"
+            :toolkit="[]"
+            :datasource="scope.row.sendProductDetail"
+            cache-key="stockLedgerRoleTable"
+            class="time-form"
+          >
+          </ele-pro-table>
+          <el-button type="text" slot="reference">明细</el-button>
+        </el-popover>
+      </template>
+      <template v-slot:industryArtFiles="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.industryArtFiles'"
+        >
+          <fileMain v-model="row.industryArtFiles" type="view"></fileMain>
+        </el-form-item>
+      </template>
+      <template v-slot:otherFiles="{ row, $index }">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + $index + '.otherFiles'"
+        >
+          <fileMain v-model="row.otherFiles" type="view"></fileMain>
+        </el-form-item>
+      </template>
+      <template v-slot:technicalDrawings="{ row }">
+        <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
+      </template>
+    </ele-pro-table>
+    <!-- </div> -->
     <keep-alive>
       <add
         ref="add"
-        v-if="activeComp == 'outBound'"
         :form="form"
         :sourceBizNo="form.docNo"
         :bizType="3"
         :saleProductList="form.productList"
         type="销售发货出库"
+        v-if="!isView"
       ></add>
     </keep-alive>
+    <detailDialog
+      type="sourceBizNo"
+      :businessId="form.returnNo"
+      ref="outgoingDetai"
+      v-if="isView"
+    ></detailDialog>
   </div>
 </template>
 
@@ -193,13 +191,14 @@
   import { copyObj } from '@/utils/util';
   import add from '@/views/bpm/outgoingManagement/outbound.vue';
   import fileMain from '@/components/addDoc/index.vue';
-  import {lbjtList } from '@/enum/dict.js';
+  import { lbjtList } from '@/enum/dict.js';
+  import detailDialog from '@/views/bpm/outgoingManagement/details.vue';
 
   export default {
     mixins: [dictMixins],
     components: {
       fileMain,
-      add
+      add,detailDialog
     },
     data() {
       return {
@@ -244,7 +243,7 @@
           }
         ],
         competAnalysisListcolumns: [
-        {
+          {
             width: 45,
             type: 'index',
             columnKey: 'index',
@@ -313,12 +312,13 @@
             align: 'center',
             label: '属性类型',
             formatter: (row, column) => {
-              if(row.produceType){
-                return row.produceType.map(item=>{
-                  return lbjtList[item]
-                }).toString()
+              if (row.produceType) {
+                return row.produceType
+                  .map((item) => {
+                    return lbjtList[item];
+                  })
+                  .toString();
               }
-          
             },
             showOverflowTooltip: true
           },
@@ -431,8 +431,11 @@
             slot: 'pricingWay',
             align: 'center',
             formatter: (row, column) => {
-              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
-
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
             }
           },
           {
@@ -447,9 +450,7 @@
             prop: 'taxRate',
             label: '税率',
             formatter: (_row, _column, cellValue) => {
-              return _row.taxRate
-                ? _row.taxRate+'%'
-                : '';
+              return _row.taxRate ? _row.taxRate + '%' : '';
             },
             align: 'center'
           },
@@ -515,10 +516,9 @@
             minWidth: 200,
             showOverflowTooltip: true,
             formatter: (row, column) => {
-       
               return row.provenance && row.provenance.length
                 ? row.provenance
-                    .map((item) => this.getDictValue('产地', item ))
+                    .map((item) => this.getDictValue('产地', item))
                     .join(',')
                 : '';
             }
@@ -550,7 +550,7 @@
             label: '备注',
             slot: 'remark',
             align: 'center'
-          },
+          }
         ]
       };
     },
@@ -558,7 +558,8 @@
       businessId: {
         default: ''
       },
-      taskDefinitionKey: {}
+      taskDefinitionKey: {},
+      isView: ''
     },
     async created() {
       await this.getDetailData(this.businessId);
@@ -620,6 +621,10 @@
           data.categoryLevelTopId = data.topCategoryIds;
           this.form = data;
           this.detailData = data;
+          this.$nextTick(() => {
+            this.$refs.add?.initFormData();
+            this.$refs.outgoingDetai?._getInfo(data.docNo);
+          });
         }
       }
     }
@@ -627,6 +632,11 @@
 </script>
 
 <style scoped lang="scss">
+  .title {
+    font-size: 22px;
+    font-weight: 800;
+    margin-top: 15px;
+  }
   .ele-dialog-form {
     .el-form-item {
       margin-bottom: 10px;

+ 3 - 27
src/views/bpm/handleTask/components/saleOrder/invoiceConfirm/detailDialog.vue

@@ -54,42 +54,18 @@
               style="margin-bottom: 16px"
             >
               <fileMain v-model="detailData.sendFiles" type="view"></fileMain>
-              <!--              <div v-if="detailData.sendFiles && detailData.sendFiles?.length">-->
-              <!--                <el-link-->
-              <!--                  v-for="link in detailData.sendFiles"-->
-              <!--                  :key="link.id"-->
-              <!--                  type="primary"-->
-              <!--                  :underline="false"-->
-              <!--                  @click="downloadFile(link)"-->
-              <!--                >-->
-              <!--                  {{ link.name }}</el-link-->
-              <!--                >-->
-              <!--              </div>-->
+
             </el-form-item>
             <el-form-item
               label="回执附件:"
-              prop="sendFiles"
+              prop="repliedFiles"
               style="margin-bottom: 16px"
             >
               <fileMain
                 v-model="detailData.repliedFiles"
                 type="view"
               ></fileMain>
-              <!--              <div-->
-              <!--                v-if="-->
-              <!--                  detailData.repliedFiles && detailData.repliedFiles?.length-->
-              <!--                "-->
-              <!--              >-->
-              <!--                <el-link-->
-              <!--                  v-for="link in detailData.repliedFiles"-->
-              <!--                  :key="link.id"-->
-              <!--                  type="primary"-->
-              <!--                  :underline="false"-->
-              <!--                  @click="downloadFile(link)"-->
-              <!--                >-->
-              <!--                  {{ link.name }}</el-link-->
-              <!--                >-->
-              <!--              </div>-->
+
             </el-form-item>
             <!-- <el-form-item label="计价方式:" style="margin-bottom: 22px">
               {{ form.pricingWay == 1 ? '按数量计费' : '按重量计费' }}

+ 1 - 1
src/views/bpm/outgoingManagement/outbound.vue

@@ -663,7 +663,7 @@ export default {
       // this.formData.createUserId = this.user.info.userId;
 
       this.formData.extInfo.assetType = Array.from(
-        new Set(this.form.categoryLevelTopId.split(','))
+        new Set(this.form.categoryLevelTopId?.split(','))
       );
 
       //委外出库