Quellcode durchsuchen

【修改】发货申请单

莫绍宝 vor 3 Jahren
Ursprung
Commit
73d73ce704

+ 1 - 1
src/api/supply/engin.js

@@ -84,7 +84,7 @@ export function submitEngin(params) {
 // 申请
 export function applyEngin(params) {
   return request({
-    url: '/engin-info-order/apply',
+    url: '/engin-info-order/submit-on-list',
     method: 'post',
     params
   })

+ 42 - 0
src/styles/index.scss

@@ -269,6 +269,48 @@ div:focus {
   .item {
     display: flex;
     border-bottom: 1px solid #EBEEF5;
+    &.file {
+      .label {
+        height: 100px;
+      }
+      .value {
+        height: 100px;
+      }
+      .file-list {
+        display: flex;
+        .file-item {
+          // margin-top: 10px;
+          margin-right: 10px;
+        }
+      }
+      .img {
+        width: 70px;
+        height: 70px;
+        display: block;
+        border: 1px solid #e4e7ed;
+      }
+      .box2 {
+        flex: 1;
+        display: flex;
+        padding: 10px;
+        align-items: center;
+        border: 1px solid #e4e7ed;
+        width: 240px;
+        height: 70px;
+        cursor: pointer;
+        img {
+          width: 40px;
+          height: 40px;
+          display: block;
+        }
+        .name {
+          flex: 1;
+          color: #222;
+          font-weight: 600;
+          margin-left: 10px;
+        }
+      }
+    }
     .label {
       width: 120px;
       height: 40px;

+ 15 - 14
src/views/supply/apply/apply_list.vue

@@ -92,21 +92,21 @@
             <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核状态" prop="status" min-width="100" show-overflow-tooltip>
+            <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{scope.row.status | statusFilter}}
+                {{scope.row.examineStatus | statusFilter}}
               </template>
             </el-table-column>
             <el-table-column align="center" label="操作" width="180" fixed="right">
               <template slot-scope="scope">
-                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id, 2)" v-if="scope.row.status === 1" >
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id, 'WAIT')" v-if="scope.row.examineStatus === 'SAVE'" >
                   <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
-                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleSubmit(scope.row.id, 1)" v-if="scope.row.status === 2" >
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleSubmit(scope.row.id, 'SAVE')" v-if="scope.row.examineStatus === 'WAIT'" >
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
-                <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.status === 1">编辑</el-button>
-                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.status === 2">审单</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审单</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" >
                   <el-button slot="reference" type="text">删除</el-button>
@@ -175,10 +175,11 @@ export default {
         status: '',
       },
       statusList: [
-        { label: '已保存', value: 1 },
-        { label: '待审核', value: 2 },
-        { label: '审核通过', value: 3 },
-        { label: '审核驳回', value: 4 },
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
       ],
 
       queryItem: {},
@@ -199,7 +200,7 @@ export default {
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: this.screenForm.status,
+        examineStatus: this.screenForm.status,
       }
     },
   },
@@ -237,7 +238,7 @@ export default {
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: this.screenForm.status,
+        examineStatus: this.screenForm.status,
       };
       getApplyList(params).then((res) => {
         this.dataList = res.data.records;
@@ -305,8 +306,8 @@ export default {
     },
 
     // 申请/撤回
-    handleSubmit(id, status) {
-      submitApply({id, status}).then(res => {
+    handleSubmit(id, examineStatus) {
+      submitApply({id, examineStatus}).then(res => {
         this.$successMsg();
         this.getList();
       })

+ 142 - 105
src/views/supply/apply/components/apply_detail.vue

@@ -2,56 +2,118 @@
   <div class="detail-container">
     <el-page-header @back="goBack" content="详情"></el-page-header>
 
-    <div id="printData">
+    <div class="main-title">
+      <div class="title">发货申请单信息</div>
+    </div>
+
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">发货申请单号</div>
+          <div class="value">{{detailData.id}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">申请日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{detailData.customerNumber}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">仓库</div>
+          <div class="value">{{detailData.correspondName}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
+        <el-col :span="24" class="item file">
+          <div class="label">附件</div>
+          <div class="value">
+            <div class="file-list">
+              <div class="file-item">
+                <el-image v-if="checkFileType(detailData.fileUrl) == 'image'" class="img" :src="imageURL + detailData.fileUrl" :preview-src-list="[imageURL + detailData.fileUrl]"></el-image>
+                <div v-else class="box2" @click="openLink(detailData.fileUrl)">
+                  <img src="@/assets/common/word.png" v-if="checkFileType(detailData.fileUrl) == 'word'" />
+                  <img src="@/assets/common/excel.png" v-if="checkFileType(detailData.fileUrl) == 'excel'" />
+                  <img src="@/assets/common/ppt.png" v-if="checkFileType(detailData.fileUrl) == 'ppt'" />
+                  <img src="@/assets/common/pdf.png" v-if="checkFileType(detailData.fileUrl) == 'pdf'" />
+                  <div class="name ellipsis-3">{{ detailData.fileName }}</div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单人</div>
+          <div class="value">{{detailData.createBy}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核人</div>
+          <div class="value">{{detailData.approvalName}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核日期</div>
+          <div class="value">{{detailData.approvalTime}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value">{{detailData.approvalRemark}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+    </div>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="申请数量" prop="invoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </div>
+
+    <div v-if="isExamine">
       <div class="main-title">
-        <div class="title">发货申请单信息</div>
+        <div class="title">审批记录</div>
       </div>
-
       <div class="diy-table-1">
-        <el-row>
-          <el-col :span="8" class="item">
-            <div class="label">发货申请单号</div>
-            <div class="value">{{detailData.id}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">申请日期</div>
-            <div class="value">{{detailData.createTime}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">单据状态</div>
-            <div class="value">{{detailData.status | statusFilter}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">经销商编号</div>
-            <div class="value">{{detailData.customerNumber}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">经销商名称</div>
-            <div class="value">{{detailData.customerName}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">仓库</div>
-            <div class="value">{{detailData.correspondName}}</div>
-          </el-col>
-          <el-col :span="24" class="item">
-            <div class="label">备注</div>
-            <div class="value">{{detailData.remark}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">制单人</div>
-            <div class="value">{{detailData.createBy}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">制单日期</div>
-            <div class="value">{{detailData.createTime}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">审核人</div>
+        <el-row :gutter="0">
+          <el-col :span="12" class="item">
+            <div class="label">审批人</div>
             <div class="value">{{detailData.approvalName}}</div>
           </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">审核日期</div>
-            <div class="value">{{detailData.approvalTime}}</div>
+          <el-col :span="12" class="item">
+            <div class="label">审批结果</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">审批说明</div>
@@ -59,54 +121,6 @@
           </el-col>
         </el-row>
       </div>
-
-      <div class="main-title">
-        <div class="title">货品信息</div>
-      </div>
-
-      <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="申请数量" prop="invoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
-        </el-table>
-      </div>
-
-      <div v-if="isExamine">
-        <div class="main-title">
-          <div class="title">审批记录</div>
-        </div>
-        <div class="diy-table-1">
-          <el-row :gutter="0">
-            <el-col :span="12" class="item">
-              <div class="label">审批人</div>
-              <div class="value">{{detailData.approvalName}}</div>
-            </el-col>
-            <el-col :span="12" class="item">
-              <div class="label">审批结果</div>
-              <div class="value">{{detailData.status | statusFilter}}</div>
-            </el-col>
-            <el-col :span="24" class="item">
-              <div class="label">审批说明</div>
-              <div class="value">{{detailData.approvalRemark}}</div>
-            </el-col>
-          </el-row>
-        </div>
-      </div>
-      
     </div>
     
     <div class="page-footer">
@@ -185,23 +199,21 @@
 </template>
 
 <script>
-import print from 'vue-print-nb'
 import { getApplyDetail } from "@/api/supply/apply";
+import { getFileUrl } from '@/api/common';
 
 export default {
   name: 'ApplyDetail',
   componentName: 'ApplyDetail',
   props: ['listItem'],
-  directives: {
-    print
-  },
   filters: {
     statusFilter(val) {
       const statusList = [
-        { label: '已保存', value: 1 },
-        { label: '待审核', value: 2 },
-        { label: '审核通过', value: 3 },
-        { label: '审核驳回', value: 4 },
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
       ];
       let obj = statusList.find(o => o.value == val);
       return obj ? obj.label : ''
@@ -209,9 +221,7 @@ export default {
   },
   data() {
     return {
-      printObj: {
-        id: 'printData'
-      },
+      imageURL: this.$imageUrl,
       detailData: {},
 
       isShowDeliverDialog: false,
@@ -234,7 +244,7 @@ export default {
       }
     },
     isExamine() {
-      return this.detailData.status === 3 || this.detailData.status === 4
+      return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === "FAIL"
     },
   },
 
@@ -255,6 +265,33 @@ export default {
       })
     },
 
+    // 检查文件类型
+    checkFileType(url) {
+      if(!url) return '';
+			const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
+
+			if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
+				return 'image';
+			}else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
+				return 'word';
+			}else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
+				return 'excel';
+			}else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
+				return 'ppt';
+			}else if(['pdf'].includes(fileSuffix)) {
+				return 'pdf';
+			}else {
+        return '';
+      }
+		},
+
+    // 打开链接
+    openLink(url) {
+      getFileUrl({key: url}).then(res => {
+        window.open(res.data);
+      })
+    },
+
     // 打开 直调发货
     openDeliverDialog() {
       this.isShowDeliverDialog = true;

+ 7 - 6
src/views/supply/apply/components/apply_examine.vue

@@ -18,7 +18,7 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-          <div class="value">{{detailData.status | statusFilter}}</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商编号</div>
@@ -137,10 +137,11 @@ export default {
   filters: {
     statusFilter(val) {
       const statusList = [
-        { label: '已保存', value: 1 },
-        { label: '待审核', value: 2 },
-        { label: '审核通过', value: 3 },
-        { label: '审核驳回', value: 4 },
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
       ];
       let obj = statusList.find(o => o.value == val);
       return obj ? obj.label : ''
@@ -248,7 +249,7 @@ export default {
       this.formLoading = true;
       examineApply({
         id: this.listItem.id,
-        status: this.examineForm.status ? 3 : 4,
+        examineStatus: this.examineForm.status ? 'OK' : 'FAIL',
         approvalRemark: this.examineForm.remark,
         orders: this.goodsList
       }).then(res => {

+ 29 - 39
src/views/supply/apply/components/apply_form.vue

@@ -8,9 +8,9 @@
 
     <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="90px" size="small" label-position="right">
       <el-row :gutter="20">
-        <el-col :xs="24" :sm="12" :lg="8" v-if="listItem">
+        <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="订单号" prop="id">
-            <el-input v-model="listItem.id" readonly></el-input>
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
@@ -24,23 +24,23 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="12" :lg="8" v-if="listItem">
-          <el-form-item label="制单人" prop="serviceName">
-            <el-input v-model="listItem.serviceName" readonly></el-input>
-          </el-form-item>
-        </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="经销商" prop="dealer">
-            <el-select v-model="mainForm.dealer" placeholder="请选择经销商" style="width: 100%;">
-              <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
-            </el-select>
+          <el-form-item label="制单人" prop="createMan">
+            <el-input v-model="mainForm.createMan" readonly></el-input>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="24" :lg="24">
+        <el-col :xs="24" :sm="24" :lg="16">
           <el-form-item label="备注" prop="remark">
             <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
           </el-form-item>
         </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="经销商" prop="jxsNum">
+            <el-select v-model="mainForm.jxsNum" placeholder="请选择经销商" style="width: 100%;" disabled>
+              <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
         <el-col :xs="24" :sm="8" :lg="8">
           <el-form-item label="附件" prop="fileUrl">
             <fileUpload :fileList="fileList" />
@@ -76,11 +76,7 @@
           </template>
         </el-table-column>
         <el-table-column align="center" label="已申请数量" prop="alreadyInvoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="未申请数量" min-width="100" show-overflow-tooltip>
-          <template slot-scope="scope">
-            {{scope.row.qty - scope.row.alreadyInvoiceNum}}
-          </template>
-        </el-table-column>
+        <el-table-column align="center" label="未申请数量" prop="refundableQty" min-width="100" show-overflow-tooltip> </el-table-column>
         <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-input v-model="scope.row.remark" size="small"></el-input>
@@ -96,7 +92,8 @@
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
+        <el-button type="primary" @click="clickSubmitForm('SAVE')">保 存</el-button>
+        <el-button type="primary" @click="clickSubmitForm('WAIT')">提交审核</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
@@ -149,21 +146,13 @@
             </template>
           </el-table-column>
           <el-table-column align="center" label="已申请数量" prop="alreadyInvoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="未申请数量" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{scope.row.qty - scope.row.alreadyInvoiceNum}}
-            </template>
-          </el-table-column>
+          <el-table-column align="center" label="未申请数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="总库存数量" prop="stockAdequate" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{scope.row.stockAdequate | stockFilter}}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="对应库存数量" prop="stockCorrespond" min-width="110" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{scope.row.stockCorrespond | stockFilter}}
-            </template>
-          </el-table-column>
+          <el-table-column align="center" label="对应库存数量" prop="stockCorrespond" min-width="110" show-overflow-tooltip></el-table-column>
         </el-table>
         <div class="pagination clearfix" style="margin-top: 10px">
           <div class="fr">
@@ -213,17 +202,16 @@ export default {
   data() {
     return {
       mainForm: {
+        orderNum: '',
         date: '',
-        dealer: '',
+        jxsNum: '',
         remark: '',
+        createMan: '',
       },
       mainFormRules: {
         date: [
           { required: true, message: '请选择单据日期', trigger: 'change' }
         ],
-        dealer: [
-          { required: true, message: '请选择经销商', trigger: 'change' }
-        ],
       },
       dealerList: [],
       fileList: [],
@@ -263,6 +251,9 @@ export default {
     this.getDealerList();
     if(this.listItem) {
       this.getDetail();
+    }else {
+      this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
+      this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
     }
   },
 
@@ -277,7 +268,8 @@ export default {
       getApplyDetail({id: this.listItem.id}).then(res => {
         let data = res.data;
         this.mainForm.date = data.orderTime;
-        this.mainForm.dealer = data.customerNumber;
+        this.mainForm.jxsNum = data.customerNumber;
+        this.mainForm.createMan = data.createBy;
         this.mainForm.remark = data.remark;
         this.screenForm.warehouse = data.correspondId;
         this.fileList = data.fileUrl ? [{
@@ -342,6 +334,7 @@ export default {
             qty: item.qty,
             invoiceNum: item.invoiceNum,
             alreadyInvoiceNum: item.alreadyInvoiceNum,
+            refundableQty: item.refundableQty,
             stockAdequate: item.stockAdequate,
             stockCorrespond: item.stockCorrespond,
           })
@@ -467,7 +460,7 @@ export default {
     },
 
     // 保存
-    clickSubmitForm() {
+    clickSubmitForm(status) {
       this.$refs.mainForm.validate((valid) => {
         if (valid) {
           for(let i=0; i<this.goodsList.length; i++) {
@@ -483,12 +476,10 @@ export default {
             }
           }
 
-          let customerName = this.dealerList[findElem(this.dealerList, 'id', this.mainForm.dealer)].name;
           let correspondName = this.warehouseList[findElem(this.warehouseList, 'id', this.screenForm.warehouse)].name;
           let params = {
+            id: this.listItem ? this.listItem.id : '',
             orderTime: this.mainForm.date + ' 00:00:00',
-            customerNumber: this.mainForm.dealer,
-            customerName,
             remark: this.mainForm.remark,
             fileUrl: this.fileList && this.fileList.length > 0 ? this.fileList[0].url : '',
             fileName: this.fileList && this.fileList.length > 0 ? this.fileList[0].name : '',
@@ -496,10 +487,9 @@ export default {
             correspondId: this.screenForm.warehouse,
             correspondName,
             orders: this.goodsList,
-            status: 1, // 1保存 2待审核 3通过 4驳回
+            examineStatus: status,
           }
           if(this.listItem) {
-            params.id = this.listItem.id;
             editApply(params).then(res => {
               this.$successMsg('编辑成功');
               this.goBack();