snow 2 years ago
parent
commit
ddf49720cb

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


+ 16 - 0
src/apis/service/serviceParam/paymentChannelGrossProfit/index.js

@@ -0,0 +1,16 @@
+// 物业管理员
+import http from '@/apis/axios'
+const api = 'admin/'
+
+export default {
+  // 分页查询
+  list: (data, params) => http(api + 'platformlist', data, 'post', params),
+  // 设置状态
+  status: (data, params) => http(api + 'spcpStatus', data, 'post', params),
+  // 更新 修改分类利率
+  update: (data, params) => http(api + 'channelcatsave', data, 'post', params),
+  // 创建
+  create: (data, params) => http(api + 'platformlist', data, 'post', params),
+  paymentChannelList: (data, params) => http(api + 'channellist', data, 'post', params),
+  categorylist: (data, params) => http(api + 'channelcatlist', data, 'post', params)
+}

+ 5 - 3
src/apis/service/serviceParam/paymentChannelManage/index.js

@@ -4,9 +4,11 @@ const api = 'admin/'
 
 export default {
   // 分页查询
-  list: (data, params) => http(api + 'platformlist', data, 'post', params),
+  list: (data, params) => http(api + 'channellist', data, 'post', params),
   // 设置状态
-  status: (data, params) => http(api + 'spcpStatus', data, 'post', params),
+  status: (data, params) => http(api + 'channelstatus', data, 'post', params),
   // 更新
-  update: (data, params) => http(api + 'platformlist', data, 'post', params)
+  update: (data, params) => http(api + 'channeledit', data, 'post', params),
+  // 创建
+  create: (data, params) => http(api + 'channeladd', data, 'post', params)
 }

+ 3 - 1
src/apis/service/serviceParam/terrace/index.js

@@ -14,5 +14,7 @@ export default {
   status: (data, params) => http(api + 'platformstatus', data, 'post', params),
   // 删除
   delete: (data, params) => http(api + 'platformdelete', data, 'post', params),
-  company: (data, params) => http(api + 'businesslist', data, 'post', params)
+  company: (data, params) => http(api + 'businesslist', data, 'post', params),
+  // 分页查询
+  paymentChannelist: (data, params) => http(api + 'channellist', data, 'post', params)
 }

+ 122 - 122
src/views/businessReportQuery/businessFinanceReport/components/ExTableNew.vue

@@ -4,11 +4,11 @@
       <template v-for="(item, index) in table._defaultHeader_">
         <el-dropdown
           v-if="item == 'setcol'"
+          :key="index"
           placement="bottom-end"
           trigger="click"
           class="setcol-table-lie"
           :hide-on-click="false"
-          :key="index"
         >
           <el-button size="small">列设置</el-button>
           <el-dropdown-menu slot="dropdown" :class="'ex-table-setcol-dropdown'">
@@ -22,7 +22,7 @@
                   :active-text="column.label"
                   :active-value="false"
                   :inactive-value="true"
-                ></el-switch>
+                />
               </el-dropdown-item>
             </template>
           </el-dropdown-menu>
@@ -32,31 +32,31 @@
         name="table-header"
         :selection="tableSelection"
         :alldata="data"
-      ></slot>
+      />
     </div>
     <el-table
       ref="elTable"
       :data="data"
       v-bind="table"
       :size="size"
-      v-on="$listeners"
-      @selection-change="tableSelection = $event"
       :span-method="arraySpanMethod"
       style="width: 100%"
+      v-on="$listeners"
+      @selection-change="tableSelection = $event"
     >
       <template v-for="(column, index) in columns">
         <el-table-column
-          align="center"
           v-if="!column._hidden_ && column.type && !column._slot_"
-          v-bind="column"
           :key="index"
+          align="center"
+          v-bind="column"
           width="45px"
-        ></el-table-column>
+        />
         <el-table-column
-        show-overflow-tooltip
           v-else-if="!column._hidden_"
-          v-bind="column"
           :key="index"
+          show-overflow-tooltip
+          v-bind="column"
         >
           <template slot="header" slot-scope="scope">
             <span>{{ column.label }}</span>
@@ -71,7 +71,7 @@
               />
               <el-tooltip
                 v-else
-                 
+
                 :effect="column._screen_tip_effect_ || 'dark'"
                 :content="column._screen_tip_ || '筛选'"
                 :placement="column._screen_tip_placement_ || 'top'"
@@ -88,13 +88,13 @@
             slot-scope="scope"
             :name="column._slot_"
             :scope="scope"
-          ></slot>
+          />
           <template v-else-if="column._render_" slot-scope="scope">
             <ex-slot
               :column="column"
               :render="column._render_"
               :scope="scope"
-            ></ex-slot>
+            />
           </template>
           <template v-else slot-scope="scope">
             <span>{{
@@ -138,28 +138,62 @@
 </template>
 
 <script>
-import Sortable from "sortablejs";
+import Sortable from 'sortablejs'
 export default {
-  name: "ex-table",
+  name: 'ExTable',
   components: {
-    "ex-slot": {
+    'ex-slot': {
       functional: true,
       props: {
         render: Function,
         scope: {
           type: Object,
-          default: null,
+          default: null
         },
         column: {
           type: Object,
-          default: null,
-        },
+          default: null
+        }
       },
       render: (h, data) => {
-        if (data.props.column) data.props.scope.column = data.props.column;
-        return data.props.render(h, data.props.scope);
-      },
-    },
+        if (data.props.column) data.props.scope.column = data.props.column
+        return data.props.render(h, data.props.scope)
+      }
+    }
+  },
+  directives: {
+    // v-drap  可拖拽指令
+    drap: {
+      inserted: function(element, binding) {
+        element.onmousedown = function(e) {
+          const el = binding.modifiers.parent ? element.parentNode : element
+          const bodyWidth = document.body.offsetWidth
+          const bodyHeight = document.body.offsetHeight
+          const elWidth = el.offsetWidth
+          const elHeight = el.offsetHeight
+          // 开始拖动,记录左上角坐标点
+          const disX = e.clientX - el.offsetLeft
+          const disY = e.clientY - el.offsetTop
+          document.onmousemove = function(e) {
+            // 拖动中,修改dom的左上角坐标点
+            let l = e.clientX - disX
+            let t = e.clientY - disY
+            if (binding.modifiers.limit) {
+              l = l < 0 ? 0 : l
+              t = t < 0 ? 0 : t
+              l = l > bodyWidth - elWidth ? bodyWidth - elWidth : l
+              t = t > bodyHeight - elHeight ? bodyHeight - elHeight : t
+            }
+            el.style.left = l + 'px'
+            el.style.top = t + 'px'
+          }
+          document.onmouseup = function() {
+            // 结束拖动
+            document.onmousemove = null
+          }
+        }
+      }
+    }
   },
   props: {
     /**
@@ -175,12 +209,12 @@ export default {
      */
     table: {
       type: Object,
-      default: () => {},
+      default: () => {}
     },
     // el-table 表格数据 对应data字段
     data: {
       type: Array,
-      default: () => [],
+      default: () => []
     },
     /**
      * el-table-column 表格列属性集合
@@ -202,7 +236,7 @@ export default {
      */
     columns: {
       type: Array,
-      default: () => [],
+      default: () => []
     },
     /**
      * el-pagination
@@ -218,119 +252,85 @@ export default {
      */
     page: {
       type: [Boolean, Object],
-      default: false,
+      default: false
     },
     /**
      * 筛选条件集合
      */
     conditions: {
       type: Array,
-      default: () => [],
+      default: () => []
     },
     /**
      * 是否允许拖拽行
      */
     isRowDrop: {
       type: Boolean,
-      default: false,
+      default: false
     },
     /**
      * 是否允许拖拽列
      */
     isColDrop: {
       type: Boolean,
-      default: false,
+      default: false
     },
     /**
      * 表格大小
      */
     size: {
       type: String,
-      default: "mini",
-    },
+      default: 'mini'
+    }
+  },
+  data() {
+    return {
+      // 表格选中项
+      tableSelection: []
+    }
   },
   computed: {
     // 允许筛选的列
     screenColumns() {
-      return this.columns.filter((item) => item._screen_ === true);
+      return this.columns.filter((item) => item._screen_ === true)
     },
     // 允许设置的列
     setColumns() {
-      return this.columns.filter((item) => !item._noset_);
+      return this.columns.filter((item) => !item._noset_)
     },
     // 筛选条件是否包含当前列
     isHasScreenColumn() {
-      return function (col) {
-        return this.conditions.some((item) => item.prop === col.prop);
-      };
-    },
-  },
-  data() {
-    return {
-      // 表格选中项
-      tableSelection: [],
-    };
+      return function(col) {
+        return this.conditions.some((item) => item.prop === col.prop)
+      }
+    }
   },
-   computed: {
+  computed: {
     page_curr() {
-      return this.page.curr;
+      return this.page.curr
     },
     page_size() {
-      return this.page.size;
+      return this.page.size
     },
     page_total() {
-      return this.page.total;
-    },
+      return this.page.total
+    }
   },
   watch: {
-    page_curr: function (val) {
-      this.page.curr = val;
+    page_curr: function(val) {
+      this.page.curr = val
     },
-    page_size: function (val) {
-      this.page.size = val;
-    },
-    page_total: function (val) {
-      this.page.total = val;
+    page_size: function(val) {
+      this.page.size = val
     },
+    page_total: function(val) {
+      this.page.total = val
+    }
   },
   mounted() {
     // 拖拽绑定
-    this.rowDrop();
-    this.columnDrop();
-  },
-  directives: {
-    // v-drap  可拖拽指令
-    drap: {
-      inserted: function (element, binding) {
-        element.onmousedown = function (e) {
-          let el = binding.modifiers.parent ? element.parentNode : element,
-            bodyWidth = document.body.offsetWidth,
-            bodyHeight = document.body.offsetHeight,
-            elWidth = el.offsetWidth,
-            elHeight = el.offsetHeight;
-          // 开始拖动,记录左上角坐标点
-          let disX = e.clientX - el.offsetLeft;
-          let disY = e.clientY - el.offsetTop;
-          document.onmousemove = function (e) {
-            // 拖动中,修改dom的左上角坐标点
-            let l = e.clientX - disX;
-            let t = e.clientY - disY;
-            if (binding.modifiers.limit) {
-              l = l < 0 ? 0 : l;
-              t = t < 0 ? 0 : t;
-              l = l > bodyWidth - elWidth ? bodyWidth - elWidth : l;
-              t = t > bodyHeight - elHeight ? bodyHeight - elHeight : t;
-            }
-            el.style.left = l + "px";
-            el.style.top = t + "px";
-          };
-          document.onmouseup = function () {
-            // 结束拖动
-            document.onmousemove = null;
-          };
-        };
-      },
-    },
+    this.rowDrop()
+    this.columnDrop()
   },
   methods: {
     //
@@ -348,79 +348,79 @@ export default {
         if (rowIndex % 2 === 0) {
           return {
             rowspan: 2,
-            colspan: 1,
-          };
+            colspan: 1
+          }
         } else {
           return {
             rowspan: 0,
-            colspan: 0,
-          };
+            colspan: 0
+          }
         }
       }
     },
 
-    //行拖拽
+    // 行拖拽
     rowDrop() {
       const tbody = document.querySelector(
-        ".el-table__body-wrapper > table > tbody"
-      );
+        '.el-table__body-wrapper > table > tbody'
+      )
       Sortable.create(tbody, {
         disabled: !this.isRowDrop,
-        ghostClass: "sortable-ghost",
+        ghostClass: 'sortable-ghost',
         animation: 180,
         delay: 0,
         onEndevt: (evt) => {
-          const currItem = this.data.splice(evt.oldIndex, 1)[0];
-          this.data.splice(evt.newIndex, 0, currItem);
-        },
-      });
+          const currItem = this.data.splice(evt.oldIndex, 1)[0]
+          this.data.splice(evt.newIndex, 0, currItem)
+        }
+      })
     },
-    //列拖拽
+    // 列拖拽
     columnDrop() {
-      const wrapperTr = document.querySelector(".el-table__header-wrapper tr");
+      const wrapperTr = document.querySelector('.el-table__header-wrapper tr')
       Sortable.create(wrapperTr, {
         disabled: !this.isColDrop,
-        ghostClass: "sortable-ghost",
+        ghostClass: 'sortable-ghost',
         animation: 180,
         delay: 0,
         onEnd: (evt) => {
-          const currItem = this.columns.splice(evt.oldIndex, 1)[0];
-          this.columns.splice(evt.newIndex, 0, currItem);
-        },
-      });
+          const currItem = this.columns.splice(evt.oldIndex, 1)[0]
+          this.columns.splice(evt.newIndex, 0, currItem)
+        }
+      })
     },
     // 获取对象的属性
     getObjPrototype(o, a) {
-      let fn = Function;
-      return new fn("obj", `return obj.${a}`)(o);
+      const fn = Function
+      return new fn('obj', `return obj.${a}`)(o)
     },
     /** 表格方法 传递给el-table,后续有需要可继续增加 **/
     // 对 Table 进行重新布局。当 Table 或其祖先元素由隐藏切换为显示时,可能需要调用此方法
     doLayout(...arg) {
-      this.$refs.elTable.doLayout(...arg);
+      this.$refs.elTable.doLayout(...arg)
     },
     // 用于多选表格,清空用户的选择
     clearSelection(...arg) {
-      this.$refs.elTable.clearSelection(...arg);
+      this.$refs.elTable.clearSelection(...arg)
     },
     // 用于多选表格,切换某一行的选中状态
     toggleRowSelection(...arg) {
-      this.$refs.elTable.toggleRowSelection(...arg);
+      this.$refs.elTable.toggleRowSelection(...arg)
     },
     // 用于多选表格,切换所有行的选中状态
     toggleAllSelection(...arg) {
-      this.$refs.elTable.toggleAllSelection(...arg);
+      this.$refs.elTable.toggleAllSelection(...arg)
     },
     // 用于单选表格,设定某一行为选中行
     setCurrentRow(...arg) {
-      this.$refs.elTable.setCurrentRow(...arg);
+      this.$refs.elTable.setCurrentRow(...arg)
     },
     // 用于可展开表格与树形表格,切换某一行的展开状态,如果使用了第二个参数,则是设置这一行展开与否(expanded 为 true 则展开)
     toggleRowExpansion(...arg) {
-      this.$refs.elTable.toggleRowExpansion(...arg);
-    },
-  },
-};
+      this.$refs.elTable.toggleRowExpansion(...arg)
+    }
+  }
+}
 </script>
 
 <style lang="css">

+ 3 - 3
src/views/interest/group/addEdit.vue

@@ -259,7 +259,7 @@ export default {
 
         switch (method) {
           case 'update':
-            //删除的用户/组
+            // 删除的用户/组
             // eslint-disable-next-line no-case-declarations
             const delUsers = this.userList
               .filter(({ uid }) => !this.ruleForm.uids.includes(String(uid))).map(({ uid, id }) => ({
@@ -268,7 +268,7 @@ export default {
                 is_del: 1
               }))
 
-            //原始用户/组
+            // 原始用户/组
             // eslint-disable-next-line no-case-declarations
             const originUsers = this.userList
               .filter(({ uid }) => this.ruleForm.uids.includes(String(uid))).map(({ uid, id }) => ({
@@ -277,7 +277,7 @@ export default {
                 is_del: 0
               }))
 
-            //添加的用户/组
+            // 添加的用户/组
             // eslint-disable-next-line no-case-declarations
             const addUsers = this.ruleForm.uids
               .filter(_uid => !originUsers.find(({ uid }) => String(uid) === String(_uid)) && !delUsers.find(({ uid }) => String(uid) === String(_uid)))

+ 2 - 2
src/views/netOrderEntry/netOrderEnter/addEdit.vue

@@ -603,8 +603,8 @@ export default {
         console.log(type, tax)
       }
       if (type === 2) {
-        // cgd_price = (100 - cgd_tax) * goodPrice;
-        cgd_price = accMul(accDiv(100, cgd_tax), goodPrice)
+        // cgd_price = ((100 - cgd_tax) / 100) * goodPrice;
+        cgd_price = accMul(accDiv(accSub(100, cgd_tax), 100), goodPrice)
         this.ruleForm.cgdPrice = cgd_price
         this.$refs.ruleForm.validateField('cgdPrice')
         console.log(type, cgd_tax)

+ 0 - 4
src/views/netOrderEntry/prestoreRecordingOrders/importTemplateModal.vue

@@ -29,7 +29,6 @@ import asyncRequest from '@/apis/service/netOrderEntry/netOrderEnter'
 import { isMobile, isPhone, isnumber } from '@/utils/validate'
 import companyHelper from '@/mixins/companyHelper'
 import { MessageBox } from 'element-ui'
-import dayjs from 'dayjs'
 
 import {
   helper,
@@ -42,7 +41,6 @@ import {
   requiredFields,
   numberFields
 } from './template'
-import { join } from 'path'
 
 export default {
   mixins: [companyHelper],
@@ -108,7 +106,6 @@ export default {
       })
       return verification
     },
-    // tslint:disable-next-line:typedef
     formatDate2(numb, format = '-', mao = ':') {
       const time = new Date((numb - 1) * 24 * 3600000 + 1)
       time.setYear(time.getFullYear() - 70)
@@ -120,7 +117,6 @@ export default {
       const minutes = time.getMinutes() + ''
       const seconds = time.getSeconds() + ''
       if (format && format.length === 1) {
-      // tslint:disable-next-line:max-line-length
         return year + format + month + format + date + ' ' + (houer < 10 ? (houer === 0 ? '00' : '0' + houer) : houer) + mao + (minutes < 10 ? (minutes === 0 ? '00' : '0' + minutes) : minutes) + mao + (seconds < 10 ? (seconds === 0 ? '00' : '0' + seconds) : seconds)
       }
       return year + (month < 10 ? '0' + month : month) + (date < 10 ? '0' + date : date) + ' ' + (houer < 10 ? '0' + date : date)

+ 0 - 28
src/views/netOrderEntry/prestoreRecordingOrders/index.vue

@@ -255,11 +255,6 @@ export default {
           label: "订单编号",
           width: "175px",
         },
-        // {
-        //   prop: "cgdNo",
-        //   label: "采购单编号",
-        //   width: "155px",
-        // },
         {
           prop: "good_name",
           label: "商品名称",
@@ -282,29 +277,6 @@ export default {
           label:'状态',
           _slot_:'status'
         },
-        // {
-        //   prop: "total_price",
-        //   label: "总价",
-        // },
-
-        // {
-        //   prop: "status",
-        //   label: "订单状态",
-        //   _slot_: "status",
-        //   width: "120px",
-        // },
-        // {
-        //   prop: "order_source",
-        //   label: "订单来源",
-        //   _slot_: "order_source",
-        //   width: "90px",
-        // },
-        // {
-        //   prop: "order_type",
-        //   label: "商品类型",
-        //   _slot_: "order_type",
-        //   width: "90px",
-        // },
         {
           prop: "supplierNo",
           label: "供应商公司编号",

+ 195 - 0
src/views/serviceParam/paymentChannelGrossProfit/addEditRate.vue

@@ -0,0 +1,195 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="12vh"
+    width="600px"
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card style="margin: -20px 0 0 0">
+      <el-row :gutter="0">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :size="'small'"
+            :rules="rulesThis"
+            label-width="110px"
+            class="demo-ruleForm"
+            :disabled="isDetail"
+          >
+            <el-form-item label="支付渠道编码" prop="channel_id">
+              <el-input
+                v-model="ruleForm['channel_id']"
+                disabled
+                placeholder="名称"
+                maxlength="20"
+              />
+            </el-form-item>
+
+            <el-form-item label="一类分类ID" prop="cat_id">
+              <el-input
+                v-model="ruleForm['cat_id']"
+                disabled
+                placeholder="一类分类ID"
+                maxlength="20"
+              />
+            </el-form-item>
+
+            <el-form-item label="支付渠道毛利率" prop="rate" label-width="125px">
+              <digital-input
+                :values="ruleForm['rate']"
+                :placeholder="'支付渠道毛利率'"
+                :min="0"
+                :disabled="this.actionType === actionTypes.PREVIEW"
+                :max="100"
+                :position="'right'"
+                :precision="2"
+                :size="'mini'"
+                :controls="false"
+                @reschange="number_change($event, 'rate')"
+              />
+            </el-form-item>
+          </el-form>
+        </el-col>
+
+        <el-col :span="24" style="text-align: right">
+          <el-button
+            v-if="id !== '007' && !isDetail"
+            type="primary"
+            :size="'small'"
+            @click="submitForm"
+          >保 存
+          </el-button>
+          <el-button :size="'small'" @click="showModelThis = false">{{
+            id == "007" ? "关 闭" : "取 消"
+          }}</el-button>
+        </el-col>
+      </el-row>
+    </el-card>
+  </el-dialog>
+</template>
+
+<script>
+import asyncRequest from '@/apis/service/serviceParam/paymentChannelGrossProfit'
+import companyHelper from '@/mixins/companyHelper'
+import resToken from '@/mixins/resToken'
+import { actionTypes } from '@/utils/actionType'
+
+export default {
+  name: 'Sort',
+  mixins: [resToken, companyHelper],
+  props: ['showModel', 'id', 'sitem', 'actionType', 'paymentChannelId'],
+  data() {
+    return {
+      actionTypes,
+      loading: false,
+      showModelThis: this.showModel,
+      pid_name: '',
+      ruleForm: {
+        cat_id: '',
+        channel_id: ''
+      },
+      rulesThis: this.rules,
+      rules: {
+        cat_id: [{ required: true, trigger: 'blur' }],
+        channel_id: [{ required: true, trigger: 'blur' }],
+        支付渠道毛利率: [{ required: true, trigger: 'blur' }]
+      }
+    }
+  },
+  computed: {
+    title() {
+      const base = '支付渠道'
+      const prefix = this.actionsType === actionTypes.PREVIEW ? '查看' : this.actionType === actionTypes.UPDATE ? '设置' : '新建'
+      return prefix + base
+    }
+  },
+  watch: {
+    showModel: function(val) {
+      this.showModelThis = val
+      if (val) {
+        this.initForm()
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit('cancel')
+      }
+    }
+  },
+  methods: {
+    async initForm() {
+      this.loading = true
+      this.rulesThis = this.rules
+      await this.resetForm()
+      this.loading = false
+    },
+
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields()
+          this.$refs.ruleForm.clearValidate()
+
+          const {
+            cat_id,
+            rate
+          } = this.sitem
+
+          console.log(this.sitem)
+
+          this.ruleForm = {
+            cat_id: cat_id || '',
+            channel_id: this.paymentChannelId || '',
+            rate: rate || ''
+          }
+        }
+      })
+    },
+
+    async number_change(e, key) {
+      this.ruleForm[key] = e + '' || '0'
+      this.$refs.ruleForm.validateField(key)
+    },
+    async submitForm() {
+      if (!this.isHasCurrentCompany()) return
+      await this.$refs.ruleForm.validate(async(valid) => {
+        if (valid) {
+          if (!this.loading) {
+            const model = JSON.parse(JSON.stringify(this.ruleForm))
+            const api = this.actionType === this.actionTypes.CREATE ? asyncRequest.create : asyncRequest.update
+            const res = await api(model)
+            this.loading = false
+            if (res && res.code === 0) {
+              this.showModelThis = false
+              this.$emit('refresh')
+            } else if (res && res.code >= 100 && res.code <= 104) {
+              await this.logout()
+            } else {
+              this.$message.warning(res.message)
+            }
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.sort {
+}
+</style>

+ 38 - 0
src/views/serviceParam/paymentChannelGrossProfit/columns.js

@@ -0,0 +1,38 @@
+export const paymentChannelColumns = [
+  {
+    _slot_: 'selection',
+    label: '选择',
+    align: 'center'
+  },
+  {
+    prop: 'channel_name',
+    label: '支付渠道名称',
+    'min-width': '130px'
+  },
+  {
+    prop: 'companyName',
+    label: '业务公司',
+    'min-width': '130px'
+  }
+]
+
+export const categoryColumns = [
+  {
+    prop: 'cat_name',
+    label: '一级分类名称',
+    'min-width': '130px'
+  },
+  {
+    prop: 'rate',
+    label: '支付渠道毛利率',
+    'min-width': '130px'
+  },
+  {
+    prop: '',
+    label: '操作',
+    fixed: 'right',
+    width: '140px',
+    _noset_: true,
+    _slot_: 'operation'
+  }
+]

+ 497 - 0
src/views/serviceParam/paymentChannelGrossProfit/index.vue

@@ -0,0 +1,497 @@
+<template>
+           <!--   <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+              <el-button type="primary" :size="searchSize" @click="searchList">
+                刷新
+              </el-button>
+            </el-col>
+            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+              <el-button type="warning" :size="searchSize" @click="restSearch">
+                重置
+              </el-button>
+            </el-col>
+          </el-row>
+          <el-row>
+              <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+              <el-button type="primary" :size="searchSize" @click=" setRate({}, actionTypes.CREATE)">
+                新建
+              </el-button>
+            </el-col> -->
+
+  <div class="sort pagePadding">
+     <div class="table__wrapper" v-if="powers.some((i) => i == '001')">
+      <ex-table
+        ref="paymentChannelRef"
+        class="fl"
+        style="width:35%"
+        v-loading="loadings.paymentChannel"
+        :table="table"
+        :data="datas.paymentChannel"
+        :columns="paymentChannelColumns"
+        :page="pageInfo.paymentChannel"
+        :size="size"
+        :row-key="row => row.id"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @screen-reset="
+          pageInfo.paymentChannel.curr = 1;
+          parmValue.paymentChannel.page = 1;
+          onSearchPaymentChannelGrossProfit();
+        "
+        @screen-submit="
+          pageInfo.paymentChannel.curr = 1;
+          parmValue.paymentChannel.page = 1;
+          onSearchPaymentChannelGrossProfit();
+        "
+      >
+        <template #selection="{scope}">
+            <el-radio  v-model="selectedRow" :label="scope.row"><i></i></el-radio>
+        </template>
+
+
+        <template #table-header="{}">
+          <div style="width: 100%">
+              <div style="display:inline-flex;align-items: center;">
+                <p style="text-align:right;margin-right: 10px;width:160px">支付渠道名称:</p>
+                <el-input 
+                  size="mini" 
+                  placeholder="支付渠道名称"
+                  v-model="parmValue.paymentChannel['channel_name']"
+                  clearable
+                  @change="pageInfo.paymentChannel.curr = 1;parmValue.paymentChannel.page = 1;onSearchPaymentChannelGrossProfit()" 
+                />
+              </div>
+            </div>
+          </template>
+      </ex-table>
+
+      <ex-table
+       class="fr"
+        v-loading="loadings.category"
+        style="width:65%"
+        v-if="powers.some((i) => i == '001')"
+        :table="table"
+        :data="datas.category"
+        :columns="categoryColumns"
+        :page="pageInfo.category"
+        :size="size"
+        @page-curr-change="value => handlePageChange(value,true)"
+        @page-size-change="value => handleSizeChange(value,true)"
+        @screen-reset="
+          pageInfo.category.curr = 1;
+          parmValue.category.page = 1;
+          onSearchcategorylist();
+        "
+        @screen-submit="
+          pageInfo.category.curr = 1;
+          parmValue.category.page = 1;
+          onSearchcategorylist();
+        "
+      >
+        <template #table-header="{}">
+            <div style="display:inline-flex;align-items: center;">
+                <p style="text-align:right;margin-right: 10px;width:160px">一级分类名称:</p>
+                <el-input size="mini" 
+                   v-model="parmValue.category['cat_name']"
+                   placeholder="一级分类名称" 
+                   clearable
+                  @change=" 
+                    pageInfo.category.curr = 1;
+                    parmValue.category.page = 1;
+                    onSearchcategorylist()" 
+                 />
+              </div>
+        </template>
+
+        <template #operation="{ scope }">
+          <el-tooltip
+            v-if="powers.some((i) => i == '007')"
+            effect="dark"
+            content="查看"
+            placement="top"
+          >
+            <i class="el-icon-view tb-icon" @click="setRate(scope.row, actionTypes.PREVIEW)"></i>
+          </el-tooltip>
+
+          <el-tooltip
+            v-if="powers.some((i) => i == '005')"
+            effect="dark"
+            content="修改"
+            placement="top"
+          >
+            <i class="el-icon-edit tb-icon" @click="setRate(scope.row,actionTypes.UPDATE)"></i>
+          </el-tooltip>
+       </template>
+      </ex-table>
+     </div>
+
+    <no-auth v-else />
+
+    <!-- 弹窗 新增/修改 -->
+    <add-edit-rate
+      :id="modelRateId"
+      :show-model="showRateModel"
+      :sitem="sitemCategory"
+      @refresh="onSearchcategorylist"
+      @cancel="showRateModel = false"
+      :paymentChannelId="selectedRow.id || ''"
+      :actionType="actionType"
+    />
+  </div>
+</template>
+<script>
+import addEditRate from "./addEditRate";
+import asyncRequest from "@/apis/service/serviceParam/paymentChannelGrossProfit";
+import { statusList } from "@/assets/js/statusList";
+import roleLevel from "@/assets/js/roleLevel";
+import mixinPage from "@/mixins/elPaginationHandle";
+import companyHelper from "@/mixins/companyHelper";
+import resToken from "@/mixins/resToken";
+import { mapGetters } from "vuex";
+import privateField from "@/mixins/privateField";
+import { actionTypes } from "@/utils/actionType";
+
+import { paymentChannelColumns,categoryColumns } from "./columns"
+export default {
+  name: "othsearchSort",
+  mixins: [mixinPage, resToken, companyHelper, privateField],
+  components: {
+    addEditRate,
+  },
+  computed: {
+    //组件SIZE设置
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      const { btnList } = this.$store.getters;
+      const tran = btnList.find((i) => i.menu_route == "paymentChannelManage") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      selectedRow:{},
+      categoryColumns,
+      paymentChannelColumns,
+      actionTypes,
+      actionType:'',
+      isDetail: true,
+      private_field: [],
+      statusList: statusList,
+      roleLevel: roleLevel,
+      loading: false,
+      sitem: {},
+      showRateModel: false,
+      modelRateId: "000",
+      sitemCategory: {},
+      titleList: [],
+      loadings:{
+        paymentChannel:false,
+        category:false
+      },
+      datas:{
+        paymentChannel:[],
+        category:[]
+      },
+      parmValue: {
+        paymentChannel:{
+          page: 1, // 页码
+          size: 15, // 每页显示条数
+          channel_name:"",
+        },
+        category:{
+          page: 1, // 页码
+          size: 100, // 每页显示条数
+          cat_name:"",
+        }
+      },
+      // 状态
+      statusOptions: [
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" },
+      ],
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+      },
+      // 表格 - 分页
+      pageInfo: {
+        paymentChannel:{
+          size: 15,
+          curr: 1,
+          total: 0,
+        },
+        category:{
+          size: 100,
+          curr: 1,
+          total: 0,
+        }        
+      },
+      // 表格 - 列参数
+      columns: [
+        {
+          prop: "id",
+          label: "ID",
+          minWidth: "60px",
+        },
+        {
+          prop: "channel_name",
+          label: "支付渠道名称",
+          width: "230px",
+        },
+        {
+          prop: "status",
+          label: "当前状态",
+          width: "230px",
+          _slot_:'status'
+        },
+        {
+          prop: "创建人参数",
+          label: "创建人",
+          width: "230px",
+        },
+        {
+          prop: "addtime",
+          label: "创建时间",
+          width: "260px",
+        },
+        {
+          prop: "",
+          label: "操作",
+          fixed: "right",
+          width: "140px",
+          _noset_: true,
+          _slot_: "operation",
+        },
+      ],
+    };
+  },
+  watch:{
+    selectedRow:{
+      handler(value){
+        if(JSON.stringify(value) === "{}"){
+          this.datas.category = []
+        }else{
+          this.onSearchcategorylist()
+        }
+      }
+    }
+  },
+  mounted() {
+    this.parmValue.pid = "0";
+    this.onSearchPaymentChannelGrossProfit()
+  },
+  methods: {
+    async handlePageChange(val,isCategory = false) {
+      const prop = isCategory ? 'category' : 'paymentChannel'
+      this.parmValue[prop].page = val
+      this.pageInfo[prop].curr = val
+      if(!isCategory) this.selectedRow = {}
+      await isCategory ? this.onSearchcategorylist() : this.onSearchPaymentChannelGrossProfit()
+    },
+    async handleSizeChange(val, isCategory = false) {
+      const prop = isCategory ? 'category' : 'paymentChannel'
+      this.parmValue[prop].page = 1
+      this.pageInfo[prop].curr = 1
+      this.pageInfo[prop].size = val
+      this.parmValue[prop].size = val
+      if(!isCategory) this.selectedRow = {}
+      await isCategory ? this.onSearchcategorylist() : this.onSearchPaymentChannelGrossProfit()
+    },
+    handleSelectChange(rows){
+      console.log(rows)
+      this.$refs.paymentChannelRef && this.$refs.paymentChannelRef.clearSelection();
+      const selectedRow = rows.length > 0 ? rows[0] : null
+      this.$refs.paymentChannelRef && selectedRow && this.$refs.paymentChannelRef.toggleRowSelection(selectedRow)
+      this.selectedRow = selectedRow
+    },
+    restSearch() {
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.parmValue = {
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        status: "",
+        channel_name:"",
+        创建人参数:""
+      };
+      this.onSearchPaymentChannelGrossProfit();
+    },
+    //设置毛利率
+    setRate(row, actionType) {
+      this.actionType = actionType
+      this.modelRateId = row.id;
+      this.sitemCategory = row;
+      this.showRateModel = true;
+    },
+
+    async changeBreadcrumb(index) {
+      if (index + 1 === this.titleList.length) {
+        return;
+      } else {
+        this.parmValue.pid = this.titleList[index].id;
+        this.parmValue.status = ""
+        this.parmValue.cat_name = ""
+        this.titleList = this.titleList.slice(0, index + 1);
+      }
+      
+      this.parmValue.cat_name = "";
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      await this.onSearchPaymentChannelGrossProfit();
+    },
+
+    async changeStatus(id, status) {
+      await this.$confirm(`确定要改为${status + "" === "1" ? "禁用" : "启用"}?`, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+
+          const model = {
+            id,
+            status: String(status) ? (String(status) === "1" ? "0" : "1") : "1",
+            companyNo: this.currentCompany
+          };
+
+          const res = await asyncRequest.status(model);
+          if (res && res.code === 0) {
+            this.loading = false;
+
+            this.$notify.success({
+              title: "状态修改成功!",
+              message: "",
+            });
+
+            await this.onSearchPaymentChannelGrossProfit();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.loading = false;
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+
+    async onSearchPaymentChannelGrossProfit(){
+      if (this.loadings.paymentChannel) return;
+
+      if (!this.currentCompany) {
+        this.$message.warning("请选择公司!");
+        this.datas.paymentChannel = []
+        return;
+      }       
+
+      this.loadings.paymentChannel = true;
+      const { code, data } = await asyncRequest.paymentChannelList({
+        ...this.parmValue.paymentChannel,
+        companyNo:this.currentCompany
+      });
+
+
+      if (code === 0) {
+       const { list, count } = data ?? {};
+       this.datas.paymentChannel = list ?? [];
+       this.datas.category = []
+       this.selectedRow = {}
+       this.pageInfo.paymentChannel.total = count ?? 0;
+      }else if (code >= 100 && code <= 104) {
+       await this.logout();
+      }else {
+       this.datas.paymentChannel = [];
+       this.pageInfo.paymentChannel.total = 0;
+      }
+      this.loadings.paymentChannel = false;
+    },
+
+    async onSearchcategorylist(){
+      if (this.loading) return;
+
+      if (!this.currentCompany) {
+        this.$message.warning("请选择公司!");
+        return;
+      }       
+
+      this.parmValue.companyNo = this.currentCompany;
+      this.loadings.category = true;
+      
+      const { code, data } = await asyncRequest.categorylist({
+        channel_id:this.selectedRow.id,
+        ...this.parmValue.category
+      });
+
+      if (code === 0) {
+       this.datas.category = data || []
+       this.pageInfo.category.total = data.length
+      }else if (code >= 100 && code <= 104) {
+       await this.logout();
+      }else {
+       this.datas.category = [];
+       this.pageInfo.category.total = 0;
+      }
+
+      this.loadings.category = false;
+    },
+    onCompanyChange(){
+      this.selectedRow = {}
+      this.onSearchPaymentChannelGrossProfit()
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+        
+.table__wrapper{
+  display: flex;
+  width: 100%;
+  overflow:hidden;
+  gap: 60px;
+}
+
+.sort {
+  .my-breadcrumb {
+    .my-breadcrumb-item {
+      float: left;
+      span {
+        height: 32px;
+        line-height: 32px;
+      }
+      .label {
+        padding: 0 5px 0 0;
+        color: 010101;
+      }
+      .separator {
+        color: #787878;
+        font-size: 13px;
+        padding: 0 5px 0 0;
+      }
+      &:last-child {
+        .label {
+          color: #787878;
+        }
+      }
+      &:hover {
+        cursor: pointer;
+      }
+      &:last-child {
+        cursor: default;
+      }
+      &:only-child {
+        cursor: pointer;
+      }
+    }
+  }
+}
+</style>

+ 0 - 0
src/views/serviceParam/paymentChannelGrossProfit/业务公司商品分类毛利


+ 30 - 19
src/views/serviceParam/paymentChannelManage/addEditRate.vue

@@ -26,21 +26,22 @@
             class="demo-ruleForm"
             :disabled="isDetail"
           >
-            <el-form-item label="支付渠道名称" prop="支付渠道名称属性">
+            <el-form-item label="支付渠道名称" prop="channel_name">
               <el-input
-                v-model="ruleForm['支付渠道名称属性']"
+                v-model="ruleForm['channel_name']"
                 :disabled="this.actionType === actionTypes.PREVIEW"
                 placeholder="名称"
                 maxlength="20"
               />
             </el-form-item>
 
-            <el-form-item label="业务公司" prop="业务公司属性">
-              <el-input
-                v-model="ruleForm['业务公司属性']"
+            <el-form-item label="业务公司" prop="companyNo">
+              <search-work-company
+                :value="ruleForm.companyNo"
                 :disabled="this.actionType === actionTypes.PREVIEW"
-                placeholder="业务公司"
-                maxlength="20"
+                :placeholder="'业务公司'"
+                size="large"
+                @searchChange="companyNosearchChange"
               />
             </el-form-item>
           </el-form>
@@ -71,7 +72,7 @@ import { actionTypes } from '@/utils/actionType'
 export default {
   name: 'Sort',
   mixins: [resToken, companyHelper],
-  props: ['showModel', 'id', 'sitem', 'titleList', 'isDetail', 'platform_id'],
+  props: ['showModel', 'id', 'sitem', 'actionType'],
   data() {
     return {
       actionTypes,
@@ -79,13 +80,13 @@ export default {
       showModelThis: this.showModel,
       pid_name: '',
       ruleForm: {
-        业务公司属性: '',
-        支付渠道名称属性: ''
+        companyNo: '',
+        channel_name: ''
       },
       rulesThis: this.rules,
       rules: {
-        业务公司属性: [{ required: true, trigger: 'blur' }],
-        支付渠道名称属性: [{ required: true, trigger: 'blur' }]
+        companyNo: [{ required: true, trigger: 'blur', message: '请选择业务公司' }],
+        channel_name: [{ required: true, trigger: 'blur', message: '支付渠道名称' }]
       }
     }
   },
@@ -125,13 +126,17 @@ export default {
           this.$refs.ruleForm.clearValidate()
 
           const {
-            业务公司属性,
-            支付渠道名称属性
+            id,
+            companyNo,
+            channel_name
           } = this.sitem
 
+          console.log(this.sitem)
+
           this.ruleForm = {
-            业务公司属性: 业务公司属性 || '',
-            支付渠道名称属性: 支付渠道名称属性 || ''
+            id,
+            companyNo: companyNo || '',
+            channel_name: channel_name || ''
           }
         }
       })
@@ -141,14 +146,20 @@ export default {
       this.ruleForm[key] = e + ''
       this.$refs.ruleForm.validateField(key)
     },
+
+    async companyNosearchChange(e) {
+      const { id, code, label } = e
+      this.ruleForm['companyNo'] = code || ''
+      this.$refs.ruleForm.validateField('companyNo')
+    },
     async submitForm() {
-      if (!this.isHasCurrentCompany()) return
+      // if (!this.isHasCurrentCompany()) return
       await this.$refs.ruleForm.validate(async(valid) => {
         if (valid) {
           if (!this.loading) {
             const model = JSON.parse(JSON.stringify(this.ruleForm))
-            const api = this.actionType === this.actionTypes.CREATE ? asyncRequest.create : as
-            const res = await asyncRequest.update(model)
+            const api = this.actionType === this.actionTypes.CREATE ? asyncRequest.create : asyncRequest.update
+            const res = await api(model)
             this.loading = false
             if (res && res.code === 0) {
               this.showModelThis = false

+ 35 - 16
src/views/serviceParam/paymentChannelManage/index.vue

@@ -73,7 +73,7 @@
               </el-select>
             </el-col>
             <el-col :span="4" style="width: 390px;margin-left:10px">
-              <el-input placeholder="支付渠道名称" size="mini" v-model="parmValue['支付渠道名称参数']" @blur="
+              <el-input placeholder="支付渠道名称" clearable size="mini" v-model="parmValue['channel_name']" @blur="
                   pageInfo.curr = 1;
                   parmValue.page = 1;
                   searchList();
@@ -82,8 +82,9 @@
             <el-col :span="4" style="width: 390px; padding: 0 0 0 10px">
               <el-input
                 :size="searchSize"
-                v-model="parmValue['创建人参数']"
+                v-model="parmValue['apply_name']"
                 :maxlength="40"
+                clearable
                 @blur="
                   pageInfo.curr = 1;
                   parmValue.page = 1;
@@ -132,6 +133,18 @@
           <i class="el-icon-edit tb-icon" @click="setRate(scope.row,actionTypes.UPDATE)"></i>
         </el-tooltip>
 
+        <el-tooltip
+          v-if="powers.some((i) => i == '004') && scope.row.status + '' === '0'"
+          effect="dark"
+          content="启用"
+          placement="top"
+        >
+          <i
+            class="el-icon-video-play tb-icon"
+            @click="changeStatus(scope.row.id, scope.row.status)"
+          ></i>
+        </el-tooltip>
+
        <el-tooltip
           v-if="powers.some((i) => i == '004') && scope.row.status + '' === '1'"
           effect="dark"
@@ -140,7 +153,7 @@
         >
           <i
             class="el-icon-video-pause tb-icon"
-            @click="changeStatus(scope.row.cat_id, scope.row.status)"
+            @click="changeStatus(scope.row.id, scope.row.status)"
           ></i>
         </el-tooltip>
       </template>
@@ -155,7 +168,7 @@
       :sitem="sitemRate"
       @refresh="searchList"
       @cancel="showRateModel = false"
-      :actionsType="actionsType"
+      :actionType="actionType"
     />
   </div>
 </template>
@@ -182,15 +195,16 @@ export default {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       const { btnList } = this.$store.getters;
-      const tran = btnList.find((i) => i.menu_route == "platformGrossProfit") || {};
+      const tran = btnList.find((i) => i.menu_route == "paymentChannelManage") || {};
       const { action } = tran ?? {};
+      console.log(action)
       return action ?? [];
     },
   },
   data() {
     return {
       actionTypes,
-      actionsType:'',
+      actionType:'',
       isDetail: true,
       private_field: [],
       statusList: statusList,
@@ -205,8 +219,8 @@ export default {
         page: 1, // 页码
         size: 15, // 每页显示条数
         status:"",
-        支付渠道名称参数:"",
-        创建人参数:""
+        channel_name:"",
+        apply_name:""
       },
       // 状态
       statusOptions: [
@@ -235,10 +249,15 @@ export default {
           minWidth: "60px",
         },
         {
-          prop: "支付渠道名称参数",
+          prop: "channel_name",
           label: "支付渠道名称",
           width: "230px",
         },
+        {
+          prop: "companyName",
+          label: "业务公司名称",
+          width: "230px",
+        },
         {
           prop: "status",
           label: "当前状态",
@@ -246,7 +265,7 @@ export default {
           _slot_:'status'
         },
         {
-          prop: "创建人参数",
+          prop: "apply_name",
           label: "创建人",
           width: "230px",
         },
@@ -282,8 +301,8 @@ export default {
         page: 1, // 页码
         size: 15, // 每页显示条数
         status: "",
-        支付渠道名称参数:"",
-        创建人参数:""
+        channel_name:"",
+        apply_name:""
       };
       this.searchList();
     },
@@ -352,10 +371,10 @@ export default {
     async searchList() {
       if (this.loading) return;
 
-      if (!this.currentCompany) {
-        this.$message.warning("请选择公司!");
-        return;
-      }
+      // if (!this.currentCompany) {
+      //   this.$message.warning("请选择公司!");
+      //   return;
+      // }
 
       this.parmValue.companyNo = this.currentCompany;
       this.loading = true;

+ 112 - 147
src/views/serviceParam/terrace/addEdit.vue

@@ -26,7 +26,7 @@
             class="demo-ruleForm"
           >
             <el-row>
-              <el-col :span="16">
+              <el-col :span="24">
                 <el-form-item label="平台名称" prop="platform_name">
                   <el-input
                     v-model="ruleForm.platform_name"
@@ -72,16 +72,16 @@
                 v-show="ruleForm.use_type === '1' && ruleForm.platform_type === '0'"
                 :span="8"
               >
-                <el-form-item label="开启渠道" prop="is_pay">
+                <el-form-item label="是否开启支付渠道" prop="is_select_pay_rate" label-width="140px">
                   <el-select
-                    v-model="ruleForm.is_pay"
+                    v-model="ruleForm.is_select_pay_rate"
                     style="width: 100%"
                     :disabled="id == '007' || isUpdate"
                     placeholder="是否开启"
                     @change="set_required"
                   >
                     <el-option
-                      v-for="item in is_pay_options"
+                      v-for="item in is_select_pay_rate_options"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value"
@@ -91,84 +91,37 @@
                 v-show="
                   ruleForm.use_type === '1' &&
                     ruleForm.platform_type === '0' &&
-                    ruleForm.is_pay === '1'
-                "
-                :span="8"
-              >
-                <el-form-item label="渠道名称" prop="pay_name">
-                  <el-input
-                    v-model="ruleForm.pay_name"
-                    :disabled="id == '007'"
-                    placeholder="渠道名称"
-                    maxlength="20"
-                  /></el-form-item></el-col>
-              <el-col
-                v-show="
-                  ruleForm.use_type === '1' &&
-                    ruleForm.platform_type === '0' &&
-                    ruleForm.is_pay === '1'
+                    ruleForm.is_select_pay_rate === '1'
                 "
                 :span="24"
               >
-                <el-form-item label="内容配置" prop="pay_rate">
-                  <el-table size="mini" border :data="ruleForm.pay_rate">
-                    <el-table-column label="业务公司">
-                      <template #default="scope">
-                        <search-work-company
-                          v-if="scope.row.isEdit"
-                          :value="scope.row.companyNo"
-                          :names="''"
-                          :size="'mini'"
-                          :is-detail="id !== 'add'"
-                          :disabled="isUpdate"
-                          :placeholder="'业务公司'"
-                          @searchChange="handleCompanyChange($event, scope.$index)"
-                        />
-
-                        <span v-else>{{ ruleForm.pay_rate[0].companyName }}</span>
-                      </template>
-                    </el-table-column>
-
-                    <el-table-column label="收费点数">
-                      <template #default="scope">
-                        <digital-input
-                          v-if="scope.row.isEdit"
-                          ref="digitalInput"
-                          size="mini"
-                          :values="scope.row.rate"
-                          :placeholder="'收费点数'"
-                          :min="0"
-                          :max="100"
-                          :position="'right'"
-                          :precision="2"
-                          :controls="false"
-                          :append="'%'"
-                          @reschange="handleRateChange($event, scope.$index)"
-                        />
-
-                        <span
-                          v-else
-                        >{{ Number(ruleForm.pay_rate[0].rate).toFixed(2) }}%</span>
-                      </template>
-                    </el-table-column>
-
-                    <el-table-column
-                      v-if="id === '003' || id === '005'"
-                      width="60px"
-                      label="操作"
-                    >
-                      <template #default="scope">
+                <el-form-item label="支付渠道" prop="支付渠道属性">
+                  <el-table size="mini" border :data="ruleForm.pay_list">
+                    <el-table-column label="渠道名称" prop="channel_name" />
+                    <el-table-column label="业务公司" prop="companyName" />
+                    <el-table-column v-if="id === '005'" label="操作" width="80px">
+                      <template slot="header">
+                        <span>操作</span>
                         <el-tooltip
+                          style="margin: 3px 0 0 0"
                           effect="dark"
-                          :content="scope.row.isEdit ? '完成' : '修改'"
+                          class="fr"
+                          content="添加"
                           placement="top"
                         >
                           <i
-                            :class="[
-                              scope.row.isEdit ? 'el-icon-circle-check' : 'el-icon-edit',
-                              'tb-icon',
-                            ]"
-                            @click="handleEdit(scope.$index)"
+                            class="el-icon-circle-plus-outline tb-icon"
+                            style="color: #6954f0; magin: 0 0 0 10px"
+                            @click="visible = true"
+                          />
+                        </el-tooltip>
+                      </template>
+
+                      <template slot-scope="scope">
+                        <el-tooltip effect="dark" class="fr" content="删除" placement="top">
+                          <i
+                            class="el-icon-delete tb-icon"
+                            @click="ruleForm.pay_list.splice(scope.$index,1)"
                           />
                         </el-tooltip>
                       </template>
@@ -184,6 +137,7 @@
             v-if="id !== '007'"
             size="mini"
             type="primary"
+            :loading="loading"
             @click="submitForm"
           >保 存
           </el-button>
@@ -193,18 +147,24 @@
         </el-col>
       </el-row>
     </el-card>
+
+    <search-company-modal :visible.sync="visible" @updatePaymentChannel="onUpdatePaymentChannel" />
   </el-dialog>
 </template>
 <script>
 import asyncRequest from '@/apis/service/serviceParam/terrace'
 import resToken from '@/mixins/resToken'
+import SearchCompanyModal from './searchCompanyModal.vue'
 export default {
   name: 'Terrace',
+  components: { SearchCompanyModal },
   mixins: [resToken],
   props: ['showModel', 'id', 'sitem'],
   data() {
     return {
       loading: false,
+      visible: false,
+      sourcePaymentChannel: [],
       title: '添加平台',
       showModelThis: this.showModel,
       rateBefore: {
@@ -225,7 +185,7 @@ export default {
         { value: '0', label: '无对接' }, //
         { value: '1', label: '有赞平台' }
       ],
-      is_pay_options: [
+      is_select_pay_rate_options: [
         { value: '0', label: '不选支付渠道' }, //
         { value: '1', label: '选择支付渠道' }
       ],
@@ -239,25 +199,17 @@ export default {
         platform_type: '0',
         use_type: '1',
         pay_name: '',
-        is_pay: '0',
-        pay_rate: [
-          {
-            companyNo: '',
-            companyName: '',
-            rate: '',
-            isEdit: true
-          }
-        ]
+        is_select_pay_rate: '0',
+        pay_list: []
       },
       rules: {
         platform_name: [{ required: true, message: '平台名称不能为空', trigger: 'blur' }],
         platform_type: [{ required: true, message: '请选择对接平台', trigger: 'change' }],
         use_type: [{ required: true, message: '请选择平台类型', trigger: 'change' }],
-        is_pay: [
+        is_select_pay_rate: [
           { required: true, message: '请选择是否开启支付渠道', trigger: 'change' }
         ],
-        pay_name: [{ required: true, message: '渠道名称不能为空', trigger: 'blur' }],
-        pay_rate: [
+        pay_list: [
           {
             type: 'array',
             required: true,
@@ -283,6 +235,16 @@ export default {
     },
     showModelThis(val) {
       if (!val) {
+        this.ruleForm = {
+          id: '',
+          platform_name: '',
+          platform_type: '0',
+          use_type: '1',
+          pay_name: '',
+          is_select_pay_rate: '0',
+          pay_list: []
+        }
+        this.sourcePaymentChannel = []
         this.$emit('cancel')
       }
     }
@@ -316,83 +278,94 @@ export default {
       if (isAllowLoadDetail) await this.loadDetail()
       this.set_required()
     },
+    uniquePaymentChannel(values) {
+      const map = new Map()
+      const pay_list = values.map(value => {
+        const channel_id = value.id
+        delete value['id']
+        return ({ ...value, channel_id })
+      })
+
+      return ([...this.ruleForm.pay_list, ...pay_list]).filter((item) => !map.has(item.channel_id) && map.set(item.channel_id, 1))
+    },
+    onUpdatePaymentChannel(values) {
+      this.ruleForm.pay_list = this.uniquePaymentChannel(values)
+      console.log(this.ruleForm)
+    },
     async loadDetail() {
       this.loading = true
       const platformResponse = await asyncRequest.detail({ id: this.sitem.id })
-      const { platform_name, platform_type, is_select_pay_rate, use_type, pay_list, pay_title } = platformResponse.data
-      // if (Array.isArray(pay_list) && pay_list.length > 0) {
-      // const { companyNoc } = pay_list[pay_list.length - 1]
-      // console.log(pay_list[pay_list.length - 1])
-
-      // const companyResponse = await asyncRequest.company({ companyNo })
-      // const company = companyResponse.data.list.find(({ companyNo: _companyNo }) => _companyNo === companyNo)
-      // pay_list[0].companyName = company ? company.company : ''
-      // }
-
-      let pay_rate = [{ companyNo: '', rate: '', isEdit: true }]
-      if (pay_list.length > 0) {
-        pay_rate = pay_list.filter(({ companyNo }) => companyNo !== 'KH' && companyNo !== 'GYS')
-      }
+      const { platform_name, platform_type, is_select_pay_rate, use_type, pay_list } = platformResponse.data
 
       this.loading = false
       this.ruleForm = {
-        pay_name: pay_title || '',
         platform_name: platform_name || '',
         platform_type: String(platform_type) ? String(platform_type) : '0',
         use_type: String(use_type) ? String(use_type) : '1',
-        is_pay: String(is_select_pay_rate) ? String(is_select_pay_rate) : '',
-        pay_rate
+        is_select_pay_rate: String(is_select_pay_rate) ? String(is_select_pay_rate) : '',
+        pay_list
       }
-    },
-    handleEdit(index) {
-      const lineData = this.ruleForm.pay_rate[index]
-      if (lineData.isEdit) {
-        const { companyNo, rate } = lineData
-        if (!companyNo) return this.$message.warning('业务公司不能为空')
-        if (!rate) return this.$message.warning('收费点数不能为空')
-      }
-
-      this.$set(this.ruleForm.pay_rate, index, {
-        ...this.ruleForm.pay_rate[index],
-        ...{ isEdit: !lineData.isEdit }
-      })
 
-      this.$nextTick(() => {
-        // 手动更新
-        this.$refs.digitalInput && this.$refs.digitalInput.manualUpdate(lineData.rate)
-      })
+      this.sourcePaymentChannel = JSON.parse(JSON.stringify(pay_list || '[]'))
     },
     async submitForm() {
-      const { pay_rate, is_pay } = this.ruleForm
-      const isPayRateSave = pay_rate.every(({ isEdit }) => !isEdit)
-      if (!isPayRateSave && is_pay === '1') return this.$message.warning('未完成内容配置编辑')
+      const { pay_list, is_select_pay_rate } = this.ruleForm
+      const isPayRateSave = pay_list.every(({ isEdit }) => !isEdit)
+      if (!isPayRateSave && is_select_pay_rate === '1') return this.$message.warning('未完成内容配置编辑')
 
       await this.$refs.ruleForm.validate(async(valid) => {
         if (valid) {
           if (this.loading) { return }
           this.loading = true
-          const { pay_rate, pay_name, platform_type, platform_name, is_pay, use_type } = this.ruleForm
+          const { pay_list, platform_type, platform_name, is_select_pay_rate, use_type } = this.ruleForm
 
           const model = {
             id: this.sitem.id,
-            pay_list: pay_rate, // 渠道配置集合
-            pay_title: pay_name, // 渠道名称
-            is_select_pay_rate: is_pay, // 是否开启渠道
+            pay_list: pay_list, // 渠道配置集合
+            is_select_pay_rate, // 是否开启渠道
             platform_type, //  对接类型 0 无 1 toB 2 ToC
             platform_name, // 平台名称
             use_type // 平台性质,0内部使用,1对接有赞平台
           }
 
-          model.is_select_pay_rate = use_type === '1' && platform_type === '0' ? is_pay : '0'
-
+          model.is_select_pay_rate = use_type === '1' && platform_type === '0' ? is_select_pay_rate : '0'
+          this.loading = false
           if (model.use_type !== '1' || model.platform_type !== '0' || model.is_select_pay_rate !== '1') {
             delete model['pay_list']
           }
 
-          if (model.pay_list && model.pay_list.length > 0) {
-            delete model.pay_list[0].isEdit
-            delete model.pay_list[0].is_cgd
-            delete model.pay_list[0].is_qrd
+          if (this.id !== '003' && model.pay_list) {
+            const currentPaymentChannelIDSet = model.pay_list.map(({ channel_id }) => channel_id)
+            // 删除的渠道
+            const delChannel = this.sourcePaymentChannel
+              .filter(({ channel_id }) => !currentPaymentChannelIDSet.includes(String(channel_id)))
+              .map(({ channel_id, id }) => ({
+                channel_id,
+                id,
+                is_del: 1
+              }))
+
+            // 原始的渠道
+            const originChannel = this.sourcePaymentChannel
+              .filter(({ channel_id }) => currentPaymentChannelIDSet.includes(String(channel_id)))
+              .map(({ channel_id, id }) => ({
+                channel_id,
+                id,
+                is_del: 0
+              }))
+
+            // 添加的渠道
+            const addChannel = this.ruleForm.pay_list
+              .filter(({ channel_id: _channel_id }) =>
+                !originChannel.find(({ channel_id }) => String(channel_id) === String(_channel_id)) &&
+                !delChannel.find(({ channel_id }) => String(channel_id) === String(_channel_id)))
+              .map(({ channel_id }) => ({
+                channel_id: Number(channel_id),
+                is_del: 0,
+                id: null
+              }))
+
+            model.pay_list = [...delChannel, ...originChannel, ...addChannel]
           }
 
           let res = {}
@@ -424,11 +397,9 @@ export default {
       })
     },
     set_required() {
-      const { platform_type, use_type, is_pay } = this.ruleForm
-      if (Object.keys(this.rulesThis).length === 0) return
-      this.rulesThis.is_pay[0].required = use_type === '1' && platform_type === '0'
-      this.rulesThis.pay_name[0].required = use_type === '1' && platform_type === '0' && is_pay === '1'
-      this.rulesThis.pay_rate[0].required = use_type === '1' && platform_type === '0' && is_pay === '1'
+      const { platform_type, use_type, is_select_pay_rate } = this.ruleForm
+      this.rulesThis.is_select_pay_rate[0].required = use_type === '1' && platform_type === '0'
+      this.rulesThis.pay_list[0].required = use_type === '1' && platform_type === '0' && is_select_pay_rate === '1'
     },
     handleCompanyChange(e, index) {
       const { code, label } = e
@@ -438,16 +409,10 @@ export default {
         companyName: label
       }
 
-      this.$set(this.ruleForm.pay_rate, index, {
-        ...this.ruleForm.pay_rate[index],
+      this.$set(this.ruleForm.pay_list, index, {
+        ...this.ruleForm.pay_list[index],
         ...companyInfo
       })
-    },
-    handleRateChange(rate, index) {
-      this.$set(this.ruleForm.pay_rate, index, {
-        ...this.ruleForm.pay_rate[index],
-        ...{ rate }
-      })
     }
   }
 }

+ 124 - 0
src/views/serviceParam/terrace/searchCompanyModal.vue

@@ -0,0 +1,124 @@
+<template>
+  <el-dialog :visible.sync="innerVisible" append-to-body title="业务渠道" width="1024px" center>
+    <ex-table
+      v-loading="loading"
+      :table="table"
+      :data="tableData"
+      :columns="columns"
+      :page="pageInfo"
+      :size="size"
+      @selection="({list}) => selectedRows = list"
+      @page-curr-change="handlePageChange"
+      @page-size-change="handleSizeChange"
+      @screen-reset="
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
+      @screen-submit="
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
+    />
+
+    <div class="fr">
+      <el-button size="mini" type="primary" @click="onSave">保存</el-button>
+    </div>
+
+    <div style="clear:both;" />
+  </el-dialog>
+</template>
+
+<script>
+import asyncRequest from '@/apis/service/serviceParam/terrace'
+export default {
+  props: ['visible'],
+  data() {
+    return {
+      loading: false,
+      selectedRows: [],
+      tableData: [],
+      table: {
+        stripe: true,
+        border: true
+      },
+      columns: [
+        {
+          type: 'selection'
+        },
+        {
+          prop: 'channel_name',
+          label: '渠道名称'
+        },
+        {
+          prop: 'companyName',
+          label: '业务公司名称'
+        }
+      ],
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0
+      },
+      parmValue: {
+
+      }
+    }
+  },
+  computed: {
+    innerVisible: {
+      get() {
+        return this.visible
+      },
+      set(newValue) {
+        this.$emit('update:visible', newValue)
+      }
+    }
+  },
+  watch: {
+    visible() {
+      if (this.visible) {
+        this.searchList()
+      } else {
+        this.tableData = []
+      }
+    }
+  },
+  methods: {
+    onSave() {
+      this.$emit('updatePaymentChannel', this.selectedRows)
+      this.innerVisible = false
+    },
+    async searchList() {
+      if (
+        (this.parmValue.start !== '' && this.parmValue.end === '') ||
+        (this.parmValue.start == '' && this.parmValue.end != '')
+      ) {
+        this.$message.warning('开始时间和结束时间不能为空')
+        return
+      }
+      this.loading = true
+      const res = await asyncRequest.paymentChannelist(this.parmValue)
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list
+        this.pageInfo.total = Number(res.data.count)
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout()
+      } else {
+        this.tableData = []
+        this.pageInfo.total = 0
+      }
+      this.loading = false
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+/deep/ .Pagination{
+  .el-pagination{
+    float: left;
+  }
+}
+</style>

+ 108 - 93
src/views/youzan/luckyDrawGood/webUrlList.vue

@@ -1,71 +1,86 @@
 <template>
   <el-dialog
+    v-loading="loading"
     :title="'兑换链接列表'"
     :center="true"
     align="left"
     top="8vh"
     width="1040px"
-    @close="showModelThis = false"
     :close-on-click-modal="false"
     :visible.sync="showModelThis"
-    v-loading="loading"
     element-loading-text="拼命加载中"
     element-loading-spinner="el-icon-loading"
     element-loading-background="rgba(0, 0, 0, 0.8)"
     append-to-body
+    @close="showModelThis = false"
   >
     <el-card style="margin-top: -20px">
       <ex-table :columns="webUrlcolumns" :table="table" :data="tableData">
         <template #table-header="{ selection }">
           <div style="width: 100%">
-            <el-row style="padding: 0" v-if="sitem && sitem.id">
-              <el-col :span="7" style="padding: 3px 0"
-                ><span style="display: inline-block; width: 100px" class="tr"
-                  >商品上线编号:</span
-                >{{ sitem.yz_good_code }}</el-col
-              >
-              <el-col :span="5" style="padding: 3px 0"
-                ><span style="display: inline-block; width: 100px" class="tr"
-                  >平台商品编号:</span
-                >{{ sitem.plat_code }}</el-col
-              >
-              <el-col :span="12" style="padding: 3px 0"
-                ><span style="display: inline-block; width: 100px" class="tr"
-                  >商品名称:</span
-                >{{ sitem.good_name }}</el-col
-              >
-              <el-col :span="7" style="padding: 3px 0"
-                ><span style="display: inline-block; width: 100px" class="tr"
-                  >负责人:</span
-                >{{ sitem.contactor }}</el-col
-              >
-              <el-col :span="5" style="padding: 3px 0"
-                ><span style="display: inline-block; width: 100px" class="tr"
-                  >负责人电话:</span
-                >{{ sitem.mobile }}</el-col
-              >
-              <el-col :span="12" style="padding: 3px 0"
-                ><span style="display: inline-block; width: 100px" class="tr"
-                  >公司名称:</span
-                >{{ sitem.company_name }}</el-col
-              >
-              <el-col :span="7" style="padding: 3px 0"
-                ><span style="width: 100px; display: inline-block" class="tr"
-                  >活动编码:</span
-                >{{ sitem.actCode }}</el-col
-              >
-              <el-col :span="16" style="padding: 3px 0"
-                ><span style="display: inline-block; width: 100px" class="tr"
-                  >活动名称:</span
-                >{{ sitem.act_name }}</el-col
-              >
+            <el-row v-if="sitem && sitem.id" style="padding: 0">
+              <el-col
+                :span="7"
+                style="padding: 3px 0"
+              ><span
+                style="display: inline-block; width: 100px"
+                class="tr"
+              >商品上线编号:</span>{{ sitem.yz_good_code }}</el-col>
+              <el-col
+                :span="5"
+                style="padding: 3px 0"
+              ><span
+                style="display: inline-block; width: 100px"
+                class="tr"
+              >平台商品编号:</span>{{ sitem.plat_code }}</el-col>
+              <el-col
+                :span="12"
+                style="padding: 3px 0"
+              ><span
+                style="display: inline-block; width: 100px"
+                class="tr"
+              >商品名称:</span>{{ sitem.good_name }}</el-col>
+              <el-col
+                :span="7"
+                style="padding: 3px 0"
+              ><span
+                style="display: inline-block; width: 100px"
+                class="tr"
+              >负责人:</span>{{ sitem.contactor }}</el-col>
+              <el-col
+                :span="5"
+                style="padding: 3px 0"
+              ><span
+                style="display: inline-block; width: 100px"
+                class="tr"
+              >负责人电话:</span>{{ sitem.mobile }}</el-col>
+              <el-col
+                :span="12"
+                style="padding: 3px 0"
+              ><span
+                style="display: inline-block; width: 100px"
+                class="tr"
+              >公司名称:</span>{{ sitem.company_name }}</el-col>
+              <el-col
+                :span="7"
+                style="padding: 3px 0"
+              ><span
+                style="width: 100px; display: inline-block"
+                class="tr"
+              >活动编码:</span>{{ sitem.actCode }}</el-col>
+              <el-col
+                :span="16"
+                style="padding: 3px 0"
+              ><span
+                style="display: inline-block; width: 100px"
+                class="tr"
+              >活动名称:</span>{{ sitem.act_name }}</el-col>
               <el-col :span="1" style="padding: 3px 0">
                 <el-tooltip effect="dark" class="fr" content="删除" placement="top">
                   <i
                     class="el-icon-delete tb-icon"
                     @click="deleteItem(selection)"
-                  ></i> </el-tooltip
-              ></el-col>
+                  /> </el-tooltip></el-col>
             </el-row>
           </div>
         </template>
@@ -75,24 +90,24 @@
 </template>
 
 <script>
-import asyncRequest from "@/apis/service/youzan/luckDrawGood";
-import resToken from "@/mixins/resToken";
-import { tHeader, filterVal, webUrlcolumns } from "./columns";
+import asyncRequest from '@/apis/service/youzan/luckDrawGood'
+import resToken from '@/mixins/resToken'
+import { tHeader, filterVal, webUrlcolumns } from './columns'
 export default {
+  name: 'WeburlList',
   mixins: [resToken],
-  name: "weburlList",
-  props: ["showModel", "sitem"],
+  props: ['showModel', 'sitem'],
   data() {
     return {
       showModelThis: this.showModel,
-      code_msg: "物流单号必传,且支持纯数字或字母数字组合(9~20位)!",
+      code_msg: '物流单号必传,且支持纯数字或字母数字组合(9~20位)!',
       tHeader,
       filterVal,
       // 表格 - 参数
       table: {
         stripe: true,
         border: true,
-        "max-height": "800px",
+        'max-height': '800px'
         // _defaultHeader_: ["setcol"],
       },
       tableData: [],
@@ -100,78 +115,78 @@ export default {
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       loading: false,
       // 表格 - 列参数
-      webUrlcolumns,
-    };
+      webUrlcolumns
+    }
   },
   watch: {
-    showModel: function (val) {
-      this.showModelThis = val;
+    showModel: function(val) {
+      this.showModelThis = val
       if (val) {
-        this.searchList();
+        this.searchList()
       }
     },
     showModelThis(val) {
       if (!val) {
-        this.$emit("cancel");
+        this.$emit('cancel')
       }
-    },
+    }
   },
   methods: {
     // 刷新表格
     async searchList() {
-      if (this.loading) return;
-      this.loading = true;
-      const { id } = this.sitem;
-      console.log(this.sitem);
+      if (this.loading) return
+      this.loading = true
+      const { id } = this.sitem
+      console.log(this.sitem)
       const { code, data, message } = await asyncRequest.goodUrlList({
-        act_good_id: id,
-      });
+        act_good_id: id
+      })
       if (code === 0) {
-        const { list, count } = data;
-        this.tableData = list;
-        this.pageInfo.total = Number(count);
+        const { list, count } = data
+        this.tableData = list
+        this.pageInfo.total = Number(count)
       } else if (code >= 100 && code <= 104) {
-        await this.logout();
+        await this.logout()
       } else {
-        this.tableData = [];
-        this.pageInfo.total = 0;
+        this.tableData = []
+        this.pageInfo.total = 0
       }
-      this.loading = false;
+      this.loading = false
     },
     async deleteItem(list) {
-      console.log(list);
-      await this.$confirm("确定要删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      console.log(list)
+      await this.$confirm('确定要删除?', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
-        .then(async () => {
-          let web_url_ids = [];
+        .then(async() => {
+          const web_url_ids = []
           list.forEach((a) => {
-            web_url_ids.push(a.id);
-          });
-          console.log(web_url_ids);
-          const { code, data, message } = await asyncRequest.delete({ web_url_ids });
+            web_url_ids.push(a.id)
+          })
+          console.log(web_url_ids)
+          const { code, data, message } = await asyncRequest.delete({ web_url_ids })
           if (code === 0) {
             this.$notify.success({
-              title: "删除成功",
-              message: "",
-            });
+              title: '删除成功',
+              message: ''
+            })
             // await this.searchList();
           } else {
-            this.$message.warning(message);
+            this.$message.warning(message)
           }
         })
         .catch(() => {
-          console.log("取消");
-        });
-    },
-  },
-};
+          console.log('取消')
+        })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>

Some files were not shown because too many files changed in this diff