소스 검색

商户功能开发

user5 1 년 전
부모
커밋
760ca1a0fd

+ 57 - 0
src/api/wdt/merchantCompany/MerchantCompanyService.js

@@ -0,0 +1,57 @@
+import request from "@/utils/httpRequest";
+
+export default {
+	list: function (params) {
+		return request({
+			url: "/wdt/merchantCompany/list",
+			method: "get",
+			params: params,
+		});
+	},
+	queryById: function (id) {
+		return request({
+			url: "/wdt/merchantCompany/queryById",
+			method: "get",
+			params: { id: id },
+		});
+	},
+	save: function (inputForm) {
+		return request({
+			url: "/wdt/merchantCompany/save",
+			method: "post",
+			data: inputForm,
+		});
+	},
+	delete: function (ids) {
+		return request({
+			url: "/wdt/merchantCompany/delete",
+			method: "delete",
+			params: { ids: ids },
+		});
+	},
+
+	exportTemplate: function () {
+		return request({
+			url: "/wdt/merchantCompany/import/template",
+			method: "get",
+			responseType: "blob",
+		});
+	},
+
+	exportExcel: function (params) {
+		return request({
+			url: "/wdt/merchantCompany/export",
+			method: "get",
+			params: params,
+			responseType: "blob",
+		});
+	},
+
+	importExcel: function (data) {
+		return request({
+			url: "/wdt/merchantCompany/import",
+			method: "post",
+			data: data,
+		});
+	},
+};

+ 57 - 0
src/api/wdt/settledPlatform/SettledPlatformService.js

@@ -0,0 +1,57 @@
+import request from "@/utils/httpRequest";
+
+export default {
+	list: function (params) {
+		return request({
+			url: "/wdt/settledPlatform/list",
+			method: "get",
+			params: params,
+		});
+	},
+	queryById: function (id) {
+		return request({
+			url: "/wdt/settledPlatform/queryById",
+			method: "get",
+			params: { id: id },
+		});
+	},
+	save: function (inputForm) {
+		return request({
+			url: "/wdt/settledPlatform/save",
+			method: "post",
+			data: inputForm,
+		});
+	},
+	delete: function (ids) {
+		return request({
+			url: "/wdt/settledPlatform/delete",
+			method: "delete",
+			params: { ids: ids },
+		});
+	},
+
+	exportTemplate: function () {
+		return request({
+			url: "/wdt/settledPlatform/import/template",
+			method: "get",
+			responseType: "blob",
+		});
+	},
+
+	exportExcel: function (params) {
+		return request({
+			url: "/wdt/settledPlatform/export",
+			method: "get",
+			params: params,
+			responseType: "blob",
+		});
+	},
+
+	importExcel: function (data) {
+		return request({
+			url: "/wdt/settledPlatform/import",
+			method: "post",
+			data: data,
+		});
+	},
+};

+ 202 - 0
src/views/utils/InputNumber.vue

@@ -0,0 +1,202 @@
+<template>
+  <div>
+    <div class="input-number-range" :class="{ 'is-disabled': disabled }">
+      <div class="flex">
+        <div class="from">
+          <el-input
+            ref="input_from"
+            oninput="value=value.replace(/[^\d]/g,'')"
+            v-model="userInputForm"
+            :disabled="disabled"
+            placeholder="最小值"
+            @blur="handleBlurFrom"
+            @focus="handleFocusFrom"
+            @input="handleInputFrom"
+            @change="handleInputChangeFrom"
+          ></el-input>
+        </div>
+        <div class="center">
+          <span>至</span>
+        </div>
+        <div class="to">
+          <el-input
+            ref="input_to"
+            oninput="value=value.replace(/[^\d]/g,'')"
+            v-model="userInputTo"
+            :disabled="disabled"
+            placeholder="最大值"
+            @blur="handleBlurTo"
+            @focus="handleFocusTo"
+            @input="handleInputTo"
+            @change="handleInputChangeTo"
+          ></el-input>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: 'InputNumber',
+
+    props: {
+      // 初始化范围
+      value: { required: true },
+
+      // 是否禁用
+      disabled: {
+        type: Boolean,
+        default: false
+      },
+
+      // 精度参数
+      precision: {
+        type: Number,
+        default: 0,
+        validator (val) {
+          return val >= 0 && val === parseInt(val, 10)
+        }
+      }
+    },
+
+    data () {
+      return {
+        userInputForm: null,
+        userInputTo: null
+      }
+    },
+
+    watch: {
+      value: {
+        immediate: true,
+        handler (value) {
+          /** 初始化范围 */
+          if (value instanceof Array && this.precision !== undefined) {
+            this.userInputForm = typeof value[0] === 'number' ? value[0] : null
+            this.userInputTo = typeof value[1] === 'number' ? value[1] : null
+          }
+        }
+      }
+    },
+
+    methods: {
+      // 根据精度保留数字
+      toPrecision (num, precision) {
+        if (precision === undefined) precision = 0
+        return parseFloat(
+          Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision)
+        )
+      },
+
+      handleBlurFrom (event) {
+        this.$emit('blurfrom', event)
+      },
+
+      handleFocusFrom (event) {
+        this.$emit('focusfrom', event)
+      },
+
+      handleBlurTo (event) {
+        this.$emit('blurto', event)
+      },
+
+      handleFocusTo (event) {
+        this.$emit('focusto', event)
+      },
+
+      handleInputFrom (value) {
+        this.$emit('inputfrom', value)
+      },
+
+      handleInputTo (value) {
+        this.$emit('inputto', value)
+      },
+
+      // from输入框change事件
+      handleInputChangeFrom (value) {
+        // 如果是非数字空返回null
+        if (isNaN(value) || value === '') {
+          this.$emit('input', [null, this.userInputTo])
+          this.$emit('changefrom', this.userInputForm)
+          return
+        }
+
+        // 初始化数字精度
+        this.userInputForm = this.setPrecisionValue(value)
+
+        // 如果from > to 将from值替换成to
+        if (typeof this.userInputTo === 'number') {
+          this.userInputForm =
+            parseFloat(this.userInputForm) <= parseFloat(this.userInputTo)
+              ? this.userInputForm
+              : this.userInputTo
+        }
+        this.$emit('input', [this.userInputForm, this.userInputTo])
+        this.$emit('changefrom', this.userInputForm)
+      },
+
+      // to输入框change事件
+      handleInputChangeTo (value) {
+        // 如果是非数字空返回null
+        if (isNaN(value) || value === '') {
+          this.$emit('input', [this.userInputForm, null])
+          this.$emit('changefrom', this.userInputTo)
+          return
+        }
+
+        // 初始化数字精度
+        this.userInputTo = this.setPrecisionValue(value)
+
+        // 如果to < tfrom 将to值替换成from
+        if (typeof this.userInputForm === 'number') {
+          this.userInputTo =
+            parseFloat(this.userInputTo) >= parseFloat(this.userInputForm)
+              ? this.userInputTo
+              : this.userInputForm
+        }
+        this.$emit('input', [this.userInputForm, this.userInputTo])
+        this.$emit('changeto', this.userInputTo)
+      },
+
+      // 设置成精度数字
+      setPrecisionValue (value) {
+        if (this.precision !== undefined) {
+          const val = this.toPrecision(value, this.precision)
+          return val
+        }
+        return null
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  /*// 取消element原有的input框样式*/
+  ::v-deep .el-input--mini .el-input__inner {
+    border: 0px;
+    margin: 0;
+    padding: 0 15px;
+    background-color: transparent;
+  }
+  .input-number-range {
+    background-color: #fff;
+    /*border: 1px solid #dcdfe6;*/
+    border-radius: 4px;
+  }
+  .flex {
+    display: flex;
+    flex-direction: row;
+    width: 100%;
+    justify-content: center;
+    align-items: center;
+    .center {
+      margin-top: 1px;
+    }
+  }
+  .is-disabled {
+    background-color: #eef0f6;
+    border-color: #e4e7ed;
+    color: #c0c4cc;
+    cursor: not-allowed;
+  }
+</style>

+ 193 - 0
src/views/wdt/merchantCompany/MerchantCompanyForm.vue

@@ -0,0 +1,193 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+	  draggable
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      v-model="visible">
+      <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+               label-width="120px" @submit.native.prevent>
+        <el-row  :gutter="15">
+          <el-col :span="12">
+            <el-form-item label="公司名称" prop="companyName"
+                          :rules="[
+                          {required: true, message:'公司名称不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.companyName" placeholder="请填写公司名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="联系人姓名" prop="linkmanName"
+                          :rules="[
+                          {required: true, message:'联系人姓名不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.linkmanName" placeholder="请填写联系人姓名"></el-input>
+            </el-form-item>
+          </el-col>
+
+			<el-col :span="12">
+				<el-form-item label="联系人电话" prop="linkmanPhone"
+							  :rules="[
+                          {required: true, message:'联系人电话不能为空', trigger:'blur'}
+                 ]">
+					<el-input v-model="inputForm.linkmanPhone" placeholder="请填写联系人电话"></el-input>
+				</el-form-item>
+			</el-col>
+
+			<el-col :span="12">
+				<el-form-item label="从业人员(人)" prop="practitionerCount"
+							  :rules="[
+                          {required: true, message:'从业人员不能为空', trigger:'blur'}
+                 ]">
+					<el-input v-model="inputForm.practitionerCount" placeholder="请填写从业人员"></el-input>
+				</el-form-item>
+			</el-col>
+
+			<el-col :span="12">
+				<el-form-item label="年销售额(元)" prop="annualSales"
+							  :rules="[
+                          {required: true, message:'年销售额不能为空', trigger:'blur'}
+                 ]">
+					<el-input v-model="inputForm.annualSales" placeholder="请填写年销售额"></el-input>
+				</el-form-item>
+			</el-col>
+
+			<el-col :span="12">
+				<el-form-item label="网络零售额(元)" prop="onlineRetailSales"
+							  :rules="[
+                          {required: true, message:'网络零售额不能为空', trigger:'blur'}
+                 ]">
+					<el-input v-model="inputForm.onlineRetailSales" placeholder="请填写网络零售额"></el-input>
+				</el-form-item>
+			</el-col>
+			<el-col :span="12">
+				<el-form-item label="入驻平台" prop="settledPlatformIdList">
+					<el-select
+						v-model="inputForm.settledPlatformIdList"
+						style="width: 100%"
+						multiple
+						placeholder="请选择"
+					>
+						<el-option
+							v-for="item in settledPlatformList"
+							:key="item.id"
+							:label="item.name"
+							:value="item.id"
+						>
+						</el-option>
+					</el-select>
+				</el-form-item>
+			</el-col>
+
+
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remarks"
+                          :rules="[
+                 ]">
+              <el-input type="textarea" maxlength="255" v-model="inputForm.remarks" placeholder="请填写备注"  show-word-limit   ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+		<template #footer>
+			<span class="dialog-footer">
+			  <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
+			  <el-button type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+			</span>
+		</template>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import merchantCompanyService from '@/api/wdt/merchantCompany/MerchantCompanyService'
+  import settledPlatformService from '@/api/wdt/settledPlatform/SettledPlatformService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+		  settledPlatformList: [],
+        inputForm: {
+			companyName: '',
+			linkmanName: '',
+			linkmanPhone: '',
+			practitionerCount: '',
+			annualSales: '',
+			onlineRetailSales: '',
+         	remarks: '',
+			settledPlatformIdList: [],
+
+        }
+      }
+    },
+    created () {
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          name: '',
+          sort: '',
+          remarks: '',
+          parentId: ''
+        }
+        if (method === 'add') {
+          this.title = `新增公司信息`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.title = '修改公司信息'
+        } else if (method === 'view') {
+          this.inputForm.id = id
+          this.title = '查看公司信息'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+			if (this.$refs.inputForm !== undefined) {
+				this.$refs.inputForm.resetFields();
+			}
+
+			Promise.all([
+				settledPlatformService.list({ current: 1, size: -1 }),
+			]).then((result) => {
+				this.settledPlatformList = result[0].records;
+			});
+
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            merchantCompanyService.queryById(this.inputForm.id).then((data) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            merchantCompanyService.save(this.inputForm).then((data) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+      }
+    }
+  }
+</script>

+ 345 - 0
src/views/wdt/merchantCompany/MerchantCompanyList.vue

@@ -0,0 +1,345 @@
+<template>
+	<div class="page">
+		<el-form :inline="true" class="query-form m-b-10" v-if="searchVisible" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+			<!-- 搜索框-->
+			<el-form-item label="公司名称" prop="companyName">
+				<el-input v-model="searchForm.companyName" placeholder="请输入公司名称" clearable></el-input>
+			</el-form-item>
+			<el-form-item label="联系人姓名" prop="linkmanName">
+				<el-input v-model="searchForm.linkmanName" placeholder="请输入联系人姓名" clearable></el-input>
+			</el-form-item>
+			<el-form-item label="联系人电话" prop="linkmanPhone">
+				<el-input v-model="searchForm.linkmanPhone" placeholder="请输入联系人电话" clearable></el-input>
+			</el-form-item>
+			<el-form-item v-if="showHideItem" label="年销售额(元)" prop="annualSalesList">
+				<InputNumber :disabled="false" :precision="num" :value="searchForm.annualSalesList"
+							 @changefrom="(val)=>{searchForm.annualSalesList[0]=val}"
+							 @changeto="(val)=>{searchForm.annualSalesList[1]=val}"
+				></InputNumber>
+			</el-form-item>
+			<el-form-item v-if="showHideItem" label="网络零售额(元)" prop="onlineRetailSalesList">
+				<InputNumber :disabled="false" :precision="num" :value="searchForm.onlineRetailSalesList"
+							 @changefrom="(val)=>{searchForm.onlineRetailSalesList[0]=val}"
+							 @changeto="(val)=>{searchForm.onlineRetailSalesList[1]=val}"
+				></InputNumber>
+			</el-form-item>
+
+			<el-form-item v-if="showHideItem" label="创建时间" prop="dates">
+				<el-date-picker
+					style=""
+					placement="bottom-start"
+					value-format="YYYY-MM-DD HH:mm:ss"
+					v-model="searchForm.dates"
+					type="datetimerange"
+					range-separator="至"
+					start-placeholder="开始日期"
+					end-placeholder="结束日期">
+				</el-date-picker>
+			</el-form-item>
+
+			<el-form-item>
+				<el-button type="default" @click="showHide" :icon="showHideIcon">{{showHideName}}</el-button>
+				<el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
+				<el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
+			</el-form-item>
+		</el-form>
+
+		<div class="jp-table top" style="">
+			<vxe-toolbar :refresh="{query: refreshList}" ref="toolbarRef" import
+						 export
+						 print
+						 resizable
+						 custom>
+				<template #buttons>
+					<el-button v-if="hasPermission('wdt:merchantCompany:add')" type="primary" icon="el-icon-plus" @click="add()">新建</el-button>
+					<el-button v-if="hasPermission('wdt:merchantCompany:del')" type="danger"  icon="el-icon-delete" @click="del()" :disabled="$refs.infoTable && $refs.infoTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+				</template>
+				<template #tools>
+					<vxe-button
+						text
+						type="primary"
+						:title="searchVisible ? '收起检索' : '展开检索'"
+						icon="vxe-icon-search"
+						class="tool-btn"
+						@click="searchVisible = !searchVisible"
+					></vxe-button>
+
+					<vxe-button
+						type="text"
+						title="下载导入模板"
+						v-if="hasPermission('wdt:merchantCompany:import')"
+						icon="vxe-icon-copy"
+						class="tool-btn m-l-0"
+						@click="downloadTpl()"
+					>
+					</vxe-button>
+				</template>
+			</vxe-toolbar>
+			<div style="height: calc(100% - 80px)">
+				<vxe-table
+					border="inner"
+					auto-resize
+					resizable
+					height="auto"
+					:loading="loading"
+					ref="infoTable"
+					show-header-overflow
+					show-overflow
+					highlight-hover-row
+					:menu-config="{}"
+					:sort-config="{remote:true}"
+					:import-config="{
+									importMethod: importMethod,
+									types: ['csv', 'xls', 'xlsx'],
+									remote: true,
+								}"
+					:export-config="{
+                    remote: true,
+                    filename: `入驻商户数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    sheetName: `入驻商户数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    exportMethod: exportMethod,
+                    types: ['xlsx'],
+                    modes: ['current', 'selected', 'all']
+                  }"
+					:data="dataList"
+					:checkbox-config="{}">
+					<vxe-column type="seq" width="60" title="序号"></vxe-column>
+					<vxe-column type="checkbox" width="60" ></vxe-column>
+					<vxe-column min-width="130" title="公司名称" field="companyName" align="center">
+						<template #default="scope">
+							<el-link  type="primary" :underline="false" v-if="hasPermission('wdt:merchantCompany:view')" @click="view(scope.row.id)">{{scope.row.companyName}}</el-link>
+							<span v-else>{{scope.row.no}}</span>
+						</template>
+					</vxe-column>
+					<vxe-column min-width="130" title="联系人姓名" field="linkmanName" align="center"></vxe-column>
+					<vxe-column min-width="180" title="联系人电话" field="linkmanPhone" align="center"></vxe-column>
+					<vxe-column min-width="100" title="从业人员(人)" field="practitionerCount" align="center"></vxe-column>
+					<vxe-column min-width="100" title="年销售额(元)" field="annualSales" align="center"></vxe-column>
+					<vxe-column min-width="100" title="网络零售额(元)" field="onlineRetailSales" align="center"></vxe-column>
+					<vxe-column min-width="100" title="创建时间" field="createTime" align="center"></vxe-column>
+
+					<vxe-column title="操作" min-width="130px" fixed="right" align="center">
+						<template  #default="scope">
+							<el-button v-if="hasPermission('wdt:merchantCompany:edit')" text type="primary" @click="edit(scope.row)">修改</el-button>
+							<el-button v-if="hasPermission('wdt:merchantCompany:del')" text type="primary"  @click="del(scope.row.id)">删除</el-button>
+						</template>
+					</vxe-column>
+				</vxe-table>
+				<vxe-pager
+					background
+					:current-page="tablePage.currentPage"
+					:page-size="tablePage.pageSize"
+					:total="tablePage.total"
+					:page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+					:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+					@page-change="currentChangeHandle">
+				</vxe-pager>
+
+				<MerchantCompanyForm  ref="merchantCompanyForm" @refreshDataList="refreshList"></MerchantCompanyForm>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import merchantCompanyService from '@/api/wdt/merchantCompany/MerchantCompanyService'
+	import InputNumber from '@/views/utils/InputNumber.vue'
+	import MerchantCompanyForm from './MerchantCompanyForm'
+	export default {
+		data () {
+			return {
+				searchVisible: true,
+				showHideItem: false,
+				showHideIcon: 'el-icon-arrow-down',
+				showHideName: '展示',
+				num: 0,
+				visable: false,
+				gridData: [],
+				searchForm: {
+					companyName: '',
+					linkmanName: '',
+					linkmanPhone: '',
+					dates: [],
+					type: [],
+					annualSalesList: [],
+					onlineRetailSalesList: [],
+					reportNumber: '',
+					sourceType: ''
+				},
+				dataList: [],
+				tablePage: {
+					total: 0,
+					currentPage: 1,
+					pageSize: 10,
+					orders: []
+				},
+				loading: false,
+				isAdmin: false
+			}
+		},
+		created () {
+		},
+		components: {
+			InputNumber,
+			MerchantCompanyForm
+		},
+		mounted () {
+			this.$nextTick(() => {
+				//将表格和工具栏进行关联
+				const $table = this.$refs.infoTable;
+				const $toolbar = this.$refs.toolbarRef;
+				$table.connect($toolbar);
+			})
+			this.refreshList()
+		},
+		activated () {
+			this.refreshList()
+		},
+		computed: {
+			userName () {
+				return this.$store.state.user.name
+			},
+			user () {
+				this.create = this.$store.state.user.id
+				console.log('createId', this.create)
+				return this.$store.state.user
+			}
+		},
+		methods: {
+			showHide () {
+				if (this.showHideItem === false) {
+					this.showHideItem = true
+					this.showHideIcon = 'el-icon-arrow-up'
+					this.showHideName = '隐藏'
+				} else {
+					this.showHideItem = false
+					this.showHideIcon = 'el-icon-arrow-down'
+					this.showHideName = '展示'
+				}
+			},
+			// 新增
+			add () {
+				this.$refs.merchantCompanyForm.init('add', '')
+			},
+
+			// 查看
+			view (id) {
+				this.$refs.merchantCompanyForm.init('view', id)
+			},
+			edit (row) {
+				this.$refs.merchantCompanyForm.init('edit', row.id)
+			},
+			// 获取数据列表
+			refreshList () {
+				this.loading = true
+				merchantCompanyService.list({
+					'current': this.tablePage.currentPage,
+					'size': this.tablePage.pageSize,
+					'orders': this.tablePage.orders,
+					...this.searchForm
+				}).then((data) => {
+					this.dataList = data.records
+					this.tablePage.total = data.total
+					this.loading = false
+				})
+			},
+			// 删除
+			del (id) {
+				let ids = id || this.$refs.infoTable.getCheckboxRecords().map(item => {
+					return item.id
+				}).join(',')
+				this.$confirm(`确定删除所选项吗?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.loading = true
+					merchantCompanyService.delete(ids).then((data) => {
+						this.$message.success(data)
+						this.refreshList()
+						this.loading = false
+					})
+				})
+			},
+			resetSearch () {
+				this.$refs.searchForm.resetFields()
+				this.refreshList()
+			},
+			// 下载模板
+			downloadTpl() {
+				merchantCompanyService
+					.exportTemplate()
+					.then((data) => {
+						// 将二进制流文件写入excel表,以下为重要步骤
+						this.$utils.downloadExcel(data, "入驻商户导入模板");
+					})
+					.catch(function (err) {
+						if (err.response) {
+							console.log(err.response);
+						}
+					});
+			},
+			// 自定义服务端导入
+			importMethod({ file }) {
+				// 处理表单
+				const formBody = new FormData();
+				formBody.append("file", file);
+				merchantCompanyService.importExcel(formBody).then((result) => {
+					this.$message.success({
+						dangerouslyUseHTMLString: true,
+						message: result,
+					});
+					this.refreshList();
+				});
+			},
+			// 下载文档
+			exportFile () {
+				this.loading = true
+				merchantCompanyService.exportFile({
+					'itemType': '1',
+					...this.searchForm
+				}).then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadExcel(res, '入驻商家信息表')
+					this.loading = false
+				}).catch(function (err) {
+					this.loading = false
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			},
+			// 当前页
+			currentChangeHandle ({ currentPage, pageSize }) {
+				this.tablePage.currentPage = currentPage
+				this.tablePage.pageSize = pageSize
+				this.refreshList()
+			},
+			// 自定义服务端导出
+			exportMethod ({ options }) {
+				// 传给服务端的参数
+				const params = {
+					'current': this.tablePage.currentPage,
+					'size': this.tablePage.pageSize,
+					'orders': this.tablePage.orders,
+					...this.searchForm,
+					filename: options.filename,
+					sheetName: options.sheetName,
+					isHeader: options.isHeader,
+					original: options.original,
+					mode: options.mode,
+					selectIds: options.mode === 'selected' ? options.map(item => item.id) : [],
+					exportFields: options.columns.map(column => column.property)
+				}
+				return merchantCompanyService.exportFile(params).then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadExcel(res, options.filename)
+				}).catch(function (err) {
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			},
+		}
+	}
+</script>

+ 124 - 0
src/views/wdt/settledPlatform/SettledPlatformForm.vue

@@ -0,0 +1,124 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+	  draggable
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      v-model="visible">
+      <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+               label-width="120px" @submit.native.prevent>
+        <el-row  :gutter="15">
+          <el-col :span="12">
+            <el-form-item label="入驻平台名称" prop="name"
+                          :rules="[
+                          {required: true, message:'入驻平台名称不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.name" placeholder="请填写入驻平台名称"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="排序" prop="sort"
+                          :rules="[
+                          {required: true, message:'排序不能为空', trigger:'blur'}
+                 ]">
+              <el-input-number v-model="inputForm.sort"
+							   style="width:100%;"
+							   :min="0"
+							   placeholder="请填写排序"
+			  ></el-input-number>
+            </el-form-item>
+          </el-col>
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remarks"
+                          :rules="[
+                 ]">
+              <el-input type="textarea" maxlength="255" v-model="inputForm.remarks" placeholder="请填写备注"  show-word-limit   ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+		<template #footer>
+			<span class="dialog-footer">
+			  <el-button @click="close()" icon="el-icon-circle-close">关闭</el-button>
+			  <el-button type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+			</span>
+		</template>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import settledPlatformService from '@/api/wdt/settledPlatform/SettledPlatformService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+			name: '',
+			sort: 0,
+         	remarks: '',
+        }
+      }
+    },
+    created () {
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          name: '',
+          sort: '',
+          remarks: '',
+          parentId: ''
+        }
+        if (method === 'add') {
+          this.title = `新增入驻平台信息`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.title = '修改入驻平台信息'
+        } else if (method === 'view') {
+          this.inputForm.id = id
+          this.title = '查看入驻平台信息'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+			  settledPlatformService.queryById(this.inputForm.id).then((data) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+			  settledPlatformService.save(this.inputForm).then((data) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+      }
+    }
+  }
+</script>

+ 243 - 0
src/views/wdt/settledPlatform/SettledPlatformList.vue

@@ -0,0 +1,243 @@
+<template>
+	<div class="page">
+		<el-form :inline="true" class="query-form m-b-10" v-if="searchVisible" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+			<!-- 搜索框-->
+			<el-form-item label="入驻平台名称" prop="name">
+				<el-input v-model="searchForm.name" placeholder="请输入入驻平台名称" clearable></el-input>
+			</el-form-item>
+			<el-form-item label="创建时间" prop="dates">
+				<el-date-picker
+					style=""
+					placement="bottom-start"
+					value-format="YYYY-MM-DD HH:mm:ss"
+					v-model="searchForm.dates"
+					type="datetimerange"
+					range-separator="至"
+					start-placeholder="开始日期"
+					end-placeholder="结束日期">
+				</el-date-picker>
+			</el-form-item>
+
+			<el-form-item>
+				<el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
+				<el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
+			</el-form-item>
+		</el-form>
+
+		<div class="jp-table top" style="">
+			<vxe-toolbar :refresh="{query: refreshList}" ref="toolbarRef" custom>
+				<template #buttons>
+					<el-button v-if="hasPermission('wdt:settledPlatform:add')" type="primary" icon="el-icon-plus" @click="add()">新建</el-button>
+					<el-button v-if="hasPermission('wdt:settledPlatform:del')" type="danger"  icon="el-icon-delete" @click="del()" :disabled="$refs.infoTable && $refs.infoTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+				</template>
+			</vxe-toolbar>
+			<div style="height: calc(100% - 80px)">
+				<vxe-table
+					border="inner"
+					auto-resize
+					resizable
+					height="auto"
+					:loading="loading"
+					ref="infoTable"
+					show-header-overflow
+					show-overflow
+					highlight-hover-row
+					:menu-config="{}"
+					:sort-config="{remote:true}"
+					:export-config="{
+                    remote: true,
+                    filename: `入驻平台数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    sheetName: `入驻平台数据${moment(new Date()).format('YYYY-MM-DD')}`,
+                    exportMethod: exportMethod,
+                    types: ['xlsx'],
+                    modes: ['current', 'selected', 'all']
+                  }"
+					:data="dataList"
+					:checkbox-config="{}">
+					<vxe-column type="seq" width="60" title="序号"></vxe-column>
+					<vxe-column type="checkbox" width="60" ></vxe-column>
+					<vxe-column min-width="130" title="入驻平台名称" field="name" align="center">
+						<template #default="scope">
+							<el-link  type="primary" :underline="false" v-if="hasPermission('wdt:settledPlatform:view')" @click="view(scope.row.id)">{{scope.row.name}}</el-link>
+							<span v-else>{{scope.row.no}}</span>
+						</template>
+					</vxe-column>
+					<vxe-column width="120" title="排序" field="sort" align="center"></vxe-column>
+					<vxe-column width="180" title="创建时间" field="createTime" align="center"></vxe-column>
+
+					<vxe-column title="操作" width="130px" fixed="right" align="center">
+						<template  #default="scope">
+							<el-button v-if="hasPermission('wdt:settledPlatform:edit')" text type="primary" @click="edit(scope.row)">修改</el-button>
+							<el-button v-if="hasPermission('wdt:settledPlatform:del')" text type="primary"  @click="del(scope.row.id)">删除</el-button>
+						</template>
+					</vxe-column>
+				</vxe-table>
+				<vxe-pager
+					background
+					:current-page="tablePage.currentPage"
+					:page-size="tablePage.pageSize"
+					:total="tablePage.total"
+					:page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+					:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+					@page-change="currentChangeHandle">
+				</vxe-pager>
+
+				<SettledPlatformForm  ref="settledPlatformForm" @refreshDataList="refreshList"></SettledPlatformForm>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import settledPlatformService from '@/api/wdt/settledPlatform/SettledPlatformService'
+	import SettledPlatformForm from './SettledPlatformForm'
+	export default {
+		data () {
+			return {
+				searchVisible: true,
+				num: 0,
+				visable: false,
+				gridData: [],
+				searchForm: {
+					name: '',
+					dates: [],
+					type: [],
+				},
+				dataList: [],
+				tablePage: {
+					total: 0,
+					currentPage: 1,
+					pageSize: 10,
+					orders: []
+				},
+				loading: false,
+				isAdmin: false
+			}
+		},
+		created () {
+		},
+		components: {
+			SettledPlatformForm
+		},
+		mounted () {
+			this.$nextTick(() => {
+				//将表格和工具栏进行关联
+				const $table = this.$refs.infoTable;
+				const $toolbar = this.$refs.toolbarRef;
+				$table.connect($toolbar);
+			})
+			this.refreshList()
+		},
+		activated () {
+			this.refreshList()
+		},
+		computed: {
+			userName () {
+				return this.$store.state.user.name
+			},
+			user () {
+				this.create = this.$store.state.user.id
+				console.log('createId', this.create)
+				return this.$store.state.user
+			}
+		},
+		methods: {
+			// 新增
+			add () {
+				this.$refs.settledPlatformForm.init('add', '')
+			},
+
+			// 查看
+			view (id) {
+				this.$refs.settledPlatformForm.init('view', id)
+			},
+			edit (row) {
+				this.$refs.settledPlatformForm.init('edit', row.id)
+			},
+			// 获取数据列表
+			refreshList () {
+				this.loading = true
+				settledPlatformService.list({
+					'current': this.tablePage.currentPage,
+					'size': this.tablePage.pageSize,
+					'orders': this.tablePage.orders,
+					...this.searchForm
+				}).then((data) => {
+					this.dataList = data.records
+					this.tablePage.total = data.total
+					this.loading = false
+				})
+			},
+			// 删除
+			del (id) {
+				let ids = id || this.$refs.infoTable.getCheckboxRecords().map(item => {
+					return item.id
+				}).join(',')
+				this.$confirm(`确定删除所选项吗?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.loading = true
+					settledPlatformService.remove(ids).then((data) => {
+						this.$message.success(data)
+						this.refreshList()
+						this.loading = false
+					})
+				})
+			},
+			resetSearch () {
+				this.$refs.searchForm.resetFields()
+				this.refreshList()
+			},
+			// 下载文档
+			exportFile () {
+				this.loading = true
+				settledPlatformService.exportFile({
+					'itemType': '1',
+					...this.searchForm
+				}).then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadExcel(res, '入驻商家信息表')
+					this.loading = false
+				}).catch(function (err) {
+					this.loading = false
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			},
+			// 当前页
+			currentChangeHandle ({ currentPage, pageSize }) {
+				this.tablePage.currentPage = currentPage
+				this.tablePage.pageSize = pageSize
+				this.refreshList()
+			},
+			// 自定义服务端导出
+			exportMethod ({ options }) {
+				// 传给服务端的参数
+				const params = {
+					'current': this.tablePage.currentPage,
+					'size': this.tablePage.pageSize,
+					'orders': this.tablePage.orders,
+					...this.searchForm,
+					filename: options.filename,
+					sheetName: options.sheetName,
+					isHeader: options.isHeader,
+					original: options.original,
+					mode: options.mode,
+					selectIds: options.mode === 'selected' ? options.map(item => item.id) : [],
+					exportFields: options.columns.map(column => column.property)
+				}
+				return settledPlatformService.exportFile(params).then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadExcel(res, options.filename)
+				}).catch(function (err) {
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			},
+		}
+	}
+</script>