From 5f2ee03958a1a16dc27195c76ea7cffb422c95d1 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期五, 19 十二月 2025 22:40:34 +0800
Subject: [PATCH] feat: 任务修改接口,删除一些不要的字段同步
---
ruoyi-ui/src/views/evaluation/qrcode/index.vue | 98 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 87 insertions(+), 11 deletions(-)
diff --git a/ruoyi-ui/src/views/evaluation/qrcode/index.vue b/ruoyi-ui/src/views/evaluation/qrcode/index.vue
index be23c18..e29cf62 100644
--- a/ruoyi-ui/src/views/evaluation/qrcode/index.vue
+++ b/ruoyi-ui/src/views/evaluation/qrcode/index.vue
@@ -58,7 +58,7 @@
<el-table v-loading="loading" :data="qrcodeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
- <el-table-column label="浜岀淮鐮両D" align="center" prop="qrcodeId" />
+
<el-table-column label="杞︾墝鍙�" align="center" prop="vehicleNo" />
<el-table-column label="浜岀淮鐮乁RL" align="center" prop="qrcodeUrl" width="200">
<template slot-scope="scope">
@@ -128,7 +128,7 @@
<el-input v-model="form.vehicleNo" placeholder="璇疯緭鍏ヨ溅鐗屽彿" />
</el-form-item>
<el-form-item label="浜岀淮鐮乁RL" prop="qrcodeUrl">
- <el-input v-model="form.qrcodeUrl" placeholder="璇疯緭鍏ヤ簩缁寸爜URL" />
+ <el-input v-model="form.qrcodeUrl" placeholder="鍙�夛紝鐣欑┖鍒欎娇鐢ㄩ粯璁RL" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -137,10 +137,30 @@
</div>
</el-dialog>
+ <!-- 鎵归噺鐢熸垚浜岀淮鐮佸璇濇 -->
+ <el-dialog title="鎵归噺鐢熸垚浜岀淮鐮�" :visible.sync="batchOpen" width="600px" append-to-body>
+ <el-form ref="batchForm" :model="batchForm" :rules="batchRules" label-width="100px">
+ <el-form-item label="杞︾墝鍙�" prop="vehicleNos">
+ <el-input
+ v-model="batchForm.vehicleNos"
+ type="textarea"
+ :rows="6"
+ placeholder="璇疯緭鍏ヨ溅鐗屽彿锛屽涓溅鐗屽彿鐢ㄩ�楀彿鍒嗛殧锛屼緥濡傦細绮12345,绮67890,绮11111" />
+ </el-form-item>
+ <el-form-item label="浜岀淮鐮乁RL" prop="qrcodeUrl">
+ <el-input v-model="batchForm.qrcodeUrl" placeholder="鍙�夛紝鐣欑┖鍒欎娇鐢ㄩ粯璁RL" />
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitBatchForm">纭� 瀹�</el-button>
+ <el-button @click="cancelBatch">鍙� 娑�</el-button>
+ </div>
+ </el-dialog>
+
<!-- 浜岀淮鐮佽鎯呭璇濇 -->
<el-dialog title="浜岀淮鐮佽鎯�" :visible.sync="viewOpen" width="600px" append-to-body>
<el-descriptions :column="2" border>
- <el-descriptions-item label="浜岀淮鐮両D">{{ viewForm.qrcodeId }}</el-descriptions-item>
+
<el-descriptions-item label="杞︾墝鍙�">{{ viewForm.vehicleNo }}</el-descriptions-item>
<el-descriptions-item label="浜岀淮鐮乁RL" :span="2">
<el-link :href="viewForm.qrcodeUrl" target="_blank" type="primary">{{ viewForm.qrcodeUrl }}</el-link>
@@ -194,6 +214,8 @@
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
+ // 鏄惁鏄剧ず鎵归噺鐢熸垚寮瑰嚭灞�
+ batchOpen: false,
// 鏄惁鏄剧ず鏌ョ湅寮瑰嚭灞�
viewOpen: false,
// 鏌ヨ鍙傛暟
@@ -205,6 +227,8 @@
},
// 琛ㄥ崟鍙傛暟
form: {},
+ // 鎵归噺鐢熸垚琛ㄥ崟鍙傛暟
+ batchForm: {},
// 鏌ョ湅琛ㄥ崟鍙傛暟
viewForm: {},
// 琛ㄥ崟鏍¢獙
@@ -213,7 +237,15 @@
{ required: true, message: "杞︾墝鍙蜂笉鑳戒负绌�", trigger: "blur" }
],
qrcodeUrl: [
- { required: true, message: "浜岀淮鐮乁RL涓嶈兘涓虹┖", trigger: "blur" },
+ { type: 'url', message: '璇疯緭鍏ユ纭殑URL鏍煎紡', trigger: 'blur' }
+ ]
+ },
+ // 鎵归噺鐢熸垚琛ㄥ崟鏍¢獙
+ batchRules: {
+ vehicleNos: [
+ { required: true, message: "杞︾墝鍙蜂笉鑳戒负绌�", trigger: "blur" }
+ ],
+ qrcodeUrl: [
{ type: 'url', message: '璇疯緭鍏ユ纭殑URL鏍煎紡', trigger: 'blur' }
]
}
@@ -249,6 +281,14 @@
};
this.resetForm("form");
},
+ // 鎵归噺琛ㄥ崟閲嶇疆
+ resetBatch() {
+ this.batchForm = {
+ vehicleNos: null,
+ qrcodeUrl: null
+ };
+ this.resetForm("batchForm");
+ },
/** 鎼滅储鎸夐挳鎿嶄綔 */
handleQuery() {
this.queryParams.pageNum = 1;
@@ -277,7 +317,7 @@
if (valid) {
const params = {
vehicleNo: this.form.vehicleNo,
- qrcodeUrl: this.form.qrcodeUrl
+ qrcodeUrl: this.form.qrcodeUrl || null
};
generateQrcode(params).then(response => {
this.$modal.msgSuccess("鐢熸垚鎴愬姛");
@@ -289,12 +329,48 @@
},
/** 鎵归噺鐢熸垚鎸夐挳鎿嶄綔 */
handleBatchGenerate() {
- this.$modal.confirm('鏄惁纭鎵归噺鐢熸垚鎵�鏈夎溅杈嗙殑浜岀淮鐮侊紵').then(function() {
- return batchGenerateQrcode();
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("鎵归噺鐢熸垚鎴愬姛");
- }).catch(() => {});
+ this.resetBatch();
+ this.batchOpen = true;
+ },
+ // 鍙栨秷鎵归噺鐢熸垚
+ cancelBatch() {
+ this.batchOpen = false;
+ this.resetBatch();
+ },
+ /** 鎵归噺鎻愪氦鎸夐挳 */
+ submitBatchForm() {
+ this.$refs["batchForm"].validate(valid => {
+ if (valid) {
+ const vehicleNos = this.batchForm.vehicleNos.split(',').map(no => no.trim()).filter(no => no);
+ if (vehicleNos.length === 0) {
+ this.$modal.msgError("璇疯緭鍏ユ湁鏁堢殑杞︾墝鍙�");
+ return;
+ }
+
+ console.log('鎵归噺鐢熸垚杞︾墝鍙峰垪琛�:', vehicleNos);
+
+ const params = {
+ vehicleNos: vehicleNos,
+ qrcodeUrl: this.batchForm.qrcodeUrl || null
+ };
+
+ console.log('鎵归噺鐢熸垚鍙傛暟:', params);
+
+ batchGenerateQrcode(params).then(response => {
+ console.log('鎵归噺鐢熸垚鍝嶅簲:', response);
+ if (response.code === 200) {
+ this.$modal.msgSuccess(response.msg || "鎵归噺鐢熸垚鎴愬姛");
+ } else {
+ this.$modal.msgError(response.msg || "鎵归噺鐢熸垚澶辫触");
+ }
+ this.batchOpen = false;
+ this.getList();
+ }).catch(error => {
+ console.error('鎵归噺鐢熸垚澶辫触:', error);
+ this.$modal.msgError("鎵归噺鐢熸垚澶辫触锛岃閲嶈瘯");
+ });
+ }
+ });
},
/** 鏌ョ湅鎸夐挳鎿嶄綔 */
handleView(row) {
--
Gitblit v1.9.1