Pārlūkot izejas kodu

Merge branch 'feature/Feature-basic_data' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-basic_data

chen 3 gadi atpakaļ
vecāks
revīzija
73c3176750
43 mainītis faili ar 473 papildinājumiem un 495 dzēšanām
  1. 9 0
      src/api/common.js
  2. 22 1
      src/api/user.js
  3. 2 99
      src/filters/index.js
  4. 3 1
      src/main.js
  5. 16 1
      src/utils/common.js
  6. 1 128
      src/utils/select_data.js
  7. 2 0
      src/views/issue/index.vue
  8. 71 19
      src/views/setting/other.vue
  9. 10 10
      src/views/supply/apply/apply_list.vue
  10. 15 13
      src/views/supply/apply/components/apply_form.vue
  11. 1 1
      src/views/supply/apply/components/engin_detail.vue
  12. 18 15
      src/views/supply/apply/components/engin_form.vue
  13. 10 10
      src/views/supply/apply/engin_list.vue
  14. 3 3
      src/views/supply/deliver/commerce_list.vue
  15. 28 14
      src/views/supply/deliver/components/commerce_detail.vue
  16. 27 13
      src/views/supply/deliver/components/deliver_detail.vue
  17. 27 13
      src/views/supply/deliver/components/home_detail.vue
  18. 3 3
      src/views/supply/deliver/deliver_list.vue
  19. 1 1
      src/views/supply/deliver/home_list.vue
  20. 4 13
      src/views/supply/direct/direct_list.vue
  21. 8 8
      src/views/supply/engin/commerce_list.vue
  22. 4 3
      src/views/supply/engin/components/commerce_detail.vue
  23. 2 1
      src/views/supply/engin/components/commerce_examine.vue
  24. 18 3
      src/views/supply/engin/components/commerce_form.vue
  25. 1 1
      src/views/supply/engin/components/commerce_return.vue
  26. 4 3
      src/views/supply/engin/components/home_detail.vue
  27. 2 1
      src/views/supply/engin/components/home_examine.vue
  28. 18 3
      src/views/supply/engin/components/home_form.vue
  29. 1 1
      src/views/supply/engin/components/home_return.vue
  30. 6 15
      src/views/supply/engin/engin_list.vue
  31. 6 15
      src/views/supply/engin/home_list.vue
  32. 5 5
      src/views/supply/pickup/pickup_list.vue
  33. 6 6
      src/views/supply/pickup/sum_list.vue
  34. 41 30
      src/views/supply/policy/components/retail_detail.vue
  35. 7 0
      src/views/supply/policy/components/retail_examine.vue
  36. 8 0
      src/views/supply/policy/components/retail_form2.vue
  37. 28 4
      src/views/supply/policy/components/retail_return.vue
  38. 6 5
      src/views/supply/policy/policy_list.vue
  39. 3 12
      src/views/supply/reserve/reserve_list.vue
  40. 17 3
      src/views/supply/retail/components/retail_form.vue
  41. 6 15
      src/views/supply/retail/retail_list.vue
  42. 1 1
      src/views/supply/return/return_list.vue
  43. 2 2
      src/views/supply/sales/sales_list.vue

+ 9 - 0
src/api/common.js

@@ -9,6 +9,15 @@ export function getDictList(params) {
   })
 }
 
+// 修改字典列表
+export function editDictList(params) {
+  return request({
+    url: '/common/dict/update',
+    method: 'post',
+    data: params
+  })
+}
+
 // 销售类型列表
 export function getTypeList(params) {
   return request({

+ 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
 }

+ 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>

+ 71 - 19
src/views/setting/other.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-radio-group v-model="formType" size="small">
+    <el-radio-group v-model="formType" size="small" @change="changeType">
       <el-radio-button label="first">订单日期设置</el-radio-button>
       <el-radio-button label="second">工程登录二次引用设置</el-radio-button>
       <el-radio-button label="third">自动预留单生成</el-radio-button>
@@ -10,27 +10,27 @@
     <div v-show="formType === 'first'">
       <div style="margin: 40px 0 30px;">
         <span>下单时间超过当天</span>
-        <el-time-picker v-model="firstForm.time" placeholder="选择时间点" size="small" style="width: 150px; margin: 0 10px;"></el-time-picker>
+        <el-time-picker v-model="firstForm.input1.dictValue" placeholder="选择时间点" size="small" format="HH:mm" style="width: 150px; margin: 0 10px;"></el-time-picker>
         <span>的订单,订单日期计为下一天的日期</span>
       </div>
-      <el-button type="primary" size="small">确 定</el-button>
+      <el-button type="primary" size="small" @click="submitForm('first')">确 定</el-button>
     </div>
 
     <div v-show="formType === 'second'">
       <div style="margin: 40px 0 30px;">
         <div>工程登录二次引用密码设置</div>
-        <div><el-input v-model="secondForm.password" placeholder="请输入密码" size="small" style="width: 150px; margin-top: 20px;"></el-input></div>
+        <div><el-input v-model="secondForm.input1.dictValue" placeholder="请输入密码" size="small" style="width: 150px; margin-top: 20px;"></el-input></div>
       </div>
-      <el-button type="primary" size="small">确 定</el-button>
+      <el-button type="primary" size="small" @click="submitForm('second')">确 定</el-button>
     </div>
 
     <div v-show="formType === 'third'">
       <div style="margin: 40px 0 30px;">
         <div>预留单自动生成时间,从订单审单后,第</div>
-        <el-input v-model="thirdForm.day" type="number" size="small" style="width: 150px; margin-top: 20px; margin-right: 10px"></el-input>
+        <el-input v-model="thirdForm.input1.dictValue" type="number" size="small" style="width: 150px; margin-top: 20px; margin-right: 10px"></el-input>
         <span>天零时起,按商家提交订单时间顺序,自动生成预留单</span>
       </div>
-      <el-button type="primary" size="small">确 定</el-button>
+      <el-button type="primary" size="small" @click="submitForm('third')">确 定</el-button>
     </div>
 
     <div v-show="formType === 'fourth'">
@@ -40,57 +40,63 @@
         <div style="margin-top: 10px">总可发货数为0,显示无货</div>
         <div style="margin-top: 10px">
           <span>总可发货数</span>
-          <el-input v-model="fourthForm.input1" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input1.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>到</span>
-          <el-input v-model="fourthForm.input2" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input2.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>,总库存显示具体数量</span>
         </div>
         <div style="margin-top: 10px">
           <span>总可发货数</span>
-          <el-input v-model="fourthForm.input3" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input3.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>到</span>
-          <el-input v-model="fourthForm.input4" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input4.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>,总库存显示有货</span>
         </div>
         <div style="margin-top: 10px">
           <span>总可发货数大于</span>
-          <el-input v-model="fourthForm.input5" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input5.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>,总库存显示充足</span>
         </div>
         <div style="margin-top: 30px">发货申请查询库存时:</div>
         <div style="margin-top: 10px">
           <span>可发货数大于</span>
-          <el-input v-model="fourthForm.input6" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input6.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>显示充足</span>
         </div>
       </div>
-      <el-button type="primary" size="small">确 定</el-button>
+      <el-button type="primary" size="small" @click="submitForm('fourth')">确 定</el-button>
     </div>
   </div>
 </template>
 
 <script>
+import { getDictList, editDictList } from '@/api/common'
 
 export default {
   data() {
     return {
       formType: 'first',
       firstForm: {
-        time: '',
+        input1: {},
       },
       secondForm: {
-        password: '',
+        input1: {},
       },
       thirdForm: {
-        day: '',
+        input1: {},
       },
       fourthForm: {
-
+        input1: {},
+        input2: {},
+        input3: {},
+        input4: {},
+        input5: {},
+        input6: {},
       }
     }
   },
   created() {
-    
+    this.getDetail('first');
   },
   methods: {
     // 查询按钮权限
@@ -102,6 +108,52 @@ export default {
       return true;
     },
 
+    changeType(val) {
+      this.getDetail(val);
+    },
+
+    getDetail(type) {
+      const MAP = {
+        first :'ORDER_TIME_LIMIT',
+        second :'ENGIN_TWO_PWD',
+        third :'RESERVED_DAY',
+        fourth :'STOCK_ORDER',
+      };
+      getDictList({sysDictEnum: MAP[type]}).then(res => {
+        let data = res.data.map(item => {
+          return {
+            sysDictId: item.sysDictId,
+            dictValue: item.dictValue,
+          }
+        })
+        if(type != 'fourth') {
+          this[type+'Form'].input1 = data[0];
+        }else {
+          this[type+'Form'].input1 = data[0];
+          this[type+'Form'].input2 = data[1];
+          this[type+'Form'].input3 = data[2];
+          this[type+'Form'].input4 = data[3];
+          this[type+'Form'].input5 = data[4];
+          this[type+'Form'].input6 = data[5];
+        }
+      })
+    },
+
+    submitForm(type) {
+      let list = [];
+      for(var key in this[type+'Form']) {
+        console.log(this[type+'Form'], this[type+'Form'][key].dictValue);
+        if(!this[type+'Form'][key].dictValue) {
+          return this.$errorMsg('请完善信息');
+        }
+        list.push(this[type+'Form'][key]);
+      }
+      editDictList(list).then(res => {
+        this.$successMsg('保存成功');
+        this.getDetail(type);
+      })
+    }
+
   }
 }
 </script>

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

@@ -19,8 +19,8 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="仓库" prop="warehouse">
-                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库"></el-input>
+              <el-form-item label="仓库名称" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -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>
@@ -193,7 +193,7 @@ export default {
     exParams() {
       return {
         id: this.screenForm.orderNum,
-        correspondId: this.screenForm.warehouse,
+        correspondName: this.screenForm.warehouse,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,
@@ -231,7 +231,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         id: this.screenForm.orderNum,
-        correspondId: this.screenForm.warehouse,
+        correspondName: this.screenForm.warehouse,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,

+ 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) {

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

@@ -19,8 +19,8 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="仓库" prop="warehouse">
-                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库"></el-input>
+              <el-form-item label="仓库名称" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -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>
@@ -196,7 +196,7 @@ export default {
     exParams() {
       return {
         id: this.screenForm.orderNum,
-        correspondId: this.screenForm.warehouse,
+        correspondName: this.screenForm.warehouse,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,
@@ -234,7 +234,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         id: this.screenForm.orderNum,
-        correspondId: this.screenForm.warehouse,
+        correspondName: this.screenForm.warehouse,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,

+ 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;

+ 8 - 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" />
@@ -122,17 +122,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>

+ 4 - 3
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>
@@ -217,7 +218,7 @@
         <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.directTransferQty" size="small" type="number"></el-input>
+            <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>

+ 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>

+ 4 - 3
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>
@@ -217,7 +218,7 @@
         <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.directTransferQty" size="small" type="number"></el-input>
+            <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>

+ 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;

+ 6 - 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" />
@@ -128,11 +128,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 +254,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);

+ 28 - 4
src/views/supply/policy/components/retail_return.vue

@@ -58,11 +58,35 @@
         <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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利钱包" prop="customerWalletName2" 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="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>
+        </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="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="现金钱包" prop="customerWalletName" 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="wallets"
+          min-width="100"
+          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-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="isDirectTransfer" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{scope.row.isDirectTransfer ? '是':'否'}}

+ 6 - 5
src/views/supply/policy/policy_list.vue

@@ -375,12 +375,13 @@
                   @click="toDetail(scope.row)"
                   >详情</el-button
                 >
-                <el-popconfirm
-                  style="margin-left: 10px"
-                  title="确定关闭吗?"
-                  @onConfirm="handleClose(scope.row.id)"
-                  v-if="!scope.row.closeTime"
+                <el-button
+                  type="text"
+                  @click="toReturn(scope.row)"
+                  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-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;

+ 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;
+      })
     },
 
     // 获取商品列表

+ 6 - 15
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-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;

+ 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);
         })