zh 2 gadi atpakaļ
vecāks
revīzija
00c14df126

+ 26 - 0
src/api/basic_data/dailyWarehouseRent.js

@@ -0,0 +1,26 @@
+import request, { postBlob } from '@/utils/request'
+
+export function getStockCostListCustomer(data) {
+  return request({
+    url: `/stock/cost/listFullCost?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function getStockCostListCustomerV2Export(data, name) {
+  return postBlob({
+    url: '/stock/cost/listCustomerV2/export',
+    data,
+    name
+  })
+}
+
+
+export function updateOrderFull(params) {
+  return request({
+    url: `/stock/cost/updateOrderFull`,
+    method: 'post',
+    params
+  })
+}

+ 17 - 0
src/api/basic_data/monthlyWarehouseRent.js

@@ -0,0 +1,17 @@
+import request, { postBlob } from '@/utils/request'
+
+export function getStockCostListMonthFullCost(data) {
+  return request({
+    url: `/stock/cost/listMonthFullCost?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function getStockCostListMonthFullCostExport(data, name) {
+  return postBlob({
+    url: '/stock/cost/listMonthFullCost/export',
+    data,
+    name
+  })
+}

+ 19 - 1
src/api/common.js

@@ -52,7 +52,7 @@ export function getTypeList(params) {
 }
 // 销售类型-家用工程专用
 export function getHomeTypeList(params) {
-  ///sale/type/home/list
+  // /sale/type/home/list
   return request({
     url: '/sale/type/home/list',
     method: 'get',
@@ -131,3 +131,21 @@ export function updateReceipt(params) {
     params
   })
 }
+
+// 起始库存
+export function getStockCostDict(params) {
+  return request({
+    url: '/stock/cost/dict',
+    method: 'get',
+    params
+  })
+}
+
+// 改变起始库存
+export function updateStockCostDict(params) {
+  return request({
+    url: '/stock/cost/update',
+    method: 'post',
+    data: params
+  })
+}

+ 10 - 0
src/api/dashboard.js

@@ -97,3 +97,13 @@ export function getListInvoiceOrderTWO(params) {
     params
   })
 }
+
+// 订单满货通知
+export function getStockCostList(params) {
+  return request({
+    url: `/stock/cost/list`,
+    method: 'get',
+    params
+  })
+}
+

+ 127 - 8
src/components/NotifyBox/index.vue

@@ -13,6 +13,8 @@
       <el-radio-button :label="2">返利确认单</el-radio-button>
       <el-radio-button :label="3">物流通知</el-radio-button>
       <el-radio-button :label="4">到货通知</el-radio-button>
+      <el-radio-button :label="5">货满订单</el-radio-button>
+
     </el-radio-group>
     <!-- 系统通知 -->
     <div v-show="type === 0" class="table">
@@ -31,7 +33,7 @@
         <el-table-column align="center" label="标题" prop="title" min-width="160" show-overflow-tooltip />
         <el-table-column align="center" label="来源" prop="source" min-width="160" show-overflow-tooltip />
         <el-table-column align="center" label="时间" prop="issueTime" min-width="160" show-overflow-tooltip />
-        <el-table-column align="center" label="" min-width="160" show-overflow-tooltip>
+        <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-button type="text" class="textColor" @click="lookInDialog(scope.row.id)">查看</el-button>
           </template>
@@ -77,7 +79,7 @@
         <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip />
         <el-table-column align="center" label="确认人" prop="examineBy" min-width="160" show-overflow-tooltip />
         <el-table-column align="center" label="确认时间" prop="examineTime" min-width="160" show-overflow-tooltip />
-        <el-table-column align="center" label="" min-width="160" show-overflow-tooltip>
+        <el-table-column align="center" label="操作" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-button type="text" class="textColor" @click="secondFn(scope.row.rebateOrderId)">{{
               isCustomer ? '确认' : '复核'
@@ -161,7 +163,7 @@
         <el-table-column align="center" label="收货客户" prop="receivingName" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">{{ scope.row.receivingName ? scope.row.receivingName : '——' }}</template>
         </el-table-column>
-        <el-table-column align="center" label="" min-width="80" show-overflow-tooltip fixed="right">
+        <el-table-column align="center" label="操作" min-width="80" show-overflow-tooltip fixed="right">
           <template slot-scope="scope">
             <el-button type="text" class="textColor" @click="handLogistics(scope.row)">查看</el-button>
           </template>
@@ -235,6 +237,97 @@
         </div>
       </div>
     </div>
+    <!-- 订单满货通知 -->
+    <div v-show="type == 5" class="table">
+      <div class="mymain-container">
+        <el-form ref="form" label-width="80px" label-position="left" size="mini">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item prop="stockOrderNo" label="订单号">
+                <div style="display: flex">
+                  <el-input v-model="stockOrderNo" clearable style="margin-right: 10px" />
+                </div>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item prop="stockTimes" label="日期">
+                <el-date-picker
+                  v-model="stockTimes"
+                  style="width: 100%;"
+                  type="daterange"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  range-separator="至"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <div style="float: right;"> <el-button size="mini" @click="handleReset($event, 'stockCost')">重置</el-button>
+                <el-button type="primary" size="mini" @click="currentPage = 1,getStockCostList()">查询</el-button></div>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div class="table">
+          <el-table
+            ref="table"
+            v-loading="listLoading"
+            :data="stockCostList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+          >
+            <el-table-column
+              property="materialOldNumber"
+              align="left"
+              min-width="120"
+              label="序号"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              property="orderId"
+              align="left"
+              min-width="100"
+              label="订单号"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              property="specification"
+              align="left"
+              min-width="250"
+              label="机型"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              property="full"
+              align="left"
+              min-width="350"
+              label="是否已生成仓租"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                {{ scope.row.full =='YES'? '是': '否' }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              property="fullTime"
+              align="left"
+              min-width="200"
+              label="货满日期"
+              show-overflow-tooltip
+            />
+            <el-table-column property="fullNum" align="left" min-width="100" label="计算天数" show-overflow-tooltip />
+            <el-table-column align="center" label="操作" min-width="80" show-overflow-tooltip fixed="right">
+              <template slot-scope="scope">
+                <el-button type="text" class="textColor" @click="handLogistics(scope.row)">查看</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </div>
     <!-- 分页 -->
     <div class="fr">
       <el-pagination
@@ -297,7 +390,7 @@
           :key="index"
           placement="top"
           type="success"
-          :timestamp="item.time"
+          :stock-timestamp="item.time"
         >
           <el-row :gutter="20">
             <el-col class="logistics-title"> {{ item.status }} </el-col>
@@ -327,7 +420,8 @@ import {
   getNoticeDetail,
   confirmCheck,
   getRebateOrderList,
-  getListInvoiceOrder
+  getListInvoiceOrder,
+  getStockCostList
 } from '@/api/dashboard'
 import { getArrivalNotice } from '@/api/stock'
 import { getListOrderTrack } from '@/api/supply/pickup'
@@ -348,12 +442,15 @@ export default {
       inDialog: false,
       detailData: [],
       rebateList: [],
+      stockCostList: [],
       invoiceOrderList: [],
       visible: false,
       orderId: '',
       logisticsDetail: [],
       arrivalNoticeList: [],
       specification: '',
+      stockOrderNo: '',
+      stockTimes: [],
       invoiceOrderForm: {
         time: [],
         invoiceId: '',
@@ -363,7 +460,7 @@ export default {
         remark: '',
         userName: ''
       },
-      fnArr: ['getDataList', 'getFileList', 'getRebateList', 'getListInvoiceOrder', 'getArrivalNotice']
+      fnArr: ['getDataList', 'getFileList', 'getRebateList', 'getListInvoiceOrder', 'getArrivalNotice', 'getStockCostList']
     }
   },
   computed: {
@@ -387,7 +484,7 @@ export default {
       this.pageSize = 10
       this.currentPage = 1
       this.listLoading = false
-      this[this.fnArr[i]]()
+      this.fnArr[i] && this[this.fnArr[i]]()
     },
     // 获取文件列表数据
     async getFileList() {
@@ -447,12 +544,34 @@ export default {
       this.arrivalNoticeList = res.data.records
       this.listTotal = res.data.total
     },
+    // 订单满货通知
+    async getStockCostList() {
+      const time = this.stockTimes || []
+
+      const data = {
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        materialName: '',
+        materialNumber: '',
+        materialOldNumber: this.stockOrderNo,
+        specification: '',
+        endTime: time.length ? time[0] : '',
+        startTime: time.length ? time[1] : ''
+      }
+      const res = await getStockCostList(data)
+      this.stockCostList = res.data.records
+      this.listTotal = res.data.total
+    },
     handleReset(e, type) {
       this.pageSize = 10
       this.pageNum = 1
-      if (type) {
+      if (type === 'invoiceOrde') {
         this.$refs.invoiceOrderForm.resetFields()
         this.getListInvoiceOrder()
+      } else if (type === 'stockCost') {
+        this.stockOrderNo = ''
+        this.stockTimes = []
+        this.getStockCostList()
       } else {
         this.specification = ''
         this.getArrivalNotice()

+ 23 - 1
src/utils/common.js

@@ -134,8 +134,30 @@ export const debounce = (fn, delay = 1000) => {
     }, delay)
   }
 }
-
+/**
+ * 深拷贝
+ * @param
+ * @returns
+ */
+export const deepClone = obj => {
+  //判断拷贝的要进行深拷贝的是数组还是对象,是数组的话进行数组拷贝,对象的话进行对象拷贝
+  var objClone = Array.isArray(obj) ? [] : {}
+  //进行深拷贝的不能为空,并且是对象或者是
+  if (obj && typeof obj === 'object') {
+    for (let key in obj) {
+      if (obj.hasOwnProperty(key)) {
+        if (obj[key] && typeof obj[key] === 'object') {
+          objClone[key] = deepClone(obj[key])
+        } else {
+          objClone[key] = obj[key]
+        }
+      }
+    }
+  }
+  return objClone
+}
 export default {
+  deepClone,
   successMsg,
   errorMsg,
   warningNotify,

+ 118 - 0
src/views/basic_data/dailyWarehouseRent.vue

@@ -0,0 +1,118 @@
+
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :operation="operation()"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+    :default-search-data="searchData"
+  />
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+
+import { getStockCostListCustomer, getStockCostListCustomerV2Export, updateOrderFull } from '@/api/basic_data/dailyWarehouseRent'
+
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      detailsId: '',
+      searchData: []
+    }
+  },
+  watch: {
+    $route(val, oval) {
+      if (val && this.$route.path === '/basic_data/dailyWarehouseRent') {
+        if (this.$route.query.yearTime) {
+          this.searchData = [
+            {
+              param: 'yearTime',
+              compare: 'like',
+              value: val.query.yearTime
+            },
+            {
+              param: 'monthTime',
+              compare: 'like',
+              value: val.query.monthTime
+            },
+            {
+              param: 'customerNumber',
+              compare: 'like',
+              value: val.query.customerNumber
+            }
+          ]
+        }
+      }
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getStockCostListCustomer(...p)
+    },
+    // 列表导出函数
+    exportList: getStockCostListCustomerV2Export,
+    // 表格列解析渲染数据更改
+    columnParsing(_item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (_h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            {!this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm title='确定剔除吗?' onOnConfirm={() => {
+                updateOrderFull({ id: row.orderFullCostId }).then(res => {
+                  this.$refs.pageRef.refreshList()
+
+                  this.$successMsg('剔除成功')
+                })
+              }}>
+                <el-button slot='reference' type='text'>
+                  剔除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 97 - 0
src/views/basic_data/monthlyWarehouseRent.vue

@@ -0,0 +1,97 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :get-list="getList"
+    :export-list="exportList"
+    :operation="operation()"
+    :options-evens-group="optionsEvensGroup"
+    :column-parsing="columnParsing"
+  />
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import { getStockCostListMonthFullCost, getStockCostListMonthFullCostExport } from '@/api/basic_data/monthlyWarehouseRent'
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, add_callback_mixin],
+  data() {
+    return {
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '月账单更新',
+              click: () => {
+                this.$refs.pageRef.refreshList()
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      detailsId: ''
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getStockCostListMonthFullCost(...p)
+    },
+    // 列表导出函数
+    exportList: getStockCostListMonthFullCostExport,
+    // 表格列解析渲染数据更改
+    columnParsing(_item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (_h, { row, index, column }) => {
+        return (
+          <div class='operation-btns'>
+            <el-button
+              size='mini'
+              type='text'
+              onClick={ () => {
+                if (!(row.yearTime && row.monthTime && row.customerNumber)) {
+                  this.$errorMsg('错误数据')
+                  return
+                }
+                this.$router.push(`/basic_data/dailyWarehouseRent?yearTime=${row.yearTime}&monthTime=${row.monthTime}&customerNumber=${row.customerNumber}`)
+              }}
+            >
+              明细
+            </el-button>
+          </div>
+        )
+      }
+    },
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 85 - 52
src/views/setting/other.vue

@@ -9,7 +9,9 @@
       <el-radio-button label="sixth">机型类别</el-radio-button>
       <el-radio-button label="seventh">登录类型</el-radio-button>
       <el-radio-button label="eigth">权限分类</el-radio-button>
-      <el-radio-button label="receipt" v-if="$checkBtnRole('receipt', $route.meta.roles)">发票</el-radio-button>
+      <el-radio-button v-if="$checkBtnRole('receipt', $route.meta.roles)" label="receipt">发票</el-radio-button>
+      <el-radio-button label="warehouse">仓租费配置</el-radio-button>
+
     </el-radio-group>
 
     <div v-show="formType === 'first'">
@@ -21,7 +23,7 @@
           size="small"
           format="HH:mm"
           style="width: 150px; margin: 0 10px"
-        ></el-time-picker>
+        />
         <span>的订单,订单日期计为下一天的日期</span>
       </div>
       <el-button type="primary" size="small" @click="submitForm('first')">确 定</el-button>
@@ -36,7 +38,7 @@
             placeholder="请输入密码"
             size="small"
             style="width: 150px; margin-top: 20px"
-          ></el-input>
+          />
         </div>
       </div>
       <el-button type="primary" size="small" @click="submitForm('second')">确 定</el-button>
@@ -49,10 +51,10 @@
         <el-input
           v-model="thirdForm.input1.dictValue"
           type="number"
-          @mousewheel.native.prevent
           size="small"
           style="width: 150px; margin-top: 20px; margin-right: 10px"
-        ></el-input>
+          @mousewheel.native.prevent
+        />
         <span>天零时起,按商家提交订单时间顺序,自动生成预留单</span>
       </div>
       <div style="margin: 40px 0 30px">
@@ -61,10 +63,10 @@
         <el-input
           v-model="thirdForm.input2.dictValue"
           type="number"
-          @mousewheel.native.prevent
           size="small"
           style="width: 150px; margin-top: 20px; margin-right: 10px"
-        ></el-input>
+          @mousewheel.native.prevent
+        />
         <span>天零时起,按商家提交订单时间顺序,自动生成预留单</span>
       </div>
       <el-button type="primary" size="small" @click="submitForm('third')">确 定</el-button>
@@ -80,18 +82,18 @@
           <el-input
             v-model="fourthForm.input1.dictValue"
             type="number"
-            @mousewheel.native.prevent
             size="small"
             style="width: 100px; margin: 0 10px"
-          ></el-input>
+            @mousewheel.native.prevent
+          />
           <span>到</span>
           <el-input
             v-model="fourthForm.input2.dictValue"
             type="number"
-            @mousewheel.native.prevent
             size="small"
             style="width: 100px; margin: 0 10px"
-          ></el-input>
+            @mousewheel.native.prevent
+          />
           <span>,总库存显示具体数量</span>
         </div>
         <div style="margin-top: 10px">
@@ -99,18 +101,18 @@
           <el-input
             v-model="fourthForm.input3.dictValue"
             type="number"
-            @mousewheel.native.prevent
             size="small"
             style="width: 100px; margin: 0 10px"
-          ></el-input>
+            @mousewheel.native.prevent
+          />
           <span>到</span>
           <el-input
             v-model="fourthForm.input4.dictValue"
             type="number"
-            @mousewheel.native.prevent
             size="small"
             style="width: 100px; margin: 0 10px"
-          ></el-input>
+            @mousewheel.native.prevent
+          />
           <span>,总库存显示有货</span>
         </div>
         <div style="margin-top: 10px">
@@ -118,10 +120,10 @@
           <el-input
             v-model="fourthForm.input5.dictValue"
             type="number"
-            @mousewheel.native.prevent
             size="small"
             style="width: 100px; margin: 0 10px"
-          ></el-input>
+            @mousewheel.native.prevent
+          />
           <span>,总库存显示充足</span>
         </div>
         <div style="margin-top: 30px">发货申请查询库存时:</div>
@@ -130,10 +132,10 @@
           <el-input
             v-model="fourthForm.input6.dictValue"
             type="number"
-            @mousewheel.native.prevent
             size="small"
             style="width: 100px; margin: 0 10px"
-          ></el-input>
+            @mousewheel.native.prevent
+          />
           <span>显示充足</span>
         </div>
       </div>
@@ -149,7 +151,7 @@
             placeholder="请输入密码"
             size="small"
             style="width: 150px; margin-top: 20px"
-          ></el-input>
+          />
         </div>
       </div>
       <el-button type="primary" size="small" @click="submitForm('fifth')">确 定</el-button>
@@ -176,24 +178,24 @@
                 prop="dictCode"
                 min-width="160"
                 show-overflow-tooltip
-              ></el-table-column>
+              />
               <el-table-column
                 align="left"
                 label="备注"
                 prop="remark"
                 min-width="170"
                 show-overflow-tooltip
-              ></el-table-column>
+              />
 
               <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
                 <template slot-scope="scope">
                   <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
                   <el-popconfirm
-                    @onConfirm="deleFn(scope.row.sysDictId)"
                     v-if="$checkBtnRole('del', $route.meta.roles)"
                     title="这是一段内容确定删除吗?"
+                    @onConfirm="deleFn(scope.row.sysDictId)"
                   >
-                    <el-button type="text" class="textColor" slot="reference">删除</el-button>
+                    <el-button slot="reference" type="text" class="textColor">删除</el-button>
                   </el-popconfirm>
                 </template>
               </el-table-column>
@@ -223,24 +225,24 @@
                 prop="dictCode"
                 min-width="160"
                 show-overflow-tooltip
-              ></el-table-column>
+              />
               <el-table-column
                 align="left"
                 label="备注"
                 prop="remark"
                 min-width="170"
                 show-overflow-tooltip
-              ></el-table-column>
+              />
 
               <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
                 <template slot-scope="scope">
                   <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
                   <el-popconfirm
-                    @onConfirm="deleFn(scope.row.sysDictId)"
                     v-if="$checkBtnRole('del', $route.meta.roles)"
                     title="这是一段内容确定删除吗?"
+                    @onConfirm="deleFn(scope.row.sysDictId)"
                   >
-                    <el-button type="text" class="textColor" slot="reference">删除</el-button>
+                    <el-button slot="reference" type="text" class="textColor">删除</el-button>
                   </el-popconfirm>
                 </template>
               </el-table-column>
@@ -270,24 +272,24 @@
                 prop="dictCode"
                 min-width="160"
                 show-overflow-tooltip
-              ></el-table-column>
+              />
               <el-table-column
                 align="left"
                 label="备注"
                 prop="remark"
                 min-width="170"
                 show-overflow-tooltip
-              ></el-table-column>
+              />
 
               <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
                 <template slot-scope="scope">
                   <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
                   <el-popconfirm
-                    @onConfirm="deleFn(scope.row.sysDictId)"
                     v-if="$checkBtnRole('del', $route.meta.roles)"
                     title="这是一段内容确定删除吗?"
+                    @onConfirm="deleFn(scope.row.sysDictId)"
                   >
-                    <el-button type="text" class="textColor" slot="reference">删除</el-button>
+                    <el-button slot="reference" type="text" class="textColor">删除</el-button>
                   </el-popconfirm>
                 </template>
               </el-table-column>
@@ -308,20 +310,32 @@
           start-placeholder="开始日期"
           end-placeholder="结束日期"
           style="margin: 0 10px"
-        >
-        </el-date-picker>
+        />
         <el-button size="mini" type="warning" icon="el-icon-finished" @click="updateReceipt">更新发票</el-button>
       </div>
     </div>
-
+    <div v-show="formType === 'warehouse'">
+      <div style="margin: 40px 0 30px;">
+        <span>总库存大于</span>
+        <el-input
+          v-model.number="stockCostDict.dictValue"
+          type="number"
+          style="width: 150px; margin: 0 10px"
+          placeholder=""
+          size="mini"
+        />
+        <span>才开始标记计算经销商订单相应机型仓租费用</span>
+      </div>
+      <el-button type="primary" size="small" @click="submitStockForm">确 定</el-button>
+    </div>
     <!-- //弹窗 -->
     <el-dialog :title="title" :visible.sync="dialogForm" width="30%" :show-close="false" :close-on-click-modal="false">
-      <el-form size="mini" ref="addForm" :rules="rules" :model="addForm" label-width="120px">
+      <el-form ref="addForm" size="mini" :rules="rules" :model="addForm" label-width="120px">
         <el-form-item label="名称" prop="dictCode">
-          <el-input v-model="addForm.dictCode"></el-input>
+          <el-input v-model="addForm.dictCode" />
         </el-form-item>
         <el-form-item label="备注" prop="remark">
-          <el-input v-model="addForm.remark"></el-input>
+          <el-input v-model="addForm.remark" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -333,7 +347,7 @@
 </template>
 
 <script>
-import { getDictList, editDictList, addDictList, deleDictList, updateReceipt } from '@/api/common'
+import { getDictList, editDictList, addDictList, deleDictList, updateReceipt, getStockCostDict, updateStockCostDict } from '@/api/common'
 
 export default {
   data() {
@@ -370,6 +384,7 @@ export default {
       fifthForm: {
         input1: {}
       },
+      stockCostDict: {},
       sixthForm: [],
       seventhForm: [],
       eigthForm: [],
@@ -395,13 +410,13 @@ export default {
     this.getDetail('first')
   },
   methods: {
-    //删除
+    // 删除
     async deleFn(id) {
       await deleDictList({ id: id })
       this.$message.success('删除成功')
       this.getDetail(this.formType)
     },
-    //编辑
+    // 编辑
     editFn(value) {
       this.$nextTick(() => {
         this.title = '编辑'
@@ -413,14 +428,14 @@ export default {
 
       this.dialogForm = true
     },
-    //弹窗确定
+    // 弹窗确定
     async addDataFn() {
       // console.log(this.addForm);
 
       await this.$refs.addForm.validate()
 
       if (this.addForm.sysDictId) {
-        //编辑
+        // 编辑
         await editDictList([
           {
             ...this.addForm
@@ -451,7 +466,7 @@ export default {
       }
       this.dialogForm = false
     },
-    //cancelFn 弹窗取消
+    // cancelFn 弹窗取消
     async cancelFn() {
       await this.$refs.addForm.resetFields()
 
@@ -462,13 +477,13 @@ export default {
       this.dialogForm = false
       // this.addForm.dictCode ='';
     },
-    //展示新增弹窗
+    // 展示新增弹窗
     addShowFn() {
       this.title = '新增'
       this.dialogForm = true
     },
     // 查询按钮权限
-    checkBtnRole(value) {
+    checkBtnRole(_value) {
       // let btnRole = this.$route.meta.roles;
       // if(!btnRole) {return true}
       // let index = btnRole.indexOf(value);
@@ -478,13 +493,21 @@ export default {
 
     changeType(val) {
       if (this.formType === 'receipt') return
-      console.log(val)
+      if (val === 'warehouse') {
+        this.getStockCostDict()
+        return
+      }
       this.getDetail(val)
     },
+    getStockCostDict() {
+      getStockCostDict().then(res => {
+        res.data.dictValue = +res.data.dictValue
+        this.stockCostDict = res.data
+      })
+    },
     getDictList(e, type) {
       getDictList({ sysDictEnum: e }).then(res => {
-        console.log(res, '99')
-        let data = res.data.map(item => {
+        const data = res.data.map(item => {
           return {
             sysDictId: item.sysDictId,
             dictValue: item.dictValue,
@@ -549,7 +572,7 @@ export default {
     },
 
     submitForm(type) {
-      let list = []
+      const list = []
       for (var key in this[type + 'Form']) {
         console.log(this[type + 'Form'], this[type + 'Form'][key].dictValue)
         if (!this[type + 'Form'][key].dictValue) {
@@ -559,7 +582,7 @@ export default {
       }
       console.log(list, '890')
 
-      editDictList(list).then(res => {
+      editDictList(list).then(_res => {
         this.$successMsg('保存成功')
         this.getDetail(type)
       })
@@ -572,10 +595,20 @@ export default {
       updateReceipt({
         startTime: this.value1[0],
         endTime: this.value1[1]
-      }).then(res => {
+      }).then(_res => {
         this.$successMsg('已更新')
         this.value1 = ''
       })
+    },
+    submitStockForm() {
+      if (!this.stockCostDict.dictValue) {
+        this.$errorMsg('请输入总库存')
+        return
+      }
+      updateStockCostDict({ dictValue: this.stockCostDict.dictValue }).then(_res => {
+        this.getStockCostDict()
+        this.$successMsg('已更新')
+      })
     }
   }
 }