فهرست منبع

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

FengChaoYu 3 سال پیش
والد
کامیت
2fe619343c
57فایلهای تغییر یافته به همراه890 افزوده شده و 667 حذف شده
  1. 45 31
      src/api/finance/rebate_form.js
  2. 9 0
      src/api/supply/retail.js
  3. 22 1
      src/api/user.js
  4. 2 99
      src/filters/index.js
  5. 3 1
      src/main.js
  6. 16 1
      src/utils/common.js
  7. 1 128
      src/utils/select_data.js
  8. 9 3
      src/views/basic_data/dealer/dealer_deposit.vue
  9. 12 2
      src/views/basic_data/dealer/dealer_stock.vue
  10. 2 0
      src/views/basic_data/taker/taker_car.vue
  11. 7 1
      src/views/basic_data/taker/taker_list.vue
  12. 23 16
      src/views/finance/change_apply.vue
  13. 7 2
      src/views/finance/components/rebate_list-apply.vue
  14. 98 8
      src/views/finance/components/rebate_list-confirm.vue
  15. 3 0
      src/views/finance/components/rebate_list-edit.vue
  16. 48 1
      src/views/finance/rebate_form.vue
  17. 25 7
      src/views/finance/rebate_list.vue
  18. 2 0
      src/views/finance/receivable_list.vue
  19. 2 0
      src/views/issue/index.vue
  20. 31 91
      src/views/login/index.vue
  21. 1 1
      src/views/stock/reserved_stock.vue
  22. 1 1
      src/views/stock/stock_list.vue
  23. 6 6
      src/views/supply/apply/apply_list.vue
  24. 15 13
      src/views/supply/apply/components/apply_form.vue
  25. 1 1
      src/views/supply/apply/components/engin_detail.vue
  26. 18 15
      src/views/supply/apply/components/engin_form.vue
  27. 6 6
      src/views/supply/apply/engin_list.vue
  28. 3 3
      src/views/supply/deliver/commerce_list.vue
  29. 28 14
      src/views/supply/deliver/components/commerce_detail.vue
  30. 27 13
      src/views/supply/deliver/components/deliver_detail.vue
  31. 27 13
      src/views/supply/deliver/components/home_detail.vue
  32. 3 3
      src/views/supply/deliver/deliver_list.vue
  33. 1 1
      src/views/supply/deliver/home_list.vue
  34. 4 13
      src/views/supply/direct/direct_list.vue
  35. 10 8
      src/views/supply/engin/commerce_list.vue
  36. 21 20
      src/views/supply/engin/components/commerce_detail.vue
  37. 2 1
      src/views/supply/engin/components/commerce_examine.vue
  38. 18 3
      src/views/supply/engin/components/commerce_form.vue
  39. 1 1
      src/views/supply/engin/components/commerce_return.vue
  40. 21 20
      src/views/supply/engin/components/home_detail.vue
  41. 2 1
      src/views/supply/engin/components/home_examine.vue
  42. 18 3
      src/views/supply/engin/components/home_form.vue
  43. 1 1
      src/views/supply/engin/components/home_return.vue
  44. 6 15
      src/views/supply/engin/engin_list.vue
  45. 8 15
      src/views/supply/engin/home_list.vue
  46. 5 5
      src/views/supply/pickup/pickup_list.vue
  47. 6 6
      src/views/supply/pickup/sum_list.vue
  48. 41 30
      src/views/supply/policy/components/retail_detail.vue
  49. 7 0
      src/views/supply/policy/components/retail_examine.vue
  50. 8 0
      src/views/supply/policy/components/retail_form2.vue
  51. 1 7
      src/views/supply/policy/policy_list.vue
  52. 3 12
      src/views/supply/reserve/reserve_list.vue
  53. 175 1
      src/views/supply/retail/components/retail_detail.vue
  54. 17 3
      src/views/supply/retail/components/retail_form.vue
  55. 8 17
      src/views/supply/retail/retail_list.vue
  56. 1 1
      src/views/supply/return/return_list.vue
  57. 2 2
      src/views/supply/sales/sales_list.vue

+ 45 - 31
src/api/finance/rebate_form.js

@@ -1,41 +1,55 @@
-import request from '@/utils/request'
+import request from "@/utils/request";
 // 经销商列表
 export function getCustomerList(params) {
-    return request({
-      url: '/customer/list',
-      method: 'get',
-      params
-    })
-  }
+  return request({
+    url: "/customer/list",
+    method: "get",
+    params,
+  });
+}
 // 经销商钱包列表
 export function getWalletCustomerList(params) {
-    return request({
-      url: '/wallet/customer/list',
-      method: 'get',
-      params
-    })
-  }
+  return request({
+    url: "/wallet/customer/list",
+    method: "get",
+    params,
+  });
+}
 // 新增
 export function getRebateOrderAdd(data) {
-    return request({
-      url: '/rebate/order/add',
-      method: 'post',
-      data
-    })
-  }
+  return request({
+    url: "/rebate/order/add",
+    method: "post",
+    data,
+  });
+}
 // 提审
 export function getRebateOrderApply(params) {
-    return request({
-      url: '/rebate/order/apply',
-      method: 'post',
-      params
-    })
-  }
+  return request({
+    url: "/rebate/order/apply",
+    method: "post",
+    params,
+  });
+}
 // 列表
 export function getRebateOrderList(params) {
-    return request({
-      url: '/rebate/order/list',
-      method: 'get',
-      params
-    })
-  }
+  return request({
+    url: "/rebate/order/list",
+    method: "get",
+    params,
+  });
+}
+// 下载销售返利单模板
+export function getRebateOrderDownLoad() {
+  return request({
+    url: "/rebate/order/download",
+    method: "get",
+  });
+}
+// 导入销售返利单数据
+export function getRebateOrderImport() {
+  return request({
+    url: "/rebate/order/import",
+    method: "post",
+  });
+}

+ 9 - 0
src/api/supply/retail.js

@@ -133,4 +133,13 @@ export function finishData(params) {
     method: 'post',
     params
   })
+}
+
+// 提前开票
+export function directOrder(params) {
+  return request({
+    url: '/requisition/add',
+    method: 'post',
+    data: params
+  })
 }

+ 22 - 1
src/api/user.js

@@ -1,3 +1,4 @@
+
 import request from '@/utils/request'
 
 // 登录
@@ -41,4 +42,24 @@ export function getCode() {
     url: '/admin/user/imageVerification',
     method: 'get',
   })
-}
+}
+
+// 获取轮播图
+
+
+export function getList() {
+  return request({
+    url: '/record/list',
+    method: 'get',
+  })
+}
+
+// 公司列表
+
+
+export function getCompanyList() {
+  return request({
+    url: '/record/company/list',
+    method: 'get',
+  })
+}

+ 2 - 99
src/filters/index.js

@@ -1,7 +1,6 @@
 
-import {
-  COMMON_SELECT
-} from '@/utils/select_data'
+import { COMMON_SELECT } from '@/utils/select_data'
+import { getDictList } from '@/api/common'
 
 /**
  * Show plural label if time is plural number
@@ -112,105 +111,9 @@ export function passwordFilter(value) {
 }
 
 /**
- * 会员的当前状态
- */
-export function MEMBER_CURRENT_STATUS_FILTER(value) {
-  let obj = COMMON_SELECT.MEMBER_CURRENT_STATUS.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 会员的类型
- */
-export function MEMBER_CURRENT_TYPE_FILTER(value) {
-  let obj = COMMON_SELECT.MEMBER_CURRENT_TYPE.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
  * 订单状态
  */
 export function ORDER_CURRENT_STATUS_FILTER(value) {
   let obj = COMMON_SELECT.ORDER_CURRENT_STATUS.find(o => o.value === value);
   return obj ? obj.label : ''
-}
-
-/**
- * 物流状态
- */
-export function EXPRESS_CURRENT_STATE_FILTER(value) {
-  let obj = COMMON_SELECT.EXPRESS_CURRENT_STATE.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 维护订单状态
- */
-export function ORDER_REFUND_CURRENT_STATUS_FILTER(value) {
-  let obj = COMMON_SELECT.ORDER_REFUND_CURRENT_STATUS.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 结算状态
- */
-export function SETTLEMENT_CURRENT_STATUS_FILTER(value) {
-  let obj = COMMON_SELECT.SETTLEMENT_CURRENT_STATUS.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 退款方式
- */
-export function REFUND_CURRENT_TYPE_FILTER(value) {
-  let obj = COMMON_SELECT.REFUND_CURRENT_TYPE.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 券标志
- */
-export function COUPON_CURRENT_FLAG_FILTER(value) {
-  let obj = COMMON_SELECT.COUPON_CURRENT_FLAG.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 秒杀活动状态
- */
-export function SEC_KILL_CURRENT_STATUS_FILTER(value) {
-  let obj = COMMON_SELECT.SEC_KILL_CURRENT_STATUS.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 消息类型
- */
-export function NOTICE_CURRENT_TYPE_FILTER(value) {
-  let obj = COMMON_SELECT.NOTICE_CURRENT_TYPE.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 线下销售状态
- */
- export function OFFLINE_STATUS_FILTER(value) {
-  let obj = COMMON_SELECT.OFFLINE_STATUS.find(o => o.value == value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 线下销售类型
- */
- export function OFFLINE_TYPE_FILTER(value) {
-  let obj = COMMON_SELECT.OFFLINE_TYPE.find(o => o.value === value);
-  return obj ? obj.label : ''
-}
-
-/**
- * 优惠码状态
- */
- export function DISCODE_STATUS_FILTER(value) {
-  let obj = COMMON_SELECT.DISCODE_STATUS.find(o => o.value === value);
-  return obj ? obj.label : ''
 }

+ 3 - 1
src/main.js

@@ -21,11 +21,13 @@ import '@/permission' // permission control
 import * as filters from './filters' // global filters
 
 // 成功/错误提示
-import {successMsg, errorMsg, warningNotify} from '@/utils/common.js'
+import {successMsg, errorMsg, warningNotify, checkBtnRole} from '@/utils/common.js'
 Vue.prototype.$successMsg = successMsg;
 Vue.prototype.$errorMsg = errorMsg;
 Vue.prototype.$warningNotify = warningNotify;
 
+Vue.prototype.$checkBtnRole = checkBtnRole;
+
 // 自定义组件
 import ExportButton from '@/components/Common/export-button.vue'
 Vue.component('ExportButton', ExportButton);

+ 16 - 1
src/utils/common.js

@@ -1,5 +1,7 @@
 
 import { MessageBox, Message, Notification } from 'element-ui'
+import {useRouter, useRoute} from 'vue-router'
+import router from '@/router'
 
 export const successMsg = msg => {
 	Message({
@@ -26,8 +28,21 @@ export const warningNotify = msg => {
   });
 };
 
+/**
+ * 查询按钮权限
+ * @param {*} value 当前按钮对应code
+ * @param {*} btnRole 当前路由所有按钮权限
+ * @returns 
+ */
+export const checkBtnRole = (value, btnRole) => {
+  if(!btnRole) {return true}
+  let index = btnRole.indexOf(value);
+  return index >= 0;
+};
+
 export default {
   successMsg,
   errorMsg,
-  warningNotify
+  warningNotify,
+  checkBtnRole
 }

+ 1 - 128
src/utils/select_data.js

@@ -3,32 +3,6 @@
  * 管理下拉框选项
  */
 
-// 会员的当前状态
-export const MEMBER_CURRENT_STATUS = [
-  { label: '正常', value: true },
-  { label: '禁用', value: false }
-]
-
-// 会员的当前类型
-export const MEMBER_CURRENT_TYPE = [
-  { label: '普通用户', value: 'GENERAL' },
-  { label: '业务员', value: 'SERVICE' }
-]
-
-// 结算的当前状态
-export const SETTLEMENT_CURRENT_STATUS = [
-  { label: '结算中', value: 'ING' },
-  { label: '已结算', value: 'OVER' },
-  { label: '已取消', value: 'CANCEL' },
-  { label: '异常结算', value: 'EXCEPTION' },
-]
-
-// 运费模板的当前状态
-export const FREIGHT_CURRENT_TYPE = [
-  { label: '启用', value: true },
-  { label: '禁用', value: false }
-]
-
 // 订单的当前状态
 export const ORDER_CURRENT_STATUS = [
   { label: '待付款', value: 'NOPAY' },
@@ -40,108 +14,7 @@ export const ORDER_CURRENT_STATUS = [
   { label: '售后', value: 'REFUND' },
 ]
 
-// 物流的当前状态
-export const EXPRESS_CURRENT_STATE = [
-  { label: '在途', value: 0 },
-  { label: '揽收', value: 1 },
-  { label: '疑难', value: 2 },
-  { label: '签收', value: 3 },
-  { label: '退签', value: 4 },
-  { label: '派件', value: 5 },
-  { label: '退回', value: 6 }
-]
-
-// 维权订单的当前状态
-export const ORDER_REFUND_CURRENT_STATUS = [
-  { label: '待商家处理', value: 'DSJCL' },
-  { label: '待商家收货', value: 'DSJSH' },
-  { label: '待买家处理', value: 'DMJCL' },
-  { label: '已完成', value: 'OVER' },
-  { label: '已取消', value: 'CANCEL' },
-  { label: '已关闭', value: 'CLOSE' },
-]
-
-// 维权订单的当前类型
-export const REFUND_CURRENT_TYPE = [
-  { label: '仅退款', value: 'REFUND_AMOUNT' },
-  { label: '退货退款', value: 'REFUND_GOODS' }
-]
-
-// 优惠券的当前标志
-export const COUPON_CURRENT_FLAG = [
-  { label: '待发布', value: 'WAIT' },
-  { label: '进行中', value: 'START' },
-  { label: '已结束', value: 'END' },
-  { label: '已取消', value: 'CANCEL' }
-]
-
-// 秒杀活动状态
-export const SEC_KILL_CURRENT_STATUS = [
-  { label: '未开始', value: 1 },
-  { label: '进行中', value: 2 },
-  { label: '已结束', value: 3 },
-  { label: '已关闭', value: 4 },
-]
-
-// 消息类型
-export const NOTICE_CURRENT_TYPE = [
-  { label: '订单', value: 1 },
-  { label: '其他', value: 2 }
-]
-
-// 工单大类
-export const ORDER_MAIN_TYPE = [
-  {id: 101, number: 101, name: '家用空调'},
-  {id: 102, number: 102, name: '商用空调'},
-  {id: 103, number: 103, name: '家用空气能热水器'},
-  {id: 104, number: 104, name: '生活电器'},
-  {id: 106, number: 106, name: '晶弘冰箱'},
-  {id: 107, number: 107, name: '手机'},
-  {id: 108, number: 108, name: '回收平台'},
-  {id: 109, number: 109, name: '壁挂炉'},
-  {id: 110, number: 110, name: '智能门锁'},
-  {id: 111, number: 111, name: '移动电源'},
-  {id: 112, number: 112, name: '格健医疗'},
-  {id: 113, number: 133, name: '商用净水机'},
-  // {id: 114, number: 110, name: '螺杆机'},
-  {id: 999, number: 999, name: '清洗服务'},
-]
-
-// 线下销售状态
-export const OFFLINE_STATUS = [
-  { label: '正常', value: 1 },
-  { label: '作废', value: 0 }
-]
-
-// 线下销售类型
-export const OFFLINE_TYPE = [
-  { label: '工程', value: 'PROJECT' },
-  { label: '二手', value: 'RESALE' },
-  { label: '批发', value: 'WHOLESALE' },
-  // { label: '线上', value: 'ONLINE' },
-  { label: '零售', value: 'RETAIL' },
-]
-
-// 优惠码状态
-export const DISCODE_STATUS = [
-  { label: '未使用', value: 0 },
-  { label: '已使用', value: 1 }
-]
 
 export const COMMON_SELECT = {
-  MEMBER_CURRENT_STATUS,
-  MEMBER_CURRENT_TYPE,
-  SETTLEMENT_CURRENT_STATUS,
-  FREIGHT_CURRENT_TYPE,
-  ORDER_CURRENT_STATUS,
-  EXPRESS_CURRENT_STATE,
-  ORDER_REFUND_CURRENT_STATUS,
-  REFUND_CURRENT_TYPE,
-  COUPON_CURRENT_FLAG,
-  SEC_KILL_CURRENT_STATUS,
-  NOTICE_CURRENT_TYPE,
-  ORDER_MAIN_TYPE,
-  OFFLINE_STATUS,
-  OFFLINE_TYPE,
-  DISCODE_STATUS
+  ORDER_CURRENT_STATUS
 }

+ 9 - 3
src/views/basic_data/dealer/dealer_deposit.vue

@@ -45,7 +45,13 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" size="small" @click="addFn">新增</el-button>
+        <el-button
+          v-if="$checkBtnRole('add', $router.meta.roles)"
+          type="primary"
+          size="small"
+          @click="addFn"
+          >新增</el-button
+        >
       </div>
     </div>
 
@@ -563,5 +569,5 @@ export default {
 // .main {
 //   padding: 12px;
 // }
-</style>>
-
+</style>
+>

+ 12 - 2
src/views/basic_data/dealer/dealer_stock.vue

@@ -33,9 +33,19 @@
 
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" size="small" @click="addFn">新增</el-button>
+        <el-button
+          v-if="$checkBtnRole('add', $router.meta.roles)"
+          type="primary"
+          size="small"
+          @click="addFn"
+          >新增</el-button
+        >
 
-        <el-popconfirm @onConfirm="deleFn" title="这是一段内容确定删除吗?">
+        <el-popconfirm
+          v-if="$checkBtnRole('del', $router.meta.roles)"
+          @onConfirm="deleFn"
+          title="这是一段内容确定删除吗?"
+        >
           <el-button
             type="primary"
             size="small"

+ 2 - 0
src/views/basic_data/taker/taker_car.vue

@@ -42,6 +42,7 @@
     <div class="btn-group clearfix">
       <div class="fl">
         <el-button
+          v-if="$checkBtnRole('add', $router.meta.roles)"
           type="primary"
           icon="el-icon-plus"
           size="small"
@@ -50,6 +51,7 @@
         >
 
         <el-popconfirm
+          v-if="$checkBtnRole('del', $router.meta.roles)"
           class="delClass"
           @onConfirm="delFn"
           title="这是一段内容确定删除吗?"

+ 7 - 1
src/views/basic_data/taker/taker_list.vue

@@ -49,7 +49,13 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fl">
-        <el-button type="primary" size="small" @click="addFn">新增</el-button>
+        <el-button
+          v-if="$checkBtnRole('add', $router.meta.roles)"
+          type="primary"
+          size="small"
+          @click="addFn"
+          >新增</el-button
+        >
       </div>
       <div class="fr">
         <ExportButton :exUrl="'/taker-record/export'" :exParams="exParams" />

+ 23 - 16
src/views/finance/change_apply.vue

@@ -15,7 +15,7 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利互转单号" prop="">
-              <el-input placeholder="请输入" disabled></el-input>
+              <el-input disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
@@ -32,30 +32,24 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单人" prop="">
-              <el-input placeholder="请输入" disabled></el-input>
+              <el-input v-model="searchForm.nickName" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="经销商编号" prop="">
-              <el-input
-                placeholder="请输入"
-                v-model="searchForm.customerId"
-              ></el-input>
+              <el-input disabled v-model="searchForm.customerNumber"></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="经销商名称" prop="">
-              <el-input
-                placeholder="请输入"
-                v-model="searchForm.customerName"
-              ></el-input>
+              <el-input disabled v-model="searchForm.customerName"></el-input>
             </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 placeholder="请输入"></el-input>
             </el-form-item>
-          </el-col>
+          </el-col> -->
         </el-row>
       </el-form>
     </div>
@@ -135,7 +129,7 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.money"></el-input>
+              <el-input type="number" v-model="scope.row.money"></el-input>
             </template>
           </el-table-column>
           <el-table-column
@@ -196,6 +190,8 @@ export default {
       searchForm: {
         customerId: "",
         customerName: "",
+        nickName: "",
+        customerNumber: "",
         theTime: null,
       },
       customerData: [], //经销商数据
@@ -245,13 +241,22 @@ export default {
       if (v.customerId == "") {
         return;
       }
-      console.log(v, index, 123456789);
+
       v.name = "";
       let res = await getWalletCustomerList({
         customerId: v.customerId,
         type: "REBATE",
       });
-      this.$set(this.dataList[index], "typeList", res.data);
+
+      if (index == 1) {
+        let aa = res.data.filter(
+          (v) => v.customerWalletId != this.dataList[0].name
+        );
+        console.log(aa);
+        this.$set(this.dataList[index], "typeList", aa);
+      } else {
+        this.$set(this.dataList[index], "typeList", res.data);
+      }
     },
 
     // async typeFn(row) {
@@ -315,7 +320,7 @@ export default {
         amount = this.dataList[1].money;
       }
       await getTransferAdd({
-        theTime: this.theTime,
+        theTime: this.searchForm.theTime,
         receiverWalletRebateId,
         initiatorWalletRebateId,
         receiverRemark,
@@ -330,6 +335,8 @@ export default {
       this.searchForm.customerNumber = res.data.customerNumber;
       this.dataList[0].customerId = res.data.customerId;
       this.searchForm.customerName = res.data.customerName;
+      this.searchForm.customerNumber = res.data.customerNumber;
+      this.searchForm.nickName = res.data.nickName;
       // const res2 = await getWalletCustomerList({
       //   customerId: res.data.customerId,
       //   type: "REBATE",

+ 7 - 2
src/views/finance/components/rebate_list-apply.vue

@@ -374,14 +374,19 @@
         <el-col :span="12" class="item">
           <div class="label">审批结果</div>
           <div class="value">
-            <el-radio v-model="examineStatus" label="OK">通过</el-radio>
-            <el-radio v-model="examineStatus" label="FAIL">驳回</el-radio>
+            <el-radio disabled v-model="examineStatus" label="OK"
+              >通过</el-radio
+            >
+            <el-radio disabled v-model="examineStatus" label="FAIL"
+              >驳回</el-radio
+            >
           </div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">审批说明</div>
           <div class="value">
             <el-input
+              disabled
               v-model="examineRemark"
               placeholder="请输入内容"
             ></el-input>

+ 98 - 8
src/views/finance/components/rebate_list-confirm.vue

@@ -20,6 +20,7 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利单号" prop="">
               <el-input
+                disabled
                 v-model="searchForm.rebateOrderId"
                 placeholder="请输入"
               ></el-input>
@@ -28,6 +29,7 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="返利日期" prop="">
               <el-input
+                disabled
                 v-model="searchForm.theTime"
                 placeholder="请输入"
               ></el-input>
@@ -36,6 +38,7 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="备注" prop="">
               <el-input
+                disabled
                 v-model="searchForm.remark"
                 placeholder="请输入"
               ></el-input>
@@ -44,6 +47,7 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单人" prop="">
               <el-input
+                disabled
                 v-model="searchForm.createBy"
                 placeholder="请输入"
               ></el-input>
@@ -52,6 +56,7 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="制单日期" prop="">
               <el-input
+                disabled
                 v-model="searchForm.createTime"
                 placeholder="请输入"
               ></el-input>
@@ -59,12 +64,34 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="审批人" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                v-if="this.searchForm.secondExamineBy != null"
+                disabled
+                v-model="searchForm.secondExamineBy"
+                placeholder=""
+              ></el-input>
+              <el-input
+                v-else
+                disabled
+                v-model="searchForm.examineBy"
+                placeholder=""
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="审批日期" prop="">
-              <el-input placeholder="请输入"></el-input>
+              <el-input
+                v-if="this.searchForm.secondExamineTime != null"
+                disabled
+                v-model="searchForm.secondExamineTime"
+                placeholder=""
+              ></el-input>
+              <el-input
+                v-else
+                disabled
+                v-model="searchForm.examineTime"
+                placeholder=""
+              ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -115,7 +142,7 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.rebateAmount"></el-input>
+              <el-input v-model.number="scope.row.rebateAmount"></el-input>
             </template>
           </el-table-column>
           <el-table-column
@@ -126,7 +153,7 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.allowanceAmount"></el-input>
+              <el-input v-model.number="scope.row.allowanceAmount"></el-input>
             </template>
           </el-table-column>
           <el-table-column
@@ -140,8 +167,10 @@
       </div>
     </div>
     <br />
-    <el-button type="primary" size="small" @click="btnFn">确定</el-button>
-    <el-button type="primary" size="small" @click="resetFn">重置</el-button>
+    <div v-if="!isShow">
+      <el-button type="primary" size="small" @click="btnFn">确定</el-button>
+      <el-button type="primary" size="small" @click="resetFn">重置</el-button>
+    </div>
   </div>
 </template>
 
@@ -156,6 +185,10 @@ export default {
       type: String,
       required: true,
     },
+    isShow: {
+      type: Boolean,
+      required: true,
+    },
   },
   data() {
     return {
@@ -167,6 +200,7 @@ export default {
         remark: "",
       },
       dataList: [],
+      saveDataList: [],
       listLoading: false, // 列表加载loading
     };
   },
@@ -174,19 +208,69 @@ export default {
     this.getDataList();
   },
   methods: {
+    //深拷贝数据
+    deepCopy(data) {
+      //string,number,bool,null,undefined,symbol
+      //object,array,date
+      if (data && typeof data === "object") {
+        //针对函数的拷贝
+        if (typeof data === "function") {
+          let tempFunc = data.bind(null);
+          tempFunc.prototype = this.deepCopy(data.prototype);
+          return tempFunc;
+        }
+
+        switch (Object.prototype.toString.call(data)) {
+          case "[object String]":
+            return data.toString();
+          case "[object Number]":
+            return Number(data.toString());
+          case "[object Boolean]":
+            return new Boolean(data.toString());
+          case "[object Date]":
+            return new Date(data.getTime());
+          case "[object Array]":
+            var arr = [];
+            for (let i = 0; i < data.length; i++) {
+              arr[i] = this.deepCopy(data[i]);
+            }
+            return arr;
+
+          //js自带对象或用户自定义类实例
+          case "[object Object]":
+            var obj = {};
+            for (let key in data) {
+              //会遍历原型链上的属性方法,可以用hasOwnProperty来控制 (obj.hasOwnProperty(prop)
+              obj[key] = this.deepCopy(data[key]);
+            }
+            return obj;
+        }
+      } else {
+        //string,number,bool,null,undefined,symbol
+        return data;
+      }
+    },
+    //重置
+    resetFn() {
+      console.log(this.dataList, this.saveDataList);
+      this.dataList = this.saveDataList;
+      this.saveDataList = this.deepCopy(this.dataList);
+    },
     //确定
     async btnFn() {
       console.log(this.dataList);
       const res = this.dataList.map((v) => {
         return {
           allowanceAmount: v.allowanceAmount,
-          rebateAmount: v.amount,
+          rebateAmount: v.rebateAmount,
           itemId: v.id,
         };
       });
       console.log(res, 888);
       await getRebateOrderAck(res);
-      this.$message.success("确认成功");
+      // this.$emit("updateList");
+      // this.$message.success("确认成功");
+      // this.$parent.showPage = 1;
     },
     //获取详情数据
     async getDataList() {
@@ -197,7 +281,13 @@ export default {
       this.searchForm.createBy = res.data.createBy;
       this.searchForm.createTime = res.data.createTime;
       this.searchForm.remark = res.data.remark;
+      this.searchForm.secondExamineBy = res.data.secondExamineBy;
+      this.searchForm.secondExamineTime = res.data.secondExamineTime;
+      this.searchForm.examineBy = res.data.examineBy;
+      this.searchForm.examineTime = res.data.examineTime;
+      this.saveDataList = this.deepCopy(res.data.items);
       this.dataList = res.data.items;
+      this;
     },
     goBack() {
       this.$parent.showPage = 1;

+ 3 - 0
src/views/finance/components/rebate_list-edit.vue

@@ -129,6 +129,9 @@
             min-width="160"
             show-overflow-tooltip
           >
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.policyDocNo"></el-input>
+            </template>
           </el-table-column>
           <el-table-column
             align="center"

+ 48 - 1
src/views/finance/rebate_form.vue

@@ -67,7 +67,23 @@
     <!-- 按钮 -->
     <div class="btn-group clearfix">
       <div class="fr">
-        <el-button type="primary" size="small">批量导入</el-button>
+        <el-button type="primary" size="small" @click="downLoadFn"
+          >模板</el-button
+        >
+        <!-- <a href="/rebate/order/download">下载文件</a> -->
+        <!-- <el-button type="primary" size="small" @click="importFn"
+          >批量导入</el-button
+        > -->
+
+        <el-upload
+          class="import-btn"
+          action=""
+          :http-request="handleImport"
+          :file-list="importFileList"
+          :show-file-list="false"
+        >
+          <el-button type="primary" size="small">批量导入</el-button>
+        </el-upload>
       </div>
     </div>
     <!-- 列表 -->
@@ -309,16 +325,21 @@
 
 <script>
 import { mapGetters } from "vuex";
+import { downloadFiles, handleImport } from "@/utils/util";
+
 import {
   getCustomerList,
   getWalletCustomerList,
   getRebateOrderAdd,
   getRebateOrderApply,
   getRebateOrderList,
+  getRebateOrderDownLoad,
 } from "@/api/finance/rebate_form";
 export default {
   data() {
     return {
+      importFileList: [],
+
       dataList: [],
       listLoading: false, // 列表加载loading
       customerData: [],
@@ -340,6 +361,7 @@ export default {
       },
     };
   },
+
   computed: {
     ...mapGetters(["name"]),
   },
@@ -348,6 +370,27 @@ export default {
     this.searchForm.createBy = this.name;
   },
   methods: {
+    // 导入
+    async handleImport(param) {
+      const file = param.file;
+
+      const formData = new FormData();
+      formData.append("file", file);
+
+      let result = await handleImport("/rebate/order/import", formData);
+
+      console.log(result);
+      this.importFileList = [];
+      if (result.code == 200) {
+        this.$message.success("导入成功");
+      } else {
+        this.$message.error("导入失败");
+      }
+    },
+    //下载模板
+    async downLoadFn() {
+      downloadFiles("/rebate/order/download");
+    },
     //重置
     cancelFn() {
       this.searchForm = {
@@ -442,4 +485,8 @@ export default {
 .selectStyle {
   width: 100%;
 }
+.import-btn {
+  display: inline-block;
+  margin-left: 10px;
+}
 </style>

+ 25 - 7
src/views/finance/rebate_list.vue

@@ -123,9 +123,11 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <el-tag
-                  v-show="scope.row.customerIsConfirm == 'true' ? '是' : '否'"
-                  >是</el-tag
+                <el-tag v-show="scope.row.customerIsConfirm == true"
+                  >已确认</el-tag
+                >
+                <el-tag v-show="scope.row.customerIsConfirm == false"
+                  >未确认</el-tag
                 >
               </template>
             </el-table-column>
@@ -464,8 +466,15 @@
                     scope.row.examineStatus == 'OK_ONE' &&
                     scope.row.withholdAmount == 0
                   "
-                  @click="confirmFn(scope.row.rebateOrderId)"
-                  >确认</el-button
+                  @click="
+                    confirmFn(
+                      scope.row.rebateOrderId,
+                      scope.row.customerIsConfirm
+                    )
+                  "
+                  >{{
+                    scope.row.customerIsConfirm == true ? "详情" : "确认"
+                  }}</el-button
                 >
               </template>
             </el-table-column>
@@ -500,7 +509,12 @@
     <!-- 详情 -->
     <RebateListDetail :detailId="detailId" v-else-if="showPage == 5" />
     <!-- 确定 -->
-    <RebateListConfirm :detailId="detailId" v-else-if="showPage == 6" />
+    <RebateListConfirm
+      @updateList="updateList"
+      :detailId="detailId"
+      :isShow="isShow"
+      v-else-if="showPage == 6"
+    />
     <!-- 编辑 -->
     <RebateListEdit
       @updateList="updateList"
@@ -549,6 +563,7 @@ export default {
       detailId: null,
       isCustomer: null,
       secondId: null,
+      isShow: null,
     };
   },
   created() {
@@ -606,12 +621,15 @@ export default {
           }
         });
         this.dataList = arr2;
+        this.listTotal = arr2.length;
       } else {
         this.dataList = arr;
+        this.listTotal = res.data.total;
       }
     },
     //确认
-    confirmFn(id) {
+    confirmFn(id, isShow) {
+      this.isShow = isShow;
       this.detailId = id;
       this.showPage = 6;
     },

+ 2 - 0
src/views/finance/receivable_list.vue

@@ -89,6 +89,7 @@
       <div class="btn-group clearfix">
         <div class="fl">
           <el-button
+            v-if="$checkBtnRole('add', $router.meta.roles)"
             type="primary"
             icon="el-icon-plus"
             size="small"
@@ -97,6 +98,7 @@
           >
 
           <el-popconfirm
+            v-if="$checkBtnRole('del', $router.meta.roles)"
             class="delClass"
             @onConfirm="deleFn"
             title="这是一段内容确定删除吗?"

+ 2 - 0
src/views/issue/index.vue

@@ -39,6 +39,7 @@
             type="primary"
             icon="el-icon-plus"
             @click="clickImport()"
+            v-if="$checkBtnRole('add', $route.meta.roles)"
             >新增</el-button
           >
           <div class="tips fl">
@@ -79,6 +80,7 @@
                 style="margin-left: 10px"
                 title="确定删除吗?"
                 @onConfirm="deleteData(scope.row.id)"
+                v-if="$checkBtnRole('del', $route.meta.roles)"
               >
                 <el-button slot="reference" type="text">删除</el-button>
               </el-popconfirm>

+ 31 - 91
src/views/login/index.vue

@@ -1,9 +1,6 @@
 <template>
   <div class="login-container">
-    <div class="flexBox">
-      <div>
-
-      <el-form
+    <el-form
       ref="loginForm"
       :model="loginForm"
       :rules="loginRules"
@@ -11,30 +8,21 @@
       auto-complete="on"
       label-position="left"
     >
-      <div class="flex">
-          <div class="image-container">
-        <div class="empty-height" >
-                     <img class="logo" src="@/assets/login/logo.png" alt="">
-        </div>
-        <el-carousel :interval="5000" arrow="always" height="440px" class="carousel">
-          <el-carousel-item v-for="item in 4" :key="item">
-            <h3>{{ item }}</h3>
-          </el-carousel-item>
-        </el-carousel>
+      <!-- <div class="title-container">
+        <img src="@/assets/login/title.png" alt="">
+      </div> -->
+      <div class="image-container">
+        <img src="@/assets/login/image.png" alt="" />
       </div>
       <div class="right-container">
         <div class="empty-height" />
         <div class="form-container">
-          <!-- <div class="title">供应链管理系统</div> -->
+          <div class="title">供应链管理系统</div>
           <!--      <div class="logo">-->
           <!--        <img src="@/assets/login/logo.png" alt="">-->
           <!--      </div>-->
-            <div class="flex title">
-              <div style="margin-right: 80px;">密码登录</div>
-              <div>微信登录</div>
-            </div>
-            <div>
-               <el-form-item prop="username">
+
+          <el-form-item prop="username">
             <span class="svg-container">
               <svg-icon icon-class="user" />
             </span>
@@ -100,21 +88,9 @@
               >登录</el-button
             >
           </div>
-            </div>
-            <div>
-
-            </div>
         </div>
       </div>
-      </div>
-      </el-form>
-
-      </div>
-      <div class="info">
-        <div>粤ICP备2020090308号 | 粤公网安备44010602008477号</div>
-        <div>本站由广州众炬科技有限公司提供技术支持服务</div>
-      </div>
-    </div>
+    </el-form>
   </div>
 </template>
 
@@ -225,8 +201,11 @@ export default {
             .dispatch("user/login", this.loginForm)
             .then(() => {
               console.log(this.redirect);
+
               this.$router.push({ path: this.redirect || "/" });
+              this.$store.commit("user/showMessage", "yes");
               this.saveUnAndPw();
+
               this.loading = false;
             })
             .catch(() => {
@@ -337,14 +316,7 @@ $back: #333;
       }
     }
   }
-  .el-carousel__arrow--left,.el-carousel__arrow--right{
-    display: none;
-  }
-    .carousel{
-     border-top-left-radius: 15px;
-     border-bottom-left-radius: 15px;
-     overflow: hidden;
-    }
+
   .el-form-item {
     border: 1px solid rgba(255, 255, 255, 0.1);
     // background: rgba(0, 0, 0, 0.1);
@@ -368,39 +340,7 @@ $back: #333;
 $bg: #2d3a4b;
 $dark_gray: #889aa4;
 $light_gray: #eee;
-.info{
-  margin-top: 50px;
-  line-height: 30px;
-  text-align: center;
-  text-align-last: center;
-  color: #fff;
-}
-.flexBox{
-  display: flex;
-   padding-top: calc(50vh - 230px);
-  justify-content: space-between;
-  flex-direction: column;
- align-items: center
-}
-.flex{
-  display: flex;
-  flex-direction: row;
-}
-.empty-height{
-  height: 46px;
-  margin: 15px 0;
-}
-.logo{
-  height:46px;
-  width:460px ;
-}
-.el-carousel__item:nth-child(2n) {
-  background-color: #99a9bf;
-}
 
-.el-carousel__item:nth-child(2n + 1) {
-  background-color: #d3dce6;
-}
 .login-container {
   min-height: 100%;
   width: 100%;
@@ -408,34 +348,35 @@ $light_gray: #eee;
   overflow: hidden;
 
   .login-form {
-    // position: relative;
-    // width: 1920px;
-    // max-width: 100%;
-    // height: 100%;
-
-    // display: flex;
-    // flex-direction: column;
-    // align-items: center;
-
+    position: relative;
+    width: 1070px;
+    max-width: 100%;
+    padding: 0 35px 0;
+    padding-top: calc(50vh - 230px);
+    margin: 0 auto;
+    overflow: hidden;
+    display: flex;
   }
 
   .image-container {
-   width: 700px;
-   height: 516px;
-  //  overflow: hidden;
+    img {
+      width: 560px;
+      height: 460px;
+    }
   }
 
   .right-container {
     width: 440px;
-    height: 516px;
+    height: 460px;
+    .empty-height {
+      height: 77px;
+    }
     .form-container {
-      height: 440px;
       padding: 20px 30px 27px 40px;
       background: #fff;
       border-radius: 0 15px 15px 0;
       .title {
-
-        justify-content: center;
+        font-size: 24px;
         font-weight: bold;
         letter-spacing: 4px;
         text-align: center;
@@ -517,4 +458,3 @@ $light_gray: #eee;
   }
 }
 </style>
-

+ 1 - 1
src/views/stock/reserved_stock.vue

@@ -50,7 +50,7 @@
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fr">
-          <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+          <ExportButton :exUrl="'stock/manager/export'" :exParams="exParams" />
         </div>
       </div>
       <div class="table">

+ 1 - 1
src/views/stock/stock_list.vue

@@ -66,7 +66,7 @@
     <div class="mymain-container">
       <div class="btn-group clearfix">
         <div class="fr">
-          <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+          <ExportButton :exUrl="'stock/manager/export'" :exParams="exParams" />
         </div>
       </div>
       <div class="table">

+ 6 - 6
src/views/supply/apply/apply_list.vue

@@ -70,7 +70,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">发货申请</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">发货申请</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -99,16 +99,16 @@
             </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, 'WAIT')" v-if="scope.row.examineStatus === 'SAVE'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id, 'WAIT')" v-if="$checkBtnRole('apply', $route.meta.roles) && 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, 'SAVE')" v-if="scope.row.examineStatus === 'WAIT'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleSubmit(scope.row.id, 'SAVE')" v-if="$checkBtnRole('apply', $route.meta.roles) && 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.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="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && 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)"  v-if="scope.row.examineStatus !== 'OK'">
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)"  v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>

+ 15 - 13
src/views/supply/apply/components/apply_form.vue

@@ -344,7 +344,7 @@ export default {
           let oldItem = oldGoodsList[i]
           for(let j = 0; j < newGoodsList.length; j++) {
             let newItem = newGoodsList[j]
-            if(newItem.materialId === oldItem.materialId){
+            if(newItem.orderId === oldItem.orderId){
               newGoodsList[j].selected = true;
               break;
             }
@@ -443,22 +443,24 @@ export default {
         }
       }
 
-      let allList = this.tableGoodsList;
-      let selectList = this.tableSelection;
-      let submitList = [];
-
-      for(let i = 0; i < allList.length; i++) {
-        for(let j = 0; j < selectList.length; j++) {
-          if(selectList[j].orderId == allList[i].orderId){
-            submitList.push(allList[i]);
-          }
-        }
-      }
+      // let allList = this.tableGoodsList;
+      // let selectList = this.tableSelection;
+      // let submitList = [];
+
+      // for(let i = 0; i < allList.length; i++) {
+      //   for(let j = 0; j < selectList.length; j++) {
+      //     if(selectList[j].orderId == allList[i].orderId){
+      //       submitList.push(allList[i]);
+      //     }
+      //   }
+      // }
       // this.goodsList = this.goodsList.concat(submitList);
 
-      this.goodsList = this.delRepeat(submitList, this.goodsList);
+      // this.goodsList = this.delRepeat(submitList, this.goodsList);
       this.isShowDialog = false;
       this.tableGoodsList = [];
+
+      this.goodsList = this.goodsList.concat(this.tableSelection);
     },
 
     // 删除产品

+ 1 - 1
src/views/supply/apply/components/engin_detail.vue

@@ -121,7 +121,7 @@
         <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="theTime" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="销售订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="120" 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>

+ 18 - 15
src/views/supply/apply/components/engin_form.vue

@@ -136,7 +136,7 @@
     <div class="table" style="margin-top: 20px">
       <el-table :data="goodsList" 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="orderId" min-width="180" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="引用单号" prop="enginOrderNo" min-width="180" show-overflow-tooltip></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="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -489,7 +489,7 @@ export default {
           let oldItem = oldGoodsList[i]
           for(let j = 0; j < newGoodsList.length; j++) {
             let newItem = newGoodsList[j]
-            if(newItem.materialId === oldItem.materialId){
+            if(newItem.orderId === oldItem.orderId){
               newGoodsList[j].selected = true;
               break;
             }
@@ -602,24 +602,27 @@ export default {
         }
       }
 
-      let allList = this.tableGoodsList;
-      let selectList = this.tableSelection;
-      let submitList = [];
+      // let allList = this.tableGoodsList;
+      // let selectList = this.tableSelection;
+      // let submitList = [];
 
-      for(let i = 0; i < allList.length; i++) {
-        for(let j = 0; j < selectList.length; j++) {
-          if(selectList[j].enginOrderNo == allList[i].enginOrderNo){
-            submitList.push(allList[i]);
-          }
-        }
-      }
-      // this.goodsList = this.goodsList.concat(submitList);
+      // for(let i = 0; i < allList.length; i++) {
+      //   for(let j = 0; j < selectList.length; j++) {
+      //     if(selectList[j].enginOrderNo == allList[i].enginOrderNo){
+      //       submitList.push(allList[i]);
+      //     }
+      //   }
+      // }
 
-      this.goodsList = this.delRepeat(submitList, this.goodsList);
+      // this.goodsList = this.delRepeat(submitList, this.goodsList);
       this.isShowDialog = false;
       this.tableGoodsList = [];
 
-      this.getEnginGoodsDetail(submitList[0].enginOrderNo);
+
+      this.goodsList = this.goodsList.concat(this.tableSelection);
+
+      this.getEnginGoodsDetail(this.tableSelection[0].enginOrderNo);
+      // this.getEnginGoodsDetail(submitList[0].enginOrderNo);
     },
 
     getEnginGoodsDetail(enginOrderNo) {

+ 6 - 6
src/views/supply/apply/engin_list.vue

@@ -70,7 +70,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">发货申请</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">发货申请</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -102,16 +102,16 @@
             </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, 'WAIT')" v-if="scope.row.examineStatus === 'SAVE'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id, 'WAIT')" v-if="$checkBtnRole('apply', $route.meta.roles) && 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, 'SAVE')" v-if="scope.row.examineStatus === 'WAIT'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleSubmit(scope.row.id, 'SAVE')" v-if="$checkBtnRole('apply', $route.meta.roles) && 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.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="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && 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-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" v-if="$checkBtnRole('del', $route.meta.roles)">
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>

+ 3 - 3
src/views/supply/deliver/commerce_list.vue

@@ -90,7 +90,7 @@
             <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="qty" 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="remark" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
@@ -225,7 +225,7 @@ export default {
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        orderType: 2, // 2家用工程 3商用工程
+        orderType: 3, // 2家用工程 3商用工程
       }
     },
     isShowDetail() {
@@ -265,7 +265,7 @@ export default {
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        orderType: 2, // 2家用工程 3商用工程
+        orderType: 3, // 2家用工程 3商用工程
       };
       getEnginList(params).then((res) => {
         this.dataList = res.data.records;

+ 28 - 14
src/views/supply/deliver/components/commerce_detail.vue

@@ -113,21 +113,29 @@
       <div class="table">
         <el-table :data="detailData.retreatDocumentOrder" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="订单号" prop="orderNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库名称" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="productName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="180" 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="materialCode" 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="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税单价" prop="includedPrice" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="无税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="价税合计" prop="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="税率(%)" prop="rate" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="折扣额" prop="discountPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="折扣后单价" prop="discountPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="退补标记" prop="refund" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="厂产品代码" prop="factoryNumber" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单位" prop="unit" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="refundableQty" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="含税单价" prop="price" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率(%)" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣额" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣后单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="退补标记" prop="refundStatus" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.refundStatus | refundStatusFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="厂产品代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
 
@@ -170,6 +178,12 @@ export default {
         3: '商用工程订单',
       }
       return MAP[val];
+    },
+    refundStatusFilter(val) {
+      const MAP = {
+        1: '正常',
+      }
+      return MAP[val];
     }
   },
   data() {

+ 27 - 13
src/views/supply/deliver/components/deliver_detail.vue

@@ -113,22 +113,30 @@
       <div class="table">
         <el-table :data="detailData.shipDocumentOrders" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="订单号" prop="orderNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库名称" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="200" 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="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="productName" min-width="160" 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="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="number" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税单价" prop="includedPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="无税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="价税合计" prop="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="税率(%)" prop="rate" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="折扣额" prop="discountPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="折扣后单价" prop="discountPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="退补标记" prop="refund" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="厂产品代码" prop="factoryNumber" 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="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率(%)" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣额" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣后单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="退补标记" prop="refundStatus" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.refundStatus | refundStatusFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="厂产品代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
 
@@ -175,6 +183,12 @@ export default {
         3: '商用工程订单',
       }
       return MAP[val];
+    },
+    refundStatusFilter(val) {
+      const MAP = {
+        1: '正常',
+      }
+      return MAP[val];
     }
   },
   data() {

+ 27 - 13
src/views/supply/deliver/components/home_detail.vue

@@ -113,22 +113,30 @@
       <div class="table">
         <el-table :data="detailData.shipDocumentOrders" element-loading-text="Loading" border fit highlight-current-row stripe>
           <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="订单号" prop="orderNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="仓库名称" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="180" 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="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="productName" min-width="160" 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="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="number" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="含税单价" prop="includedPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="无税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="价税合计" prop="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="税率(%)" prop="rate" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="折扣额" prop="discountPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="折扣后单价" prop="discountPrice" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="退补标记" prop="refund" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="厂产品代码" prop="factoryNumber" 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="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="税率(%)" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣额" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="折扣后单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="退补标记" prop="refundStatus" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.refundStatus | refundStatusFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="厂产品代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
 
@@ -175,6 +183,12 @@ export default {
         3: '商用工程订单',
       }
       return MAP[val];
+    },
+    refundStatusFilter(val) {
+      const MAP = {
+        1: '正常',
+      }
+      return MAP[val];
     }
   },
   data() {

+ 3 - 3
src/views/supply/deliver/deliver_list.vue

@@ -68,10 +68,10 @@
             <el-table-column align="center" label="经销商" prop="customerName" 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="totalPrice" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="无税单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="无税单价" prop="afterTaxPrice" 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="remark" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="200" fixed="right">
               <template slot-scope="scope">

+ 1 - 1
src/views/supply/deliver/home_list.vue

@@ -85,7 +85,7 @@
             <el-table-column align="center" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="数量" prop="qty" 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="remark" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>

+ 4 - 13
src/views/supply/direct/direct_list.vue

@@ -70,7 +70,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()">批量删除</el-button>
+            <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()" v-if="$checkBtnRole('del', $route.meta.roles)">批量删除</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -105,10 +105,10 @@
             <el-table-column align="center" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="180" fixed="right">
               <template slot-scope="scope">
-                <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="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && 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-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" v-if="$checkBtnRole('del', $route.meta.roles)">
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>
@@ -216,15 +216,6 @@ export default {
   },
 
   methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
-    },
-
     // 查询列表
     getList() {
       this.listLoading = true;

+ 10 - 8
src/views/supply/engin/commerce_list.vue

@@ -75,8 +75,8 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
-            <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()">批量删除</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
+            <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()" v-if="$checkBtnRole('del', $route.meta.roles)">批量删除</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -92,12 +92,14 @@
             </el-table-column>
             <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="工程编码" prop="refProjectNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.enginOrderType | typeFilter}}
               </template>
             </el-table-column>
+            <el-table-column align="center" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="销售类型" prop="saleTypeName" 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>
@@ -122,17 +124,17 @@
             <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="220" fixed="right">
               <template slot-scope="scope">
-                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.parentId)" v-if="scope.row.examineStatus === 'SAVE'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.parentId)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
                   <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
-                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="scope.row.examineStatus === 'WAIT'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="$checkBtnRole('apply', $route.meta.roles) && 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.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="toReturn(scope.row)">退订</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles)">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" >
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles)">
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>

+ 21 - 20
src/views/supply/engin/components/commerce_detail.vue

@@ -11,7 +11,7 @@
         <el-row>
           <el-col :span="8" class="item">
             <div class="label">工程订单号</div>
-            <div class="value">{{detailData.enginOrderId}}</div>
+            <div class="value">{{detailData.enginOrderNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">订单日期</div>
@@ -156,7 +156,8 @@
             </template>
           </el-table-column>
           <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原订单数量" prop="enginNum" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="已退数量" prop="retiredQty" 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-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
         </el-table>
@@ -169,7 +170,7 @@
         <el-button type="danger" @click="closeData">关闭订单</el-button>
         <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
         <el-button type="primary" @click="overData">直调完结</el-button>
-        <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
+        <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus">直调发货</el-button>
         <el-button @click="goBack">返回</el-button>
       </div>
     </div>
@@ -208,22 +209,22 @@
       <div class="table" style="margin-top: 20px">
         <el-table :data="deliverGoodsList" 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="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="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <el-input v-model="scope.row.realDirectTransferQty" size="small" type="number"></el-input>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利" prop="rebateAmount" 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-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编码" prop="materialNumber" 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="qty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.realDirectTransferQty" size="small" type="number"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="返利" prop="rebateAmount" 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>
       <span slot="footer" class="dialog-footer">
@@ -271,7 +272,7 @@
         <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="materialNumber" 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>

+ 2 - 1
src/views/supply/engin/components/commerce_examine.vue

@@ -10,7 +10,7 @@
       <el-row>
         <el-col :span="8" class="item">
           <div class="label">工程订单号</div>
-          <div class="value">{{detailData.enginOrderId}}</div>
+          <div class="value">{{detailData.enginOrderNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>
@@ -143,6 +143,7 @@
         </el-table-column>
         <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="已退数量" prop="retiredQty" 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-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>

+ 18 - 3
src/views/supply/engin/components/commerce_form.vue

@@ -209,6 +209,7 @@
         </el-table-column>
         <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100"></el-table-column>
         <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="已退数量" prop="retiredQty" 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>
@@ -315,17 +316,23 @@
 import { getOrderDetail, getComLoginList, getComLoginDetail, getWarehouseList, addCom, editCom, submitCom, checkStock, getWalletList } from "@/api/supply/engin";
 import { getDictList, getTypeList } from '@/api/common'
 
+let that
 export default {
   name: 'CommerceForm',
   componentName: 'CommerceForm',
   props: ['listItem'],
   filters: {
     status1Filter(val) {
+      let STOCK_ORDER_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_START').dictValue;
+      let STOCK_ORDER_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_END').dictValue;
+      let STOCK_ORDER_HAVE_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_START').dictValue;
+      let STOCK_ORDER_HAVE_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_END').dictValue;
+      let STOCK_ORDER_ALL_NUM = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_ALL_NUM').dictValue;
       if (val === '' || val === null || val === undefined) return '未检查';
       else if (val === 0) return '无货';
-      else if (val > 0 && val <= 30) return val;
-      else if (val > 30 && val <= 1000) return '有货';
-      else if (val > 1000) return '充足';
+      else if (val > STOCK_ORDER_START && val <= STOCK_ORDER_END) return val;
+      else if (val >= STOCK_ORDER_HAVE_START && val <= STOCK_ORDER_HAVE_END) return '有货';
+      else if (val > STOCK_ORDER_ALL_NUM) return '充足';
     },
   },
   data() {
@@ -367,6 +374,7 @@ export default {
         address: [{ required: true, message: '请输入安装地址', trigger: 'blur' }],
       },
       typeList: [],
+      stockList: [],
       goodsList: [],
 
       isShowDialog: false, // 工程登录列表 - 弹窗
@@ -401,6 +409,10 @@ export default {
     },
   },
 
+  beforeCreate() {
+    that = this;
+  },
+
   created() {
     this.getDictList();
     this.getWalletList();
@@ -460,6 +472,9 @@ export default {
       getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
         this.typeList = res.data;
       })
+      getDictList({sysDictEnum: 'STOCK_ORDER'}).then(res => {
+        this.stockList = res.data;
+      })
     },
 
     // 获取仓库列表

+ 1 - 1
src/views/supply/engin/components/commerce_return.vue

@@ -10,7 +10,7 @@
       <el-row>
         <el-col :span="8" class="item">
           <div class="label">工程订单号</div>
-          <div class="value">{{detailData.enginOrderId}}</div>
+          <div class="value">{{detailData.enginOrderNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>

+ 21 - 20
src/views/supply/engin/components/home_detail.vue

@@ -11,7 +11,7 @@
         <el-row>
           <el-col :span="8" class="item">
             <div class="label">工程订单号</div>
-            <div class="value">{{detailData.enginOrderId}}</div>
+            <div class="value">{{detailData.enginOrderNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">订单日期</div>
@@ -156,7 +156,8 @@
             </template>
           </el-table-column>
           <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原订单数量" prop="enginNum" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="已退数量" prop="retiredQty" 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-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
         </el-table>
@@ -169,7 +170,7 @@
         <el-button type="danger" @click="closeData">关闭订单</el-button>
         <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
         <el-button type="primary" @click="overData">直调完结</el-button>
-        <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
+        <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus">直调发货</el-button>
         <el-button @click="goBack">返回</el-button>
       </div>
     </div>
@@ -208,22 +209,22 @@
       <div class="table" style="margin-top: 20px">
         <el-table :data="deliverGoodsList" 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="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="qty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <el-input v-model="scope.row.realDirectTransferQty" size="small" type="number"></el-input>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利" prop="rebateAmount" 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-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编码" prop="materialNumber" 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="qty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.realDirectTransferQty" size="small" type="number"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="返利" prop="rebateAmount" 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>
       <span slot="footer" class="dialog-footer">
@@ -271,7 +272,7 @@
         <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="materialNumber" 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>

+ 2 - 1
src/views/supply/engin/components/home_examine.vue

@@ -10,7 +10,7 @@
       <el-row>
         <el-col :span="8" class="item">
           <div class="label">工程订单号</div>
-          <div class="value">{{detailData.enginOrderId}}</div>
+          <div class="value">{{detailData.enginOrderNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>
@@ -143,6 +143,7 @@
         </el-table-column>
         <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="已退数量" prop="retiredQty" 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-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>

+ 18 - 3
src/views/supply/engin/components/home_form.vue

@@ -215,6 +215,7 @@
         </el-table-column>
         <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100"></el-table-column>
         <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="已退数量" prop="retiredQty" 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>
@@ -321,17 +322,23 @@
 import { getOrderDetail, getHomeLoginList, getHomeLoginDetail, getWarehouseList, addHome, editHome, submitHome, checkStock, getWalletList } from "@/api/supply/engin";
 import { getDictList, getTypeList } from '@/api/common'
 
+let that
 export default {
   name: 'HomeForm',
   componentName: 'HomeForm',
   props: ['listItem'],
   filters: {
     status1Filter(val) {
+      let STOCK_ORDER_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_START').dictValue;
+      let STOCK_ORDER_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_END').dictValue;
+      let STOCK_ORDER_HAVE_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_START').dictValue;
+      let STOCK_ORDER_HAVE_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_END').dictValue;
+      let STOCK_ORDER_ALL_NUM = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_ALL_NUM').dictValue;
       if (val === '' || val === null || val === undefined) return '未检查';
       else if (val === 0) return '无货';
-      else if (val > 0 && val <= 30) return val;
-      else if (val > 30 && val <= 1000) return '有货';
-      else if (val > 1000) return '充足';
+      else if (val > STOCK_ORDER_START && val <= STOCK_ORDER_END) return val;
+      else if (val >= STOCK_ORDER_HAVE_START && val <= STOCK_ORDER_HAVE_END) return '有货';
+      else if (val > STOCK_ORDER_ALL_NUM) return '充足';
     },
   },
   data() {
@@ -376,6 +383,7 @@ export default {
       },
       salesTypeList: [],
       typeList: [],
+      stockList: [],
       goodsList: [],
 
       isShowDialog: false, // 工程登录列表 - 弹窗
@@ -410,6 +418,10 @@ export default {
     },
   },
 
+  beforeCreate() {
+    that = this;
+  },
+
   created() {
     this.getDictList();
     this.getWalletList();
@@ -470,6 +482,9 @@ export default {
       getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
         this.typeList = res.data;
       })
+      getDictList({sysDictEnum: 'STOCK_ORDER'}).then(res => {
+        this.stockList = res.data;
+      })
     },
 
     // 获取销售类型列表

+ 1 - 1
src/views/supply/engin/components/home_return.vue

@@ -10,7 +10,7 @@
       <el-row>
         <el-col :span="8" class="item">
           <div class="label">工程订单号</div>
-          <div class="value">{{detailData.enginOrderId}}</div>
+          <div class="value">{{detailData.enginOrderNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>

+ 6 - 15
src/views/supply/engin/engin_list.vue

@@ -80,7 +80,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -111,16 +111,16 @@
             </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.enginInfoId)" v-if="scope.row.examineStatus === 'SAVE'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.enginInfoId)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
                   <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
-                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.enginInfoId)" v-if="scope.row.examineStatus === 'WAIT'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.enginInfoId)" v-if="$checkBtnRole('apply', $route.meta.roles) && 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.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="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && 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.enginInfoId)" >
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.enginInfoId)" v-if="$checkBtnRole('del', $route.meta.roles)">
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>
@@ -230,15 +230,6 @@ export default {
   },
 
   methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
-    },
-
     // 查询列表
     getList() {
       this.listLoading = true;

+ 8 - 15
src/views/supply/engin/home_list.vue

@@ -75,8 +75,8 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
-            <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()">批量删除</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
+            <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()" v-if="$checkBtnRole('del', $route.meta.roles)">批量删除</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -92,12 +92,14 @@
             </el-table-column>
             <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="工程编码" prop="refProjectNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.enginOrderType | typeFilter}}
               </template>
             </el-table-column>
+            <el-table-column align="center" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="销售类型" prop="saleTypeName" 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>
@@ -128,11 +130,11 @@
                 <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" 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.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="toReturn(scope.row)">退订</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus !== 'FAIL'">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" >
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles)">
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>
@@ -254,15 +256,6 @@ export default {
   },
 
   methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
-    },
-
     // 查询列表
     getList() {
       this.listLoading = true;

+ 5 - 5
src/views/supply/pickup/pickup_list.vue

@@ -47,7 +47,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'pick/export'" :exParams="exParams" />
@@ -62,7 +62,7 @@
             </el-table-column>
             <el-table-column align="center" label="打单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="发货申请单号" prop="invoiceOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="发货申请单号" prop="invoiceId" min-width="180" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.pickTime | dateToDayFilter }}
@@ -94,7 +94,7 @@
             <el-table-column align="center" label="备注" prop="remark" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="100" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles)">编辑</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -151,7 +151,7 @@ export default {
   computed: {
     exParams() {
       return {
-        shipOrderNo: this.screenForm.orderNum,
+        invoiceId: this.screenForm.orderNum,
         createBy: this.screenForm.applyName,
         stockName: this.screenForm.warehouse,
         pickStartTime: this.screenForm.date ? this.screenForm.date[0] : '',
@@ -181,7 +181,7 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        shipOrderNo: this.screenForm.orderNum,
+        invoiceId: this.screenForm.orderNum,
         createBy: this.screenForm.applyName,
         stockName: this.screenForm.warehouse,
         pickStartTime: this.screenForm.date ? this.screenForm.date[0] : '',

+ 6 - 6
src/views/supply/pickup/sum_list.vue

@@ -75,17 +75,17 @@
               {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="单据日期" prop="orderTime" min-width="120" show-overflow-tooltip>
+          <el-table-column align="center" label="单据日期" prop="theTime" min-width="120" show-overflow-tooltip>
             <template slot-scope="scope">
-              {{ scope.row.orderTime | dateToDayFilter }}
+              {{ scope.row.theTime | dateToDayFilter }}
             </template>
           </el-table-column>
           <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="工程编号" prop="enginOrderNo" min-width="180" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编号" prop="productNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="productName" min-width="160" 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="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="number" 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="remark" min-width="100" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
@@ -153,7 +153,7 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        shipOrderNo: this.screenForm.orderNum,
+        invoiceId: this.screenForm.orderNum,
         customerName: this.screenForm.jxsName,
         customerNumber: this.screenForm.jxsNum,
         stockName: this.screenForm.warehouse,

+ 41 - 30
src/views/supply/policy/components/retail_detail.vue

@@ -141,19 +141,22 @@
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
-         <el-table-column
+        <el-table-column
           align="center"
           label="返利类型"
           prop="rebateWallets"
           min-width="100"
           show-overflow-tooltip
         >
-        <template slot-scope="scope">
-          <el-tag type="success" size="small" v-for="item in scope.row.rebateWallets">
-          {{item.name}}
-          </el-tag>
-
-        </template>
+          <template slot-scope="scope">
+            <el-tag
+              type="success"
+              size="small"
+              v-for="item in scope.row.rebateWallets"
+            >
+              {{ item.name }}
+            </el-tag>
+          </template>
         </el-table-column>
         <el-table-column
           align="center"
@@ -169,7 +172,7 @@
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
-       <el-table-column
+        <el-table-column
           align="center"
           label="现金钱包"
           prop="wallets"
@@ -177,15 +180,18 @@
           show-overflow-tooltip
         >
           <template slot-scope="scope">
-          <el-tag type="success" size="small" v-for="item in scope.row.wallets">
-          {{item.name}}
-          </el-tag>
-
-        </template>
+            <el-tag
+              type="success"
+              size="small"
+              v-for="item in scope.row.wallets"
+            >
+              {{ item.name }}
+            </el-tag>
+          </template>
         </el-table-column>
         <el-table-column
           align="center"
-          label="金额"
+          label="实付金额"
           prop="payAmount"
           min-width="100"
           show-overflow-tooltip
@@ -208,6 +214,20 @@
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
+          <el-table-column
+          align="center"
+          label="实付金额"
+          prop="payAmount"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
+          <el-table-column
+          align="center"
+          label="已退数量"
+          prop="retiredQty"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
         <el-table-column
           align="center"
           label="原订单数量"
@@ -412,18 +432,12 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-
-              <template v-if="scope.row.isDirectTransfer == '是'">
               <el-input
                 v-model="scope.row.adjustNum"
                 size="small"
                 type="number"
+                :disabled="!scope.row.isDirectTransfer"
               ></el-input>
-              </template>
-              <template v-else>
-                {{scope.row.adjustNum || 0 }}
-              </template>
-
             </template>
           </el-table-column>
           <el-table-column
@@ -447,13 +461,7 @@
             min-width="100"
             show-overflow-tooltip
           ></el-table-column>
-          <el-table-column
-            align="center"
-            label="实付金额"
-            prop="payAmount"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
+payAmount
           <el-table-column
             align="center"
             label="备注"
@@ -612,7 +620,10 @@ export default {
       this.$refs.deliverForm.validate((valid) => {
         if (valid) {
           for (let i = 0; i < this.goodsList.length; i++) {
-            if (!this.goodsList[i].adjustNum) {
+            if (
+              !this.goodsList[i].adjustNum &&
+              this.goodsList[i].isDirectTransfer
+            ) {
               this.$errorMsg("请输入直调数量");
               return;
             }
@@ -620,7 +631,7 @@ export default {
           let goodsList = this.goodsList.map((item) => {
             return {
               itemId: item.id,
-              qty: item.adjustNum,
+              qty: item.adjustNum || 0,
             };
           });
           let params = {

+ 7 - 0
src/views/supply/policy/components/retail_examine.vue

@@ -168,6 +168,13 @@
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
+          <el-table-column
+          align="center"
+          label="已退数量"
+          prop="retiredQty"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
         <el-table-column
           align="center"
           label="是否直调"

+ 8 - 0
src/views/supply/policy/components/retail_form2.vue

@@ -234,6 +234,13 @@
             {{ scope.row.qty * scope.row.discAmount }}
           </template>
         </el-table-column>
+          <el-table-column
+          align="center"
+          label="已退数量"
+          prop="retiredQty"
+          min-width="100"
+          show-overflow-tooltip
+        ></el-table-column>
         <el-table-column
           align="center"
           label="现金钱包"
@@ -877,6 +884,7 @@ export default {
       policyList({
         pageNum: 1,
         pageSize: -1,
+        status:true
       }).then((res) => {
         this.screenForm.policyId = res.data.records[0].code;
         this.handlePolicy(this.screenForm.policyId);

+ 1 - 7
src/views/supply/policy/policy_list.vue

@@ -381,13 +381,7 @@
                   v-if="scope.row.examineStatus === 'OK'"
                   >退订</el-button
                 >
-
-                <el-popconfirm
-                  style="margin-left: 10px"
-                  title="确定关闭吗?"
-                  @onConfirm="handleClose(scope.row.id)"
-                  v-if="!scope.row.closeTime"
-                >
+   <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="!scope.row.closeTime" >
                   <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>
               </template>

+ 3 - 12
src/views/supply/reserve/reserve_list.vue

@@ -72,7 +72,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -112,9 +112,9 @@
             <el-table-column align="center" label="关闭日期" prop="closureTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="160" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles)">编辑</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.itemId)" >
+                <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.itemId)" v-if="$checkBtnRole('examine', $route.meta.roles)">
                   <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>
               </template>
@@ -208,15 +208,6 @@ export default {
   },
 
   methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
-    },
-
     // 查询列表
     getList() {
       this.listLoading = true;

+ 175 - 1
src/views/supply/retail/components/retail_detail.vue

@@ -118,6 +118,7 @@
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
+        <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'">提前开票</el-button>
         <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK'">直调发货</el-button>
         <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'">直调完成</el-button>
         <el-button @click="goBack">关 闭</el-button>
@@ -183,11 +184,76 @@
       </span>
     </el-dialog>
 
+    <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="qty" 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>
+
   </div>
 </template>
 
 <script>
-import { getDetail, getWarehouseList, adjustDeliver, finishData } from "@/api/supply/retail";
+import { getDetail, getWarehouseList, adjustDeliver, finishData, directOrder } from "@/api/supply/retail";
 
 export default {
   name: 'RetailDetail',
@@ -230,6 +296,33 @@ export default {
       positionList: [],
 
       goodsList: [],
+
+      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: [],
     }
   },
 
@@ -272,6 +365,8 @@ export default {
         pageSize: -1,
       }).then(res => {
         this.warehouseList = res.data.records;
+        this.warehouseList1 = res.data.records;
+        this.warehouseList2 = res.data.records;
       })
     },
 
@@ -342,6 +437,85 @@ export default {
       }).catch(() => {});
     },
 
+    // 更改调出仓库
+    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;
+      });
+    },
+
+    // 更改调出仓位
+    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;
+      });
+    },
+
+    // 打开 提前开票
+    openDirectDialog() {
+      this.isShowDirectDialog = true;
+      this.directGoodsList = this.detailData.retailOrderItemList;
+      this.getWarehouseList();
+    },
+
+    // 关闭 提前开票
+    closeDirectDialog() {
+      this.isShowDirectDialog = false;
+    },
+
+    // 提交 提前开票
+    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.enginOrderId,
+            orderType: 'HOME', // 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();
+          })
+        }
+      })
+    },
+
   }
 }
 </script>

+ 17 - 3
src/views/supply/retail/components/retail_form.vue

@@ -260,17 +260,23 @@ import { getDetail, addData, editData, getSalesTypeList, getGoodsList, getWareho
 import { getDictList } from '@/api/common'
 import { findElem } from '@/utils/util'
 
+let that
 export default {
   name: 'RetailForm',
   componentName: 'RetailForm',
   props: ['listItem'],
   filters: {
     status1Filter(val) {
+      let STOCK_ORDER_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_START').dictValue;
+      let STOCK_ORDER_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_END').dictValue;
+      let STOCK_ORDER_HAVE_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_START').dictValue;
+      let STOCK_ORDER_HAVE_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_END').dictValue;
+      let STOCK_ORDER_ALL_NUM = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_ALL_NUM').dictValue;
       if (val === '' || val === null || val === undefined) return '未检查';
       else if (val === 0) return '无货';
-      else if (val > 0 && val <= 30) return val;
-      else if (val > 30 && val <= 1000) return '有货';
-      else if (val > 1000) return '充足';
+      else if (val > STOCK_ORDER_START && val <= STOCK_ORDER_END) return val;
+      else if (val >= STOCK_ORDER_HAVE_START && val <= STOCK_ORDER_HAVE_END) return '有货';
+      else if (val > STOCK_ORDER_ALL_NUM) return '充足';
     },
   },
   data() {
@@ -310,6 +316,7 @@ export default {
       listTotal: 0,
       salesTypeList: [],
       typeList: [],
+      stockList: [],
 
       leftGoodsList: [],
       rightGoodsList: [],
@@ -331,6 +338,10 @@ export default {
     },
   },
 
+  beforeCreate() {
+    that = this;
+  },
+
   created() {
     this.getDictList();
     this.getWarehouseList();
@@ -390,6 +401,9 @@ export default {
       getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
         this.typeList = res.data;
       })
+      getDictList({sysDictEnum: 'STOCK_ORDER'}).then(res => {
+        this.stockList = res.data;
+      })
     },
 
     // 获取商品列表

+ 8 - 17
src/views/supply/retail/retail_list.vue

@@ -70,7 +70,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'retail/export'" :exParams="exParams" />
@@ -128,14 +128,14 @@
             <el-table-column align="center" label="审核日期" prop="examineTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="220" fixed="right">
               <template slot-scope="scope">
-                <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="toReturn(scope.row)" v-if="scope.row.examineStatus === 'OK'">退订</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-popconfirm style="margin-left: 10px;" title="确定提审吗?" @onConfirm="handleSubmit(scope.row.id)" v-if="scope.row.examineStatus === 'SAVE'" >
-                  <el-button slot="reference" type="text">提审</el-button>
+                <el-popconfirm style="margin-left: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
+                  <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
-                <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="!scope.row.closeTime" >
+                <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="$checkBtnRole('examine', $route.meta.roles) && !scope.row.closeTime" >
                   <el-button slot="reference" type="text">关闭</el-button>
                 </el-popconfirm>
               </template>
@@ -245,15 +245,6 @@ export default {
   },
 
   methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
-    },
-
     // 查询列表
     getList() {
       this.listLoading = true;
@@ -348,7 +339,7 @@ export default {
       })
     },
 
-    // 提审
+    // 申请
     handleSubmit(id) {
       submitData({id}).then(res => {
         this.$successMsg();

+ 1 - 1
src/views/supply/return/return_list.vue

@@ -57,7 +57,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">退货</el-button>
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'retreat/export'" :exParams="exParams" />

+ 2 - 2
src/views/supply/sales/sales_list.vue

@@ -97,7 +97,7 @@
             <el-table-column align="center" label="操作" width="120" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
-                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -264,7 +264,7 @@ export default {
       // 获取页面模版
       const result = await new Promise((resolve, reject)=>{
         examineJudge({id: item.id}).then(res => {
-          resolve(res.data);
+          resolve(res.code == 200);
         }).catch(res => {
           resolve(0);
         })