From 8d817b3847f9a96850c1a28f7923940697df7235 Mon Sep 17 00:00:00 2001
From: 李林 <z1292839451@163.com>
Date: 星期一, 26 二月 2024 02:12:35 +0800
Subject: [PATCH] 框架搭建

---
 src/components/view/data-reporting.vue |  121 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 110 insertions(+), 11 deletions(-)

diff --git a/src/components/view/data-reporting.vue b/src/components/view/data-reporting.vue
index 39ae996..effeab1 100644
--- a/src/components/view/data-reporting.vue
+++ b/src/components/view/data-reporting.vue
@@ -34,6 +34,9 @@
 		height: calc(100% - 60px - 80px - 10px - 40px);
 		padding: 20px;
 	}
+	.el-radio-group{
+		width: 100%;
+	}
 </style>
 <style>
 	.data_reporting .data_reporting_dia .el-dialog__body {
@@ -55,7 +58,7 @@
 			<el-row class="title">
 				<el-col :span="12" style="padding-left: 20px;">鏁版嵁涓婃姤</el-col>
 				<el-col :span="12" style="text-align: right;padding-right: 8px;">
-					<el-button size="medium" @click="openUpload()" v-if="inPower">
+					<el-button size="medium" @click="chooseDia = true" v-if="inPower">
 						<i class="el-icon-upload2" style="color: #3A7BFA;"></i>
 						<span style="color: #3A7BFA;">瀵煎叆</span>
 					</el-button>
@@ -64,6 +67,7 @@
 						<span style="color: #3A7BFA;">瀵煎嚭</span>
 					</el-button>
 					<el-button size="medium" type="primary" @click="opeaAdd" v-if="addPower">鏂板</el-button>
+					<el-button size="medium" type="danger" @click="delNowAll" v-if="delAllPower">涓�閿垹闄�</el-button>
 				</el-col>
 			</el-row>
 		</div>
@@ -72,14 +76,16 @@
 				<div class="search_label">绯荤粺鏃ユ湡锛�</div>
 				<div class="search_input">
 					<el-date-picker size="small" v-model="componentData.entity.createTime" type="date" placeholder="閫夋嫨鏃ユ湡"
-						value-format="yyyy-MM-dd HH:mm:ss" clearable></el-date-picker>
+						value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" :editable="false" @change="refreshTable"></el-date-picker>
 				</div>
 			</div>
 			<div class="search_thing">
 				<div class="search_label">鐧昏浜猴細</div>
 				<div class="search_input">
-					<el-input size="small" v-model="componentData.entity.registrant" clearable placeholder="鐧昏浜�"
-						@keyup.enter.native="refreshTable()"></el-input>
+					<el-select size="small" style="width: 100%;" placeholder="鐧昏浜�" v-model="componentData.entity.registrant">
+						<el-option :value="null" label="鍏ㄩ儴"></el-option>
+						<el-option v-for="(a, ai) in userNames" :key="ai" :label="a" :value="a"></el-option>
+					</el-select>
 				</div>
 			</div>
 			<div class="search_thing">
@@ -101,7 +107,7 @@
 				:delUrl="$api.dataReporting.delDataReporting" :componentData="componentData" :key="upIndex" @upRole="upRole" :downUrl="$api.dataReporting.downDataReportingFile"/>
 		</div>
 		<el-dialog title="涓婃姤淇敼" :visible.sync="upDia" width="700px" class="data_reporting_dia">
-			<div class="body" v-if="upDia">
+			<div class="body" v-if="upDia" style="max-height: 550px;overflow-y: auto;">
 				<el-row style="line-height: 50px;">
 					<el-col :span="4" style="text-align: right;padding-right: 8px;">绯荤粺鏃ユ湡</el-col>
 					<el-col :span="7">
@@ -212,6 +218,12 @@
 						<el-input v-model="upData.remark" size="small"></el-input>
 					</el-col>
 				</el-row>
+				<el-row style="line-height: 50px;">
+					<el-col :span="4" style="text-align: right;padding-right: 8px;">寰俊鍙�</el-col>
+					<el-col :span="7">
+						<el-input v-model="upData.vxCard" size="small"></el-input>
+					</el-col>
+				</el-row>
 			</div>
 			<span slot="footer" class="dialog-footer" style="margin-right: 18px;">
 				<el-button type="primary" @click="saveUpData" :loading="upLoad">纭� 瀹�</el-button>
@@ -222,7 +234,7 @@
 			<div style="margin: 0 auto;">
 				<el-upload ref="upload" drag :action="javaApi + $api.dataReporting.inputCsv" :headers="token"
 					:file-list="fileList" name="file" :auto-upload="false" accept=".csv" :limit="1" :on-change="beforeUpload"
-					:on-success="onSuccess" :on-error="onError">
+					:on-success="onSuccess" :on-error="onError" :data="{param: componentData.uploadStr}">
 					<i class="el-icon-upload"></i>
 					<div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
 				</el-upload>
@@ -230,6 +242,19 @@
 			<span slot="footer" class="dialog-footer">
 				<el-button @click="uploadDia = false">鍙� 娑�</el-button>
 				<el-button type="primary" @click="submitUpload()">涓� 浼�</el-button>
+			</span>
+		</el-dialog>
+		<el-dialog title="璇烽�夋嫨鏁版嵁涓婃姤鐨勫井淇″彿" :visible.sync="chooseDia" width="500px">
+			<div class="body" v-if="chooseDia" style="max-height: 550px;overflow-y: auto;padding: 5px 0;">
+				<el-radio-group v-model="vx">
+					<el-col :span="8" v-for="(a, ai) in vxs" :key="ai" style="margin-bottom: 5px;">
+						<el-radio border size="small" :label="a.vx">{{a.vx}}</el-radio>
+					</el-col>
+				</el-radio-group>
+			</div>
+			<span slot="footer" class="dialog-footer">
+				<el-button @click="chooseDia = false">鍙栨秷</el-button>
+				<el-button type="primary" @click="openUpload()">涓嬩竴姝�</el-button>
 			</span>
 		</el-dialog>
 	</div>
@@ -250,11 +275,11 @@
 						product: null,
 						orderBy: {
 							field: 'id',
-							order: 'desc'
+							order: 'asc'
 						}
 					},
 					isIndex: true,
-					showSelect: true,
+					showSelect: false,
 					select: true,
 					do: [{
 						id: 'update',
@@ -271,8 +296,14 @@
 						method: 'doDiy'
 					}],
 					tagField: {},
-					selectField: {},
-					requiredAdd:['name2','agent','channel','product','showNum','click','accountConsumption'],
+					selectField: {
+						vxCard: {
+							select: []
+						}
+					},
+					requiredAdd:['name2','agent','channel','product','showNum','click','accountConsumption','vxCard'],
+					countFleid: ['fansAdd'],
+					uploadStr: ""
 				},
 				entityCopy: {},
 				upIndex: 0,
@@ -287,7 +318,12 @@
 				addPower: true,
 				token: null,
 				inPower: true,
-				outPower: true
+				outPower: true,
+				delAllPower: true,
+				userNames: [],
+				vxs: [],
+				chooseDia: false,
+				vx: null
 			}
 		},
 		created() {
@@ -312,14 +348,19 @@
 			this.token = {
 				'token': sessionStorage.getItem('token')
 			}
+			this.selectDataReportingForCreateUserNames()
+			this.selectVxs()
 		},
 		methods: {
 			refreshTable() {
 				this.$refs['ValueTable'].selectList()
+				this.selectDataReportingForCreateUserNames()
+				this.selectVxs()
 			},
 			refresh() {
 				this.componentData.entity = this.HaveJson(this.entityCopy)
 				this.upIndex++
+				this.selectDataReportingForCreateUserNames()
 			},
 			upRole(row) {
 				this.upData = this.HaveJson(row)
@@ -358,6 +399,7 @@
 				let add = false
 				let inPower = false
 				let outPower = false
+				let delAllPower = false
 				for (var i = 0; i < power.length; i++) {
 					if (power[i].menuMethod == 'upDataReporting') {
 						up = true
@@ -374,6 +416,9 @@
 					if (power[i].menuMethod == 'downDataReportingFile') {
 						outPower = true
 					}
+					if (power[i].menuMethod == 'deleteAllData') {
+						delAllPower = true
+					}
 				}
 				if (!del) {
 					this.componentData.do.splice(1, 1)
@@ -384,8 +429,14 @@
 				this.addPower = add
 				this.inPower = inPower
 				this.outPower = outPower
+				this.delAllPower = delAllPower
 			},
 			openUpload() {
+				if(this.vx == null || this.vx == undefined) {
+					this.$message.error('璇烽�夋嫨鏁版嵁涓婃姤鐨勫井淇″彿')
+					return
+				}
+				this.componentData.uploadStr = this.vx
 				this.uploadDia = true
 			},
 			beforeUpload(file, fileList) {
@@ -402,11 +453,13 @@
 				}
 				this.uploading = true
 				this.$refs.upload.submit();
+				this.uploadDia = false
 			},
 			onSuccess(response, file, fileList) {
 				this.$refs.upload.clearFiles()
 				this.uploadDia = false
 				this.uploading = false
+				this.chooseDia = false
 				if(response.code==201){
 					this.$message.error(response.message)
 					return
@@ -421,6 +474,52 @@
 			},
 			opeaAdd() {
 				this.$refs.ValueTable.openAddDia(this.$api.dataReporting.addDataReporting);
+			},
+			delNowAll(){
+				this.$confirm('鏄惁鍒犻櫎 '+this.componentData.entity.createTime.split(' ')[0]+' 鏁版嵁鏃堕棿鐨勫叏閮ㄦ暟鎹�?', "璀﹀憡", {
+					confirmButtonText: "纭畾",
+					cancelButtonText: "鍙栨秷",
+					type: "error"
+				}).then(() => {
+					this.uploading = true
+					this.$axios.post(this.$api.dataReporting.deleteAllData, {
+						date: this.componentData.entity.createTime.split(' ')[0]
+					}).then(res => {
+						this.uploading = false
+						if (res.code === 201) {
+							return
+						}
+						this.$message.success('鍒犻櫎鎴愬姛')
+						this.refreshTable()
+					})
+				}).catch(() => {})
+			},
+			selectDataReportingForCreateUserNames(){
+				this.$axios.post(this.$api.dataReporting.selectDataReportingForCreateUserNames,{
+					time: this.componentData.entity.createTime
+				}).then(res => {
+					this.userNames = res.data
+				})
+			},
+			selectVxs(){
+				this.$axios.get(this.$api.dataReporting.selectVxs,{
+					params:{
+						time: this.componentData.entity.createTime
+					}
+				}).then(res => {
+					if (res.code === 201) {
+						return
+					}
+					this.vxs = res.data
+					var str = []
+					res.data.forEach(a => {
+						str.push({
+							label: a.vx,
+							value: a.vx
+						})
+					})
+					this.componentData.selectField.vxCard.select = str
+				})
 			}
 		}
 	}

--
Gitblit v1.9.3