Browse Source

大屏代码提交

user5 1 year ago
parent
commit
d97d0b9fde

+ 32 - 0
src/api/wdt/merchantCompanyType/MerchantCompanyTypeService.js

@@ -0,0 +1,32 @@
+import request from "@/utils/httpRequest";
+
+export default {
+	list: function (params) {
+		return request({
+			url: "/wdt/merchantCompanyType/list",
+			method: "get",
+			params: params,
+		});
+	},
+	queryById: function (id) {
+		return request({
+			url: "/wdt/merchantCompanyType/queryById",
+			method: "get",
+			params: { id: id },
+		});
+	},
+	save: function (inputForm) {
+		return request({
+			url: "/wdt/merchantCompanyType/save",
+			method: "post",
+			data: inputForm,
+		});
+	},
+	delete: function (ids) {
+		return request({
+			url: "/wdt/merchantCompanyType/delete",
+			method: "delete",
+			params: { ids: ids },
+		});
+	},
+};

+ 22 - 9
src/views/wdt/merchantCompany/MerchantCompanyForm.vue

@@ -18,29 +18,37 @@
               <el-input v-model="inputForm.companyName" placeholder="请填写公司名称"></el-input>
             </el-form-item>
           </el-col>
+
+
+
+
 			<el-col :span="12">
-				<el-form-item label="公司类型" prop="companyType" :rules="[
+				<el-form-item label="公司类型" prop="companyTypeIdList" :rules="[
 					{required: true, message:'公司类型不能为空', trigger:'blur'}
 				]">
 					<el-select
-						v-model="inputForm.companyType"
-						placeholder="请选择"
+						v-model="inputForm.companyTypeIdList"
 						style="width: 100%"
+						multiple
 						clearable
+						placeholder="请选择"
 					>
 						<el-option
-							v-for="item in $dictUtils.getDictList(
-								'merchant_company_type'
-							)"
-							:key="item.value"
-							:label="item.label"
-							:value="item.value"
+							v-for="item in companyTypeList"
+							:key="item.id"
+							:label="item.name"
+							:value="item.id"
 						>
 						</el-option>
 					</el-select>
 				</el-form-item>
 
+
 			</el-col>
+
+
+
+
           <el-col :span="12">
             <el-form-item label="联系人姓名" prop="linkmanName"
                           :rules="[
@@ -172,6 +180,7 @@
   import merchantCompanyService from '@/api/wdt/merchantCompany/MerchantCompanyService'
   import settledPlatformService from '@/api/wdt/settledPlatform/SettledPlatformService'
   import merchantProductService from '@/api/wdt/merchantProduct/MerchantProductService'
+  import merchantCompanyTypeService from '@/api/wdt/merchantCompanyType/MerchantCompanyTypeService'
   export default {
     data () {
       return {
@@ -181,6 +190,7 @@
         loading: false,
 		  settledPlatformList: [],
 		  merchantProductList: [],
+		  companyTypeList: [],
         inputForm: {
 			companyName: '',
 			companyType: '',
@@ -193,6 +203,7 @@
 			onlineRetailSales: '',
          	remarks: '',
 			settledPlatformIdList: [],
+			companyTypeIdList: [],
 
         }
       }
@@ -227,9 +238,11 @@
 			Promise.all([
 				settledPlatformService.list({ current: 1, size: -1 }),
 				merchantProductService.list({ current: 1, size: -1 }),
+				merchantCompanyTypeService.list({ current: 1, size: -1 }),
 			]).then((result) => {
 				this.settledPlatformList = result[0].records;
 				this.merchantProductList = result[1].records;
+				this.companyTypeList = result[2].records;
 				console.log(result)
 			});
 

+ 1 - 2
src/views/wdt/merchantCompany/MerchantCompanyList.vue

@@ -127,11 +127,10 @@
 							<span v-else>{{scope.row.no}}</span>
 						</template>
 					</vxe-column>
+					<vxe-column min-width="100" title="公司类型" field="companyTypeStr" align="center"></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="settledPlatformStr" align="center"></vxe-column>
 					<vxe-column min-width="100" title="创建时间" field="createTime" align="center"></vxe-column>
 

+ 128 - 0
src/views/wdt/merchantCompanyType/MerchantCompanyTypeForm.vue

@@ -0,0 +1,128 @@
+<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="130px" @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 merchantCompanyTypeService from '@/api/wdt/merchantCompanyType/MerchantCompanyTypeService'
+  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: '',
+			salesVolume: '',
+			saleroom: '',
+			monthlySalesVolume: '',
+          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
+			  merchantCompanyTypeService.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
+			  merchantCompanyTypeService.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>

+ 179 - 0
src/views/wdt/merchantCompanyType/MerchantCompanyTypeList.vue

@@ -0,0 +1,179 @@
+<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>
+				<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:merchantCompanyType:add')" type="primary" icon="el-icon-plus" @click="add()">新建</el-button>
+					<el-button v-if="hasPermission('wdt:merchantCompanyType: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}"
+					: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="productName" align="center">
+						<template #default="scope">
+							<el-link  type="primary" :underline="false" v-if="hasPermission('wdt:merchantCompanyType:view')" @click="view(scope.row.id)">{{scope.row.name}}</el-link>
+							<span v-else>{{scope.row.name}}</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:merchantCompanyType:edit')" text type="primary" @click="edit(scope.row)">修改</el-button>
+							<el-button v-if="hasPermission('wdt:merchantCompanyType: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>
+
+				<MerchantCompanyTypeForm  ref="merchantCompanyTypeForm" @refreshDataList="refreshList"></MerchantCompanyTypeForm>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import merchantCompanyTypeService from '@/api/wdt/merchantCompanyType/MerchantCompanyTypeService'
+	import MerchantCompanyTypeForm from './MerchantCompanyTypeForm'
+	export default {
+		data () {
+			return {
+				searchVisible: true,
+				num: 0,
+				visable: false,
+				searchForm: {
+					name: '',
+					type: [],
+				},
+				dataList: [],
+				tablePage: {
+					total: 0,
+					currentPage: 1,
+					pageSize: 10,
+					orders: []
+				},
+				loading: false,
+				isAdmin: false
+			}
+		},
+		created () {
+		},
+		components: {
+			MerchantCompanyTypeForm
+		},
+		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.merchantCompanyTypeForm.init('add', '')
+			},
+
+			// 查看
+			view (id) {
+				this.$refs.merchantCompanyTypeForm.init('view', id)
+			},
+			edit (row) {
+				this.$refs.merchantCompanyTypeForm.init('edit', row.id)
+			},
+			// 获取数据列表
+			refreshList () {
+				this.loading = true
+				merchantCompanyTypeService.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
+					merchantCompanyTypeService.delete(ids).then((data) => {
+						this.$message.success(data)
+						this.refreshList()
+						this.loading = false
+					})
+				})
+			},
+			resetSearch () {
+				this.$refs.searchForm.resetFields()
+				this.refreshList()
+			},
+			// 当前页
+			currentChangeHandle ({ currentPage, pageSize }) {
+				this.tablePage.currentPage = currentPage
+				this.tablePage.pageSize = pageSize
+				this.refreshList()
+			},
+		}
+	}
+</script>

+ 2 - 2
src/views/wdt/merchantProduct/MerchantProductForm.vue

@@ -33,7 +33,7 @@
 
 
           <el-col :span="24">
-            <el-form-item label="产品销售量" prop="salesVolume"
+            <el-form-item label="产品种类数量" prop="salesVolume"
                           :rules="[
 
                  ]">
@@ -42,7 +42,7 @@
 												.replace(/\.{2,}/g,'.')
 												.replace('.','$#$').replace(/\./g,'').replace('$#$','.')
 												.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
-						v-model="inputForm.salesVolume" placeholder="请填写产品销售量"></el-input>
+						v-model="inputForm.salesVolume" placeholder="请填写种类数量"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="24">

+ 1 - 1
src/views/wdt/merchantProduct/MerchantProductList.vue

@@ -62,7 +62,7 @@
 							<span v-else>{{scope.row.name}}</span>
 						</template>
 					</vxe-column>
-					<vxe-column width="120" title="销售量" field="salesVolume" align="center"></vxe-column>
+					<vxe-column width="120" title="种类数量" field="salesVolume" align="center"></vxe-column>
 					<vxe-column width="120" title="销售额(元)" field="saleroom" align="center"></vxe-column>
 					<vxe-column width="120" title="月销售额(元)" field="monthlySalesVolume" align="center"></vxe-column>
 					<vxe-column width="120" title="排序" field="sort" align="center"></vxe-column>