xgb 1 неделя назад
Родитель
Сommit
2030f25ab5
2 измененных файлов с 74 добавлено и 1 удалено
  1. 8 0
      src/api/his/company.js
  2. 66 1
      src/views/his/company/index.vue

+ 8 - 0
src/api/his/company.js

@@ -111,3 +111,11 @@ export function exitMiniProgram(data) {
     data: data
   })
 }
+
+export function changeMerchant(data) {
+  return request({
+    url: '/his/company/changeMerchant',
+    method: 'post',
+    data: data
+  })
+}

+ 66 - 1
src/views/his/company/index.vue

@@ -147,6 +147,7 @@
           <el-tag v-if="scope.row.isOpenRestReminder==0" type="success">关闭</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="红包商户号" align="center" prop="redPacketMerchant"/>
       <el-table-column label="备注" align="center" prop="remark"/>
       <el-table-column label="开始时间" align="center" prop="startTime" width="180"/>
       <el-table-column label="到期时间" align="center" prop="limitTime" width="180"/>
@@ -219,6 +220,13 @@
             @click="handleRevenue(scope.row)"
             v-hasPermi="['company:company:revenue']"
           >分账配置</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="changeMerchant(scope.row)"
+            v-hasPermi="['company:company:changeMerchant']"
+          >红包商户配置</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -726,6 +734,29 @@
       </div>
     </el-dialog>
 
+    <!-- 商户配置对话框 -->
+    <el-dialog :title="merchantDialog.title" :visible.sync="merchantDialog.open" width="500px" append-to-body class="simple-dialog">
+      <el-form ref="merchantForm" :model="merchantForm" label-width="100px">
+        <el-form-item label="公司">
+          <el-input v-model="merchantForm.companyName" disabled/>
+        </el-form-item>
+        <el-form-item label="选择商户" prop="mchId">
+          <el-select v-model="merchantForm.redPacketMerchant" placeholder="请选择商户" clearable size="small" style="width: 100%">
+            <el-option
+              v-for="dict in merchantOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitMerchantForm">确 定</el-button>
+        <el-button @click="merchantDialog.open=false">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -744,6 +775,7 @@ import {
   resetPwd,
   getDivConfig,
   setDiv,
+  changeMerchant,
   exitMiniProgram
 } from '@/api/his/company'
 import { getFollowDoctorList } from '@/api/his/doctor'
@@ -769,6 +801,7 @@ export default {
       revenueForm: {
         acctInfos: []
       },
+      merchantOptions:[],
       deductForm: { money: 0 },
       redDeductForm: { money: 0 },
       doctorIds: [],
@@ -814,6 +847,15 @@ export default {
         miniAppList: [],
         isOpenStoredPay: null
       },
+      merchantDialog: {
+        open: false,
+        title: '红包商户配置'
+      },
+      merchantForm: {
+        companyId: null,
+        companyName: null,
+        redPacketMerchant: null
+      },
       rules: {
         companyName: [{ required: true, message: '公司名称不能为空', trigger: 'blur' }],
         companyType: [{ required: true, message: '公司类型不能为空', trigger: 'blur' }],
@@ -849,6 +891,7 @@ export default {
     this.getList()
     this.getDicts('sys_company_status').then(response => { this.statusOptions = response.data })
     this.getDicts('sys_company_type').then(response => { this.companyTypeOptions = response.data })
+    this.getDicts('company_red_packet_merchant').then(response => { this.merchantOptions = response.data })
     getVoiceApiList().then(response => { this.voiceApis = response.data })
     getFollowDoctorList().then(response => { this.followDoctorList = response.rows })
     cateList().then(response => { this.cateList = response.rows })
@@ -1023,7 +1066,29 @@ export default {
     padNumFormatter(row) { return row.maxPadNum === -1 ? '不限' : row.maxPadNum },
     handleMiniProgram() { this.getAppList(null); this.miniProgram.open = true; this.form = { ...this.form, courseMiniAppId: null, miniAppMaster: null, miniAppServer: null } },
     cancelMiniProgram() { this.miniProgram.open = false; this.reset() },
-    submitMiniProgramForm() { this.form.ids = this.ids; exitMiniProgram(this.form).then(response => { if (response.code === 200) { this.miniProgram.open = false; this.msgSuccess('修改小程序成功'); this.getList() } }) }
+    submitMiniProgramForm() { this.form.ids = this.ids; exitMiniProgram(this.form).then(response => { if (response.code === 200) { this.miniProgram.open = false; this.msgSuccess('修改小程序成功'); this.getList() } }) },
+    changeMerchant(row) {
+      this.merchantForm.companyId = row.companyId
+      this.merchantForm.companyName = row.companyName
+      this.merchantForm.redPacketMerchant = row.redPacketMerchant || this.merchantOptions[0].dictValue || null
+      this.merchantDialog.open = true
+    },
+    submitMerchantForm() {
+      if (!this.merchantForm.redPacketMerchant) {
+        return
+      }
+      const params = {
+        companyId: this.merchantForm.companyId,
+        redPacketMerchant: this.merchantForm.redPacketMerchant
+      }
+      changeMerchant(params).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess(response.msg || '商户配置成功')
+          this.merchantDialog.open = false
+          this.getList()
+        }
+      })
+    }
   }
 }
 </script>