Kaynağa Gözat

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 3 yıl önce
ebeveyn
işleme
e106629ef5

BIN
src/assets/common/zip.jpeg


+ 13 - 8
src/components/Common/image-upload.vue

@@ -21,6 +21,7 @@
               <img v-if="checkFileType(item.url) == 'excel'" class="file" src="@/assets/common/excel.png">
               <img v-if="checkFileType(item.url) == 'ppt'" class="file" src="@/assets/common/ppt.png">
               <img v-if="checkFileType(item.url) == 'pdf'" class="file" src="@/assets/common/pdf.png">
+              <img v-if="checkFileType(item.url) == 'file'" class="file" src="@/assets/common/zip.jpeg">
             </div>
           </el-image>
           <div v-show="item.hover" class="mask">
@@ -47,7 +48,7 @@ export default {
     // 接受上传的文件类型
     fileType: {
       type: Array,
-      default: () => ['image', 'word', 'excel', 'ppt', 'pdf']
+      default: () => ['image', 'word', 'excel', 'ppt', 'pdf', 'file']
     },
 
     // 是否支持多选文件
@@ -61,8 +62,8 @@ export default {
     },
     restrictFilename: {
       type: Array,
-      default:()=>{
-        return  []
+      default: () => {
+        return []
       }
     }
 
@@ -94,7 +95,7 @@ export default {
       const excelList = ['.xls', '.xlsx', '.xlt', '.et', '.ett']
       const pptList = ['.ppt', '.pptx', '.dps', '.dpt', '.pot', '.pps']
       const pdfList = ['.pdf']
-
+      const fileList = ['.zip', '.rar', '.gz', '.apk']
       let whiteList = []
       this.fileType.includes('image') && (whiteList = whiteList.concat(imageList))
       this.fileType.includes('video') && (whiteList = whiteList.concat(videoList))
@@ -102,6 +103,7 @@ export default {
       this.fileType.includes('excel') && (whiteList = whiteList.concat(excelList))
       this.fileType.includes('ppt') && (whiteList = whiteList.concat(pptList))
       this.fileType.includes('pdf') && (whiteList = whiteList.concat(pdfList))
+      this.fileType.includes('file') && (whiteList = whiteList.concat(fileList))
       return whiteList.join(',')
     },
     previewImages() {
@@ -149,8 +151,10 @@ export default {
         return 'ppt'
       } else if (['pdf'].includes(fileSuffix)) {
         return 'pdf'
-      } else {
-        return ''
+      } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
+        return 'file'
+      } {
+        return 'pdf'
       }
     },
 
@@ -195,10 +199,11 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)'
       })
+      console.log(file)
       this.$emit('handleIsFileName', file.name)
       this.dataObj = await this.getOssConfig(file.name)
       this.waitUploadList.push(this.dataObj)
-      if (this.startRestricting) {
+      if (this.startRestricting && !['zip', 'rar', 'gz', 'apk'].includes(file.name.split('.')[1])) {
         if (!this.restrictFilename.includes(file.name.split('.')[0])) {
           this.$errorMsg('请根据固定文件名称上传:' + this.restrictFilename.join())
           loading.close()
@@ -228,7 +233,7 @@ export default {
 
         if (this.startRestricting) {
           if (this.fileList.length) {
-            for (let i = 0; i <this.fileList.length ; i++) {
+            for (let i = 0; i < this.fileList.length; i++) {
               if (this.fileList[i].name.split('.')[0] === file.name.split('.')[0]) {
                 this.fileList[i].name = this.waitUploadList[index].name
                 this.fileList[i].url = this.waitUploadList[index].key

+ 4 - 1
src/views/dashboard/index.vue

@@ -180,7 +180,7 @@
                 type="text"
                 class="textColor"
                 @click="secondFn(scope.row.rebateOrderId)"
-                >复核</el-button
+                >{{ isCustomer ? "确认" : "复核" }}</el-button
               >
             </template>
           </el-table-column>
@@ -315,6 +315,7 @@ export default {
       inDialog: false,
       detailData: [],
       rebateList: [],
+      isCustomer: JSON.parse(localStorage.getItem("supply_user")).isCustomer,
     };
   },
 
@@ -333,6 +334,8 @@ export default {
           id,
         },
       });
+
+      this.$store.commit("user/showMessage", "no");
     },
     // 确认查收
     confirmCheck(id) {

+ 45 - 14
src/views/finance/balance_sum.vue

@@ -11,24 +11,34 @@
       >
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
-            <el-form-item label="经销商名称" prop="">
-              <el-input
-                v-model="searchForm.customerName"
-                placeholder="请输入经销商名称"
-              ></el-input>
+            <el-form-item label="经销商名称" prop="customerNumber">
+              <el-select
+                v-model="searchForm.customerNumber"
+                class="selectStyle"
+                placeholder="请选择"
+                filterable
+              >
+                <el-option
+                  v-for="(v, i) in customerList"
+                  :key="i"
+                  :label="v.name"
+                  :value="v.number"
+                >
+                </el-option>
+              </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
+          <!-- <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="经销商编码" prop="">
               <el-input
                 v-model="searchForm.customerNumber"
                 placeholder="请输入"
               ></el-input>
             </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="24" :lg="12">
+          </el-col> -->
+          <el-col :xs="24" :sm="24" :lg="18">
             <el-form-item label="" class="fr">
-              <el-button size="small">清空</el-button>
+              <el-button size="small" @click="clearFn">清空</el-button>
               <el-button size="small" type="primary" @click="searchFn"
                 >搜索</el-button
               >
@@ -102,7 +112,9 @@
               <el-button
                 type="text"
                 class="textColor"
-                @click="seeFN(row.customerName, row.customerNumber,row.customerId)"
+                @click="
+                  seeFN(row.customerName, row.customerNumber, row.customerId)
+                "
               >
                 明细
               </el-button>
@@ -126,6 +138,7 @@
 </template>
 
 <script>
+import { getCustomerList } from "@/api/finance/account_list";
 import { getFinanceTotalCustomer } from "@/api/finance/blance_sum";
 export default {
   data() {
@@ -135,16 +148,30 @@ export default {
       // listTotal: 0, // 列表总数
       dataList: [], // 列表数据
       searchForm: {
-        customerName: "",
+        // customerName: "",
         customerNumber: "",
       }, //搜索表单
+      customerList: [],
       listLoading: false, // 列表加载loading
     };
   },
   created() {
     this.getDataList();
+    this.getCustomerDataList({
+      pageSize: -1,
+      pageNum: 1,
+    });
   },
   methods: {
+    //获取经销商数据
+    async getCustomerDataList(data) {
+      const res = await getCustomerList(data);
+      this.customerList = res.data.records;
+    },
+    //清除
+    clearFn() {
+      this.$refs.searchForm.resetFields();
+    },
     //搜索
     searchFn() {
       this.getDataList(this.searchForm);
@@ -165,13 +192,13 @@ export default {
       });
     },
     //明细
-    seeFN(customerName, customerNumber,customerId) {
+    seeFN(customerName, customerNumber, customerId) {
       this.$router.push({
         path: "/finance/details/standbook_list",
         query: {
           customerName,
           customerNumber,
-          customerId
+          customerId,
         },
       });
     },
@@ -179,4 +206,8 @@ export default {
 };
 </script>
 
-<style></style>
+<style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
+</style>

+ 6 - 1
src/views/finance/rebate_list.vue

@@ -564,6 +564,7 @@ import RebateListConfirm from "./components/rebate_list-confirm";
 import RebateListEdit from "./components/rebate_list-edit.vue";
 
 export default {
+  name: "rebate_list",
   components: {
     RebateListDetail,
     RebateListApply,
@@ -611,7 +612,11 @@ export default {
 
     this.isCustomer = res.isCustomer;
     if (this.$route.query.id) {
-      this.examineFn(this.$route.query.id);
+      if (this.isCustomer) {
+        this.confirmFn(this.$route.query.id, false);
+      } else {
+        this.examineFn(this.$route.query.id);
+      }
     }
   },
   methods: {

+ 294 - 286
src/views/sales_policy/components/AddPolicy.vue

@@ -3,18 +3,17 @@
     <div v-show="isCondition == 0">
       <el-header height="50px" class="header">
         <el-page-header
-          @back="($parent.isShow = 1), ($parent.isFlag = '')"
           content="新增"
-        >
-        </el-page-header>
+          @back="($parent.isShow = 1), ($parent.isFlag = '')"
+        />
       </el-header>
       <div class="app-container">
         <div class="screen-container">
           <h4>销售政策信息</h4>
-          <el-divider></el-divider>
+          <el-divider />
           <el-form
-            :model="searchForm"
             ref="form"
+            :model="searchForm"
             label-width="120px"
             size="small"
             class="demo-searchForm"
@@ -23,10 +22,10 @@
               <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="销售政策编号">
                   <el-input
-                    disabled
                     v-model="searchForm.code"
+                    disabled
                     placeholder="如未填写,则系统自动生成"
-                  ></el-input>
+                  />
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :ms="12" :lg="12">
@@ -34,14 +33,14 @@
                   <el-input
                     v-model="searchForm.title"
                     placeholder="销售政策说明"
-                  ></el-input>
+                  />
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="销售政策类型" prop="type">
                   <el-select
-                    size="small"
                     v-model="searchForm.type"
+                    size="small"
                     placeholder="销售政策类型"
                     class="select_height"
                   >
@@ -50,8 +49,7 @@
                       :key="index"
                       :label="item.label"
                       :value="item.value"
-                    >
-                    </el-option>
+                    />
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -79,9 +77,7 @@
                     placeholder="生效日期"
                     default-time="00:00:00"
                     value-format="yyyy-MM-dd HH:mm:ss"
-                  >
-                  </el-date-picker> </el-form-item
-              ></el-col>
+                  /> </el-form-item></el-col>
               <el-col :xs="24" :ms="12" :lg="12">
                 <el-form-item label="失效日期" prop="endTime">
                   <el-date-picker
@@ -90,20 +86,18 @@
                     placeholder="失效日期"
                     default-time="00:00:00"
                     value-format="yyyy-MM-dd HH:mm:ss"
-                  >
-                  </el-date-picker> </el-form-item
-              ></el-col>
+                  /> </el-form-item></el-col>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="表头备注" prop="remark">
                   <el-input
                     v-model="searchForm.remark"
                     placeholder="新风机变频挂机。按提货数量1:3开单"
-                  ></el-input>
+                  />
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="政策封面图">
-                  <ImageUpload :fileList="fileList"  :multiple="false" />
+                  <ImageUpload :file-list="fileList" :multiple="false" />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -111,7 +105,7 @@
         </div>
         <div class="mymian-container">
           <el-row>
-            <el-divider></el-divider>
+            <el-divider />
             <el-row type="flex">
               <el-col :span="12">
                 <h4 style="display: inline-block; margin-right: 20px">
@@ -125,9 +119,10 @@
                     :file-list="importFileList"
                     :show-file-list="false"
                   >
-                    <el-button type="primary" size="small"
-                      >导入货品价格表</el-button
-                    >
+                    <el-button
+                      type="primary"
+                      size="small"
+                    >导入货品价格表</el-button>
                   </el-upload>
                 </template>
 
@@ -135,11 +130,10 @@
                   type="primary"
                   size="small"
                   @click="hanleDownloadFiles"
-                  >下载模板</el-button
-                >
+                >下载模板</el-button>
               </el-col>
             </el-row>
-            <el-divider></el-divider>
+            <el-divider />
           </el-row>
           <el-table
             v-loading="listLoading"
@@ -155,8 +149,7 @@
               label="序号"
               width="50"
               align="center"
-            >
-            </el-table-column>
+            />
             <el-table-column
               prop="materialNumber"
               label="货品编码"
@@ -164,19 +157,20 @@
             >
               <template slot-scope="scope">
                 <el-select
-                  size="small"
                   v-model="scope.row.materialNumber"
-                  @change="handleK3List($event, scope.row)"
                   v-el-select-loadmore="loadmore"
+                  size="small"
+                  :remote-method="(query)=>remoteMethod(query,'number')"
                   filterable
+                  remote
+                  @change="handleK3List($event, scope.row)"
                 >
                   <el-option
                     v-for="item in k3List"
                     :key="item.id"
                     :label="item.number"
                     :value="item.id"
-                  >
-                  </el-option>
+                  />
                 </el-select>
               </template>
             </el-table-column>
@@ -184,8 +178,7 @@
               prop="materialName"
               label="货品名称"
               align="center"
-            >
-            </el-table-column>
+            />
             <el-table-column
               prop="specification"
               label="规格型号"
@@ -193,18 +186,19 @@
             >
               <template slot-scope="scope">
                 <el-select
-                  size="small"
                   v-model="scope.row.specification"
-                  @change="handleK3List($event, scope.row)"
+                  size="small"
+                  :remote-method="(query)=>remoteMethod(query,'specification')"
                   filterable
+                  remote
+                  @change="handleK3List($event, scope.row)"
                 >
                   <el-option
                     v-for="item in k3List"
                     :key="item.id"
                     :label="item.specification"
                     :value="item.id"
-                  >
-                  </el-option>
+                  />
                 </el-select>
               </template>
             </el-table-column>
@@ -215,18 +209,17 @@
             >
               <template slot-scope="scope">
                 <el-select
-                  size="small"
                   v-model="scope.row.saleTypeId"
-                  @change="handleSalesType($event, scope.row)"
+                  size="small"
                   filterable
+                  @change="handleSalesType($event, scope.row)"
                 >
                   <el-option
                     v-for="item in typeList"
                     :key="item.id"
                     :label="item.saleName"
                     :value="item.id"
-                  >
-                  </el-option>
+                  />
                 </el-select>
               </template>
             </el-table-column>
@@ -234,35 +227,34 @@
               prop="saleTypeCode"
               label="销售类型编码"
               align="center"
-            >
-            </el-table-column>
+            />
 
             <el-table-column prop="discAmount" label="格力折扣" align="center">
               <template slot-scope="scope">
                 <el-input
-                  type="number"
                   v-model.number="scope.row.discAmount"
+                  type="number"
                   placeholder="请输入格力折扣"
                   size="small"
-                ></el-input>
+                />
               </template>
             </el-table-column>
             <el-table-column prop="price" label="单价" align="center">
               <template slot-scope="scope">
                 <el-input
-                  type="number"
                   v-model.number="scope.row.price"
+                  type="number"
                   placeholder="请输入单价"
                   size="small"
-                ></el-input>
+                />
               </template>
             </el-table-column>
             <el-table-column label="支付钱包" align="center">
               <template slot-scope="scope">
                 <el-select
+                  v-model="scope.row.walletIds"
                   size="small"
                   multiple
-                  v-model="scope.row.walletIds"
                   filterable
                 >
                   <el-option
@@ -270,8 +262,7 @@
                     :key="item.id"
                     :label="item.name"
                     :value="item.id"
-                  >
-                  </el-option>
+                  />
                 </el-select>
                 <!-- <el-tag
                   style="margin: 5px"
@@ -288,7 +279,7 @@
                   v-model="scope.row.remark"
                   placeholder="备注"
                   size="small"
-                ></el-input>
+                />
               </template>
             </el-table-column>
             <el-table-column fixed="right" label="操作" align="center">
@@ -305,8 +296,7 @@
                     slot="reference"
                     type="text"
                     class="textColor el-popover-left"
-                    >删除</el-button
-                  >
+                  >删除</el-button>
                 </el-popconfirm>
               </template>
             </el-table-column>
@@ -320,38 +310,42 @@
             "
           >
             <div>
-              <el-button type="primary" size="small" @click="handleNewInfo"
-                >添加</el-button
-              >
-              <el-button type="primary" size="small" @click="handleSave"
-                >保存</el-button
-              >
+              <el-button
+                type="primary"
+                size="small"
+                @click="handleNewInfo"
+              >添加</el-button>
+              <el-button
+                type="primary"
+                size="small"
+                @click="handleSave"
+              >保存</el-button>
             </div>
             <el-pagination
-              @size-change="handleSizeChange2"
-              @current-change="handleCurrentChange2"
               :current-page="dcurrentPage"
               :page-sizes="pageSizeArr"
               :page-size="size"
               layout="total, sizes, prev, pager, next, jumper"
               :total="listTotal"
-            >
-            </el-pagination>
+              @size-change="handleSizeChange2"
+              @current-change="handleCurrentChange2"
+            />
           </div>
 
           <el-row>
-            <el-divider></el-divider>
+            <el-divider />
             <el-row type="flex">
               <el-col :span="12">
                 <h4 style="display: inline-block; margin-right: 20px">
                   条件信息
                 </h4>
-                <el-button type="primary" size="small" @click="isCondition = 1"
-                  >添加</el-button
-                ></el-col
-              >
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="isCondition = 1"
+                >添加</el-button></el-col>
             </el-row>
-            <el-divider></el-divider>
+            <el-divider />
           </el-row>
           <el-table
             v-loading="listLoading"
@@ -368,8 +362,7 @@
               label="序号"
               width="50"
               align="center"
-            >
-            </el-table-column>
+            />
             <el-table-column prop="name" label="限定条件" align="center">
               <template slot-scope="scope">
                 <el-input
@@ -378,7 +371,7 @@
                   placeholder="请输入名称"
                   :disabled="scope.row.fang"
                   @blur="handleConditionName(scope.row)"
-                ></el-input>
+                />
               </template>
             </el-table-column>
             <el-table-column
@@ -392,29 +385,27 @@
                   type="text"
                   size="small"
                   @click="scope.row.fang = false"
-                  >编辑</el-button
-                >
+                >编辑</el-button>
                 <el-button
                   type="text"
                   size="small"
                   @click="handleCondition(scope.row.id, scope.$index)"
-                  >删除</el-button
-                >
+                >删除</el-button>
               </template>
             </el-table-column>
           </el-table>
         </div>
         <div>
           <el-row>
-            <el-divider></el-divider>
+            <el-divider />
             <el-row type="flex" align="middle">
               <el-col :span="2">
                 <h4>经销商信息</h4>
               </el-col>
             </el-row>
-            <el-divider></el-divider>
+            <el-divider />
           </el-row>
-          <Transfer @handleAddPolicy="handleAddPolicy" />
+          <Transfer @handleAddPolicy="handleAddPolicy" @handleReset="handleReset" />
         </div>
       </div>
     </div>
@@ -446,15 +437,14 @@ import AddCondition from './AddCondition'
 import ImageUpload from '@/components/Common/image-upload.vue'
 
 export default {
-  mixins: [Minxin],
-    directives: {
-    "el-select-loadmore": {
+  directives: {
+    'el-select-loadmore': {
       bind(el, binding) {
         // 获取element-ui定义好的scroll盒⼦
         const SELECTWRAP_DOM = el.querySelector(
-          ".el-select-dropdown .el-select-dropdown__wrap"
-        );
-        SELECTWRAP_DOM.addEventListener("scroll", function () {
+          '.el-select-dropdown .el-select-dropdown__wrap'
+        )
+        SELECTWRAP_DOM.addEventListener('scroll', function() {
           /**
            * scrollHeight 获取元素内容⾼度(只读)
            * scrollTop 获取或者设置元素的偏移值,常⽤于, 计算滚动条的位置, 当⼀个元素的容器没有产⽣垂直⽅向的滚动条, 那它的scrollTop的值默认为0.
@@ -463,76 +453,77 @@ export default {
            * ele.scrollHeight - ele.scrollTop === ele.clientHeight;
            */
           const condition =
-            this.scrollHeight - this.scrollTop <= this.clientHeight;
+            this.scrollHeight - this.scrollTop <= this.clientHeight
           if (condition) {
-            binding.value();
+            binding.value()
           }
-        });
-      },
-    },
+        })
+      }
+    }
   },
+  mixins: [Minxin],
   data() {
     return {
       fang: false,
-      input: "",
-      baseURL: "",
+      input: '',
+      baseURL: '',
       isCondition: 0,
       searchForm: {
-        code: "",
-        endTime: "",
-        imgSrc: "",
-        remark: "",
-        startTime: "",
-        title: "",
-        mainId: "",
-        mainName: "",
-        type: "",
+        code: '',
+        endTime: '',
+        imgSrc: '',
+        remark: '',
+        startTime: '',
+        title: '',
+        mainId: '',
+        mainName: '',
+        type: ''
       },
       dataList: [],
       addList: [],
-      pageSizeArr:[10, 20, 30, 50],
-      size:10,
+      pageSizeArr: [10, 20, 30, 50],
+      size: 10,
       listLoading: false,
       dialogVisible: false,
       importFileList: [],
       fileList: [],
       options: {},
-      value: "",
+      value: '',
       typeList: [],
       walletList: [],
       typeOptions: [
         {
-          value: "PROVISION",
-          label: "配提",
+          value: 'PROVISION',
+          label: '配提'
         },
         {
-          value: "LIMIT",
-          label: "限量",
-        },
+          value: 'LIMIT',
+          label: '限量'
+        }
       ],
       conditionList: [],
       dictList: [],
       k3List: [],
       NoRebateWalletList: [],
-      sleectBox:{currentPage:1},
-      dpageSize:10,
-      dcurrentPage:1
-    };
+      sleectBox: { currentPage: 1 },
+      dpageSize: 10,
+      dcurrentPage: 1
+    }
   },
   computed: {
     ...mapGetters({
-      comCode: "code",
-    }),
+      comCode: 'code'
+    })
   },
 
   mounted() {
-    this.searchForm.code = this.comCode;
+    this.searchForm.code = this.comCode
   },
   updated() {
-    this.searchForm.code = this.comCode;
+    this.searchForm.code = this.comCode
   },
   created() {
-    this.getCommonApi();
+    this.getCommonApi()
 
     // console.log(this.$store.code);
 
@@ -541,53 +532,71 @@ export default {
     }
   },
   methods: {
-    ...mapMutations("sales", ["initData"]),
-    //下载excel模板
+    ...mapMutations('sales', ['initData']),
+    // 下载excel模板
     hanleDownloadFiles() {
-      downloadFiles("/policy/download");
+      downloadFiles('/policy/download')
     },
     handleCondition(id, index) {
       deleteCondition({ id }).then((res) => {
-        this.conditionList.splice(index, 1);
+        this.conditionList.splice(index, 1)
         Object.assign(
           this.$children[9].$data,
           this.$children[9].$options.data()
-        );
-        this.$successMsg("删除成功");
-      });
+        )
+        this.$successMsg('删除成功')
+      })
     },
     loadmore() {
-      this.sleectBox.currentPage++;
-      this.getK3List();
+      this.sleectBox.currentPage++
+      this.getK3List()
     },
-    getK3List(){
-    getK3List({
+    getK3List() {
+      getK3List({
         pageNum: this.sleectBox.currentPage,
         pageSize: 10,
-        keyword: "",
+        keyword: ''
+
       }).then((res) => {
-        this.k3List = [...this.k3List,...res.data.records];
-      });
+        this.k3List = [...this.k3List, ...res.data.records]
+      })
+    },
+    remoteMethod(query, type) {
+      console.log(query, type)
+      if (query !== '') {
+        getK3List({
+          pageNum: 1,
+          pageSize: -1,
+          keyword: '',
+          number: type === 'number' ? query : '',
+          oldNumber: '',
+          specification: type === 'specification' ? query : ''
+        }).then((res) => {
+          this.k3List = res.data.records
+        })
+      } else {
+        this.sleectBox.currentPage = 1
+        this.getK3List()
+      }
     },
-
     getCommonApi() {
-     this.getK3List()
+      this.getK3List()
       // 非返利钱包
-      getNoRebateWalletList({ walletName: "" }).then((res) => {
-        this.NoRebateWalletList = res.data;
-        console.log(this.NoRebateWalletList, "kkkk");
-      });
+      getNoRebateWalletList({ walletName: '' }).then((res) => {
+        this.NoRebateWalletList = res.data
+        console.log(this.NoRebateWalletList, 'kkkk')
+      })
       const params = {
         pageNum: 1,
         pageSize: -1,
-        saleCode: "",
-        saleName: "",
-        status: "",
-      };
+        saleCode: '',
+        saleName: '',
+        status: ''
+      }
       // 获取销售类型列表
       getTypeList(params).then((res) => {
-        this.typeList = res.data.records;
-      });
+        this.typeList = res.data.records
+      })
       // this.handletwoList()
       // const params = {
       //   pageNum: 1,
@@ -614,96 +623,94 @@ export default {
     },
     handleSalesType(e, row) {
       const item = this.typeList.filter((k) => {
-        return k.id == e;
-      })[0];
-
-      this.$set(row, "saleTypeCode", item.saleCode);
-      this.$set(row, "saleTypeName", item.saleName);
+        return k.id == e
+      })[0]
+      this.$set(row, 'saleTypeCode', item.saleCode)
+      this.$set(row, 'saleTypeName', item.saleName)
       // this.$set(row,'saleTypeId',item.id)
     },
-    //修改条件名称
+    // 修改条件名称
     handleConditionName(row) {
-      console.log(row.name);
+      console.log(row.name)
       updateCondition({ id: row.id, name: row.name }).then((res) => {
-        this.$successMsg("修改成功");
-        row.fang = true;
-      });
+        this.$successMsg('修改成功')
+        row.fang = true
+      })
     },
-    //提交信息
+    // 提交信息
     handleSubmitCon() {
       const params = {
-        policyId: this.comCode,
-      };
+        policyId: this.comCode
+      }
       // 获取条件政策
       getConditionList(params).then((res) => {
         for (let i = 0; i < res.data.length; i++) {
-          res.data[i].fang = true;
+          res.data[i].fang = true
         }
-        this.conditionList = res.data;
-      });
+        this.conditionList = res.data
+      })
     },
     // 视图部分已注释,废弃的功能 fucn
     handelStop() {
       if (this.searchForm.mainId) {
-        this.fang = true;
+        this.fang = true
       } else {
-        this.$errorMsg("请选择产品品类");
+        this.$errorMsg('请选择产品品类')
       }
     },
     // 导入
     async handleImport(param) {
-      this.importLoading = true;
-      const file = param.file;
-      console.log(file, 123);
-      const formData = new FormData();
-      formData.append("file", file);
-      formData.append("policyId", this.searchForm.code);
+      this.importLoading = true
+      const file = param.file
+      console.log(file, 123)
+      const formData = new FormData()
+      formData.append('file', file)
+      formData.append('policyId', this.searchForm.code)
       // formData.append("mainId", this.searchForm.mainId);
-      let result = await handleImport("/policy/material/import", formData);
-      this.importLoading = false;
-      this.importFileList = [];
+      const result = await handleImport('/policy/material/import', formData)
+      this.importLoading = false
+      this.importFileList = []
       if (result.code == 200) {
-        this.$alert(result.message, "导入成功", {
-          confirmButtonText: "确定",
-        });
-        this.dataList = [];
-        this.listTotal = 0;
-        this.sleectBox.currentPage=1
-        this.handletwoList();
+        this.$alert(result.message, '导入成功', {
+          confirmButtonText: '确定'
+        })
+        this.dataList = []
+        this.listTotal = 0
+        this.sleectBox.currentPage = 1
+        this.handletwoList()
       } else {
-        this.$alert(result.message, "导入失败", {
-          confirmButtonText: "确定",
-        });
+        this.$alert(result.message, '导入失败', {
+          confirmButtonText: '确定'
+        })
       }
     },
     getList() {
       if (this.$parent.isFlag) {
-        this.handletwoList();
+        this.handletwoList()
       }
     },
-      // 更改每页数量
+    // 更改每页数量
     handleSizeChange1(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-      this.handletwoList();
+      this.pageSize = val
+      this.currentPage = 1
+      this.handletwoList()
     },
     // 更改当前页
     handleCurrentChange1(val) {
-      this.currentPage = val;
-      this.handletwoList();
+      this.currentPage = val
+      this.handletwoList()
     },
 
-   // 更改每页数量
+    // 更改每页数量
     handleSizeChange2(val) {
-      this.dpageSize = val;
-      this.dcurrentPage = 1;
+      this.dpageSize = val
+      this.dcurrentPage = 1
 
-     this.handletwoList()
+      this.handletwoList()
     },
     // 更改当前页
     handleCurrentChange2(val) {
-
-      this.dcurrentPage = val;
+      this.dcurrentPage = val
       this.handletwoList()
     },
     // 获取货品信息
@@ -713,186 +720,187 @@ export default {
         pageNum: this.dcurrentPage,
         pageSize: this.dpageSize,
         policyId: this.comCode,
-        saleTypeCode: "",
-      };
+        saleTypeCode: ''
+      }
 
       getMaterialList(paramss)
         .then((result) => {
           result.data.records.forEach((k) => {
-            k.walletIds = [];
+            k.walletIds = []
             if (!k.specification) {
-               k.materialNumber = k.materialId;
-             k.specification = k.materialId;
-
-            }else{
-                k.materialNumber = k.materialNumber;
-            k.specification = k.specification;
+              k.materialNumber = k.materialId
+              k.specification = k.materialId
+            } else {
+              k.materialNumber = k.materialNumber
+              k.specification = k.specification
             }
 
-            k.materialId = k.materialId;
+            k.materialId = k.materialId
             k.walletRelaList.forEach((l) => {
-              l.id = l.walletId;
-              l.name = l.walletName;
-              k.walletIds = [...k.walletIds, l.walletId];
-            });
-          });
+              l.id = l.walletId
+              l.name = l.walletName
+              k.walletIds = [...k.walletIds, l.walletId]
+            })
+          })
           // this.dataList=[]
           this.dataList = result.data.records
-          this.listTotal = result.data.total;
+          this.listTotal = result.data.total
         })
         .catch((err) => {
-          console.error(err);
-        });
+          console.error(err)
+        })
     },
     // 提交审核
     handleAddPolicy(policyCustomers) {
       if (!this.searchForm.title) {
-        this.$errorMsg("请输入说明");
-        return;
+        this.$errorMsg('请输入说明')
+        return
       }
       if (!this.searchForm.type) {
-        this.$errorMsg("请选择类型");
-        return;
+        this.$errorMsg('请选择类型')
+        return
       }
       if (!this.searchForm.startTime) {
-        this.$errorMsg("请选择生效日期");
-        return;
+        this.$errorMsg('请选择生效日期')
+        return
       }
 
       if (policyCustomers.length) {
-        var arr = [];
+        var arr = []
         policyCustomers.forEach((el) => {
           arr.push({
             customerId: el.id,
             customerName: el.name,
             customerNumber: el.number,
-            lastOrderTime: "",
+            lastOrderTime: '',
             limitTakeNum: 0,
             policyId: this.comCode,
-            policyTitle: "",
-            remark: "",
-          });
-        });
+            policyTitle: '',
+            remark: ''
+          })
+        })
         // this.dictList.forEach((k) => {
         //   if (k.dictCode == this.searchForm.mainId) {
         //     this.searchForm.mainName = k.dictValue;
         //   }
         // });
         const params = {
-          adminCompanyId: "",
-          code: "",
+          adminCompanyId: '',
+          code: '',
           customerCount: 0,
-          examineBy: "",
-          examineRemark: "",
-          examineStatus: "",
-          id: "",
+          examineBy: '',
+          examineRemark: '',
+          examineStatus: '',
+          id: '',
           policyCustomers: arr,
-          remark: "",
+          remark: '',
           status: true,
-          title: "",
-          type: "",
+          title: '',
+          type: '',
           ...this.searchForm,
-          endTime: this.searchForm.endTime || "2100-01-01 00:00:00",
-          imgSrc: this.fileList.length ? this.fileList[0].url : "",
-        };
-        console.log(this.fileList);
+          endTime: this.searchForm.endTime || '2100-01-01 00:00:00',
+          imgSrc: this.fileList.length ? this.fileList[0].url : ''
+        }
+        console.log(this.fileList)
         addPoliy(params).then((res) => {
-          console.log(res);
-          this.$successMsg("新增成功");
-          this.$parent.getList();
-          this.$parent.isShow = 1;
-        });
-
+          console.log(res)
+          this.$successMsg('新增成功')
+          this.$parent.getList()
+          this.$parent.isShow = 1
+        })
       } else {
-        this.$errorMsg("选择经销商 ");
+        this.$errorMsg('选择经销商 ')
       }
     },
-    //删除
+    // 删除
     hanleDelete(id, index) {
       if (id) {
-        const params = { policyMaterialId: id };
+        const params = { policyMaterialId: id }
         deleteMaterialPolicy(params).then((res) => {
-          this.dataList.splice(index, 1);
-        });
+          this.dataList.splice(index, 1)
+        })
       }
-      this.dataList.splice(index, 1);
+      this.dataList.splice(index, 1)
       // this.listTotal -= 1;
-      this.$successMsg("删除成功");
+      this.$successMsg('删除成功')
     },
     handleNewInfo() {
       // 物料列表
 
       this.dataList.push({
-        id: "",
-        discAmount: "",
-        materialId: "",
-        materialName: "",
-        materialNumber: "",
+        id: '',
+        discAmount: '',
+        materialId: '',
+        materialName: '',
+        materialNumber: '',
         policyId: this.comCode,
-        price: "",
-        remark: "",
-        saleTypeCode: "",
-        saleTypeId: "",
-        saleTypeName: "",
-        specification: "",
+        price: '',
+        remark: '',
+        saleTypeCode: '',
+        saleTypeId: '',
+        saleTypeName: '',
+        specification: '',
         walletIds: [this.NoRebateWalletList[0].id],
-        walletRelaList: [],
-      });
-       this.sleectBox.currentPage =1
+        walletRelaList: []
+      })
+      this.sleectBox.currentPage = 1
       // this.listTotal += 1;
       // this.dataList.push(this.addList[this.addList.length-1])
     },
     handleSave() {
       if (!this.dataList.length) {
-          return
+        return
       }
       for (let i = 0; i < this.dataList.length; i++) {
-           if (!this.dataList[i].materialId) {
-          this.$errorMsg("请选择货品");
+        if (!this.dataList[i].materialId) {
+          this.$errorMsg('请选择货品')
           return
         }
         if (!this.dataList[i].saleTypeId) {
-          this.$errorMsg("请选择销售类型");
+          this.$errorMsg('请选择销售类型')
           return
         }
         if (!this.dataList[i].discAmount) {
-          this.$errorMsg("请输入格力折扣");
+          this.$errorMsg('请输入格力折扣')
           return
         }
         if (!this.dataList[i].price) {
-          this.$errorMsg("请输入单价");
+          this.$errorMsg('请输入单价')
           return
         }
         if (!this.dataList[i].walletIds.length) {
-          this.$errorMsg("请选择钱包");
+          this.$errorMsg('请选择钱包')
           return
         }
-
       }
 
       savePolicy(this.dataList).then((res) => {
-        this.dataList = [];
-        this.sleectBox.currentPage =1
-        this.$successMsg("保存成功");
-        this.handletwoList();
-      });
+        this.dataList = []
+        this.sleectBox.currentPage = 1
+        this.$successMsg('保存成功')
+        this.handletwoList()
+      })
     },
     handleK3List(e, row) {
       const item = this.k3List.filter((k) => {
-        return k.id == e;
-      })[0];
+        return k.id == e
+      })[0]
       // this.$set(row,'materialNumber',item.number)
-      this.$set(row, "materialName", item.name);
-      this.$set(row, "specification", item.specification);
-      this.$set(row, "materialId", item.id);
+      this.$set(row, 'materialName', item.name)
+      this.$set(row, 'specification', item.specification)
+      this.$set(row, 'materialId', item.id)
+      this.getK3List()
     },
+    handleReset() {
+      Object.assign(this.$data, this.$options.data())
+    }
   },
   components: {
     Transfer,
     AddCondition,
-    ImageUpload,
-  },
-};
+    ImageUpload
+  }
+}
 </script>
 
 <style lang="scss" scoped>

+ 51 - 22
src/views/sales_policy/components/Transfer.vue

@@ -19,6 +19,11 @@
             size="small"
           >导入经销商</el-button>
         </el-upload>
+        <el-button
+          type="primary"
+          size="small"
+          @click="hanleDownloadFiles"
+        >下载模板</el-button>
       </el-row>
       <el-row type="flex">
         <el-col>
@@ -120,7 +125,7 @@
           size="small"
           @click="handleSubmit"
         >提交审核</el-button>
-        <el-button type="primary" size="small" @click="">重置</el-button>
+        <el-button type="primary" size="small" @click="handleReset">重置</el-button>
       </el-row>
     </slot>
   </div>
@@ -129,13 +134,13 @@
 <script>
 import Minxin from '@/mixin'
 import { getCrList } from '@/api/policy_list'
-import { handleImport } from '@/utils/util'
+import { downloadFiles, handleImport } from '@/utils/util'
 
 export default {
   mixins: [Minxin],
   data() {
     return {
-      baseURL:'',
+      baseURL: '',
       type: '',
       radio: '',
       leftData: [],
@@ -150,9 +155,11 @@ export default {
     }
   },
   methods: {
+    // 初始话数据
     getList() {
       this.getcList()
     },
+    // 获取经销商列表
     getcList: function() {
       const customerParams = {
         pageNum: this.currentPage,
@@ -170,22 +177,25 @@ export default {
         this.listTotal = res.data.total
       })
     },
+    // 左边框
     handleLeft(e) {
       console.log(e)
       this.type = 1
     },
+    // 右边框
     handleRight(e) {
       this.type = 2
     },
+    // 全部添加
     handleAllAdd() {
       this.dataR = [...new Set([...this.dataR, ...this.dataL])]
     },
+    // 全部删除
     handleAllDelete() {
-      //  for (let j = 0; j < this.dataL.length; j++) {
-      //         this.dataL[j].disabled = false
-      //       }
       this.dataR = []
+      this.rightData = []
     },
+    // 单个删除或者多个删除
     handleAdd() {
       if (this.type == 1) {
         // console.log(this.leftData,44545);
@@ -201,13 +211,13 @@ export default {
         this.leftData = []
       }
     },
+    // 单个删除或者多个删除
     handleDelete() {
-      if (this.type == 2) {
+      if (this.type === 2) {
         const dataArr = JSON.parse(JSON.stringify(this.dataR))
-
         for (let k = dataArr.length - 1; k >= 0; k--) {
           for (let i = 0; i < this.rightData.length; i++) {
-            if (this.rightData[i] == this.dataR[k].id) {
+            if (this.rightData[i] === this.dataR[k].id) {
               dataArr.splice(k, 1)
             }
           }
@@ -216,35 +226,54 @@ export default {
         this.rightData = []
       }
     },
+    // 提交数据
     handleSubmit() {
       this.$emit('handleAddPolicy', this.dataR)
     },
-    // 导入
+    // 去掉相同数据
+    resArr(arr1, arr2) {
+      return arr1.filter((v) => arr2.every((val) => val.id !== v.id))
+    },
+    // 导入经销商模板
     async handleImport(param) {
-      return
       this.importLoading = true
       const file = param.file
-      console.log(file, 123)
       const formData = new FormData()
       formData.append('file', file)
-      formData.append('policyId', this.searchForm.code)
+      // formData.append('policyId', this.searchForm.code)
       // formData.append("mainId", this.searchForm.mainId);
-      const result = await handleImport('/policy/material/import', formData)
+      const result = await handleImport('/policy/importCustomer', formData)
+      console.log(result)
       this.importLoading = false
       this.importFileList = []
-      if (result.code == 200) {
-        this.$alert(result.message, '导入成功', {
+      if (result.code === 200) {
+        await this.$alert(result.message, '导入成功', {
           confirmButtonText: '确定'
         })
-        this.dataList = []
-        this.listTotal = 0
-        this.sleectBox.currentPage = 1
-        this.handletwoList()
+        if (this.dataR.length) {
+          this.dataR = [...this.dataR, ...this.resArr(this.dataR, result.data)]
+          console.log(this.dataR)
+        } else {
+          this.dataR = result.data
+        }
       } else {
-        this.$alert(result.message, '导入失败', {
+        await this.$alert(result.message, '导入失败', {
           confirmButtonText: '确定'
         })
       }
+    },
+    // 下载经销商模板
+    hanleDownloadFiles() {
+      downloadFiles('/policy/customer_count/export', {
+        code: '',
+        remark: '',
+        title: ''
+      })
+    },
+    handleReset() {
+      this.dataR = this.rightData = []
+      this.keyword = ''
+      this.$emit('handleReset')
     }
   }
 }
@@ -257,7 +286,7 @@ export default {
   align-items: center;
 }
 .import-btn{
-  margin-left: 10px;
+  margin:0 10px;
 }
 .transfer {
   margin: 20px 0;

+ 187 - 12
src/views/supply/policy/components/retail_detail.vue

@@ -10,7 +10,7 @@
           :text-inside="true"
           :stroke-width="26"
           :percentage="
-          detailData.thjd ? ((detailData.thjd * 1000) / 10).toFixed(2) : 0
+            detailData.thjd ? +((detailData.thjd * 1000) / 10).toFixed(2) : 0
         "
         />
       </div>
@@ -264,7 +264,7 @@
         </el-table>
       </div>
 
-      <div v-if="isExamine">
+      <div>
         <div class="main-title">
           <div class="title">审批记录</div>
         </div>
@@ -291,10 +291,13 @@
 
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="success" @click="toCheckOrder">联查单据</el-button>
+        <el-button type="success" @click="toCheckOrder" >联查单据</el-button>
+        <el-button type="primary" @click="openDirectDialog" v-if="isCustomer" :disabled="detailData.examineStatus !== 'OK'">提前开票</el-button>
+
         <el-button
           :type="status ? 'info' : 'primary'"
-          :disabled="detailData.examineStatus !== 'OK' || status"
+          v-if="isCustomer"
+          :disabled="detailData.examineStatus !== 'OK' || status "
           @click="openDeliverDialog"
         >直调发货</el-button>
         <el-button
@@ -306,6 +309,70 @@
         <!-- <el-button @click="goBack">关 闭</el-button> -->
       </div>
     </div>
+    <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
+      <el-form ref="directForm" :model="directForm" :rules="directFormRules" label-width="80px" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item label="调出仓库" prop="warehouse1">
+              <el-select v-model="directForm.warehouse1" placeholder="请选择调出仓库" style="width: 100%" filterable @change="changeWarehouse1">
+                <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item label="调出仓位" prop="position1">
+              <el-select v-model="directForm.position1" placeholder="请调出仓位" style="width: 100%" filterable @change="changePosition1">
+                <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item label="调入仓库" prop="warehouse2">
+              <el-select v-model="directForm.warehouse2" placeholder="请选择调入仓库" style="width: 100%" filterable @change="changeWarehouse2">
+                <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item label="调入仓位" prop="position2">
+              <el-select v-model="directForm.position2" placeholder="请调入仓位" style="width: 100%" filterable @change="changePosition2">
+                <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div class="table" style="margin-top: 20px">
+        <el-table :data="directGoodsList" 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="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" 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="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
+            <template slot-scope="">弘格</template>
+          </el-table-column>
+          <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
+            <template slot-="scope">弘格</template>
+          </el-table-column>
+          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+        </el-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDirectDialog">取 消</el-button>
+        <el-button type="primary" @click="submitDirectForm">确 定</el-button>
+      </span>
+    </el-dialog>
     <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
       <el-form
         ref="deliverForm"
@@ -502,7 +569,7 @@
 
 <script>
 import { getDetail } from '@/api/supply/policy'
-import { adjustDeliver, finishData, getPositionList, getWarehouseList } from '@/api/supply/retail'
+import { adjustDeliver, directOrder, finishData, getPositionList, getWarehouseList } from '@/api/supply/retail'
 import { mapState } from 'vuex'
 import CheckOrder from '@/components/Common/check-order'
 
@@ -528,12 +595,10 @@ export default {
   data() {
     return {
       detailData: {},
-
       isShowDeliverDialog: false,
       deliverForm: {
         date: '',
-        warehouse: '',
-        position: ''
+        position: '',
       },
       deliverFormRules: {
         date: [
@@ -543,11 +608,35 @@ export default {
           { required: true, message: '请选择虚拟仓位', trigger: 'change' }
         ],
       },
-      warehouseList: [],
       positionList: [],
-
       goodsList: [],
-      status: false,
+      isShowDirectDialog: false,
+      directForm: {
+        warehouse1: '',
+        position1: '',
+        warehouse2: '',
+        position2: '',
+      },
+      directFormRules: {
+        warehouse1: [
+          { required: true, message: '请选择调出仓库', trigger: 'change' }
+        ],
+        position1: [
+          { required: true, message: '请选择调出仓位', trigger: 'change' }
+        ],
+        warehouse2: [
+          { required: true, message: '请选择调入仓库', trigger: 'change' }
+        ],
+        position2: [
+          { required: true, message: '请选择调入仓位', trigger: 'change' }
+        ],
+      },
+      warehouseList1: [],
+      warehouseList2: [],
+      positionList1: [],
+      positionList2: [],
+      directGoodsList: [],
+      status:false,
       checkOrderId: {},
       isShowCheckOrder: false,
     }
@@ -686,7 +775,85 @@ export default {
       this.checkOrderId = this.detailData.id;
       this.isShowCheckOrder = true;
     },
+    // 关闭 提前开票
+    closeDirectDialog() {
+      this.isShowDirectDialog = false;
+    },
+    // 更改调出仓库
+    changeWarehouse1() {
+      this.directForm.position1 = '';
+      let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
+      this.positionList1 = obj.kingDeeStocks;
+      this.directGoodsList.forEach(item => {
+        item.warehouse1 = obj.name;
+      });
+    },
+
+    // 更改调入仓库
+    changeWarehouse2() {
+      this.directForm.position2 = '';
+      let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
+      this.positionList2 = obj.kingDeeStocks;
+      this.directGoodsList.forEach(item => {
+        item.warehouse2 = obj.name;
+      });
+    },
+    // 获取仓库列表
+    getWarehouseList() {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then(res => {
+        this.warehouseList1 = res.data.records;
+        this.warehouseList2 = res.data.records;
+      })
+    },
+
+    // 更改调出仓位
+    changePosition1() {
+      let obj = this.positionList1.find(o => o.id == this.directForm.position1);
+      this.directGoodsList.forEach(item => {
+        item.position1 = obj.name;
+        item.status1 = obj.defStockStatusName;
+      });
+    },
 
+    // 更改调入仓位
+    changePosition2() {
+      let obj = this.positionList2.find(o => o.id == this.directForm.position2);
+      this.directGoodsList.forEach(item => {
+        item.position2 = obj.name;
+        item.status2 = obj.defStockStatusName;
+      });
+    },
+    // 提交 提前开票
+    submitDirectForm() {
+      this.$refs.directForm.validate((valid) => {
+        if (valid) {
+          let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
+          let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1);
+          let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
+          let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2);
+          let params = {
+            orderNo: this.detailData.id,
+            orderType: 'RETAIL', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
+            correspondId: this.directForm.warehouse1,
+            correspondName: warehouseItem1.name,
+            stockId: this.directForm.position1,
+            stockName: positionItem1.name,
+            inCorrespondId: this.directForm.warehouse2,
+            inCorrespondName: warehouseItem2.name,
+            inStockId: this.directForm.position2,
+            inStockName: positionItem2.name,
+          }
+          directOrder(params).then(res => {
+            this.$successMsg();
+            this.isShowDirectDialog = false;
+            this.getDetail();
+          })
+        }
+      })
+    },
     backDetail() {
       this.isShowCheckOrder = false;
     },
@@ -724,7 +891,15 @@ export default {
           })
         }
       })
-    }
+    },
+    // 打开 提前开票
+    openDirectDialog() {
+      this.isShowDirectDialog = true;
+      this.directGoodsList = this.detailData.retailOrderItemList;
+      this.getWarehouseList();
+    },
+
+
   }
 }
 </script>