From f96e393e62b4c7496f7ace44b6aa5abb69ae58df Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期一, 11 九月 2023 21:54:55 +0800
Subject: [PATCH] bug修改
---
src/views/operate/fivepack/threepack/components/content.vue | 507 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 485 insertions(+), 22 deletions(-)
diff --git a/src/views/operate/fivepack/threepack/components/content.vue b/src/views/operate/fivepack/threepack/components/content.vue
index d07ac4e..eaf9c3b 100644
--- a/src/views/operate/fivepack/threepack/components/content.vue
+++ b/src/views/operate/fivepack/threepack/components/content.vue
@@ -6,7 +6,7 @@
<div class="search-item">
<span>杈撳叆鏌ヨ:</span>
<el-input
- style="flex: 1"
+ style="flex: 1; margin-left: 15px"
:placeholder="
isStorePage() ? '搴楅摵锛堥棬搴楋級鍚嶇О' : '璇疯緭鍏ュ簵閾虹紪鍙�'
"
@@ -15,7 +15,11 @@
</div>
<div class="search-item">
<span>搴楅摵鐘舵��:</span>
- <el-select v-model="storeStatus" placeholder="閫夋嫨搴楅摵鐘舵��">
+ <el-select
+ v-model="storeStatus"
+ style="margin-left: 15px"
+ placeholder="閫夋嫨搴楅摵鐘舵��"
+ >
<el-option
v-for="item in options"
:key="item.value"
@@ -46,14 +50,18 @@
<main>
<!-- 鏁版嵁灞曠ず -->
<el-table
+ border
+ stripe
ref="multipleTable"
:header-cell-style="{
+ background: '#F5F5F5',
'font-weight': '650',
'line-height': '45px',
}"
:data="tableData"
style="width: 100%"
:row-class-name="tableRowClassName"
+ @selection-change="tableChange"
>
<el-table-column type="selection" min-width="5"> </el-table-column>
<el-table-column prop="storeNumber" label="搴楅摵缂栧彿" min-width="10">
@@ -70,11 +78,16 @@
min-width="10"
>
</el-table-column>
- <el-table-column prop="storeScore" label="搴楅摵绉垎" min-width="10">
- </el-table-column>
+ <!-- <el-table-column prop="storeScore" label="搴楅摵绉垎" min-width="10">
+ </el-table-column> -->
<el-table-column prop="videoPoint" label="鍏宠仈鎽勫儚鏈�" min-width="10">
<template v-if="scope.row.videoId" slot-scope="scope">
<span>{{ scope.row.videoPoint.name }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="status" label="鐘舵��" min-width="10">
+ <template slot-scope="scope">
+ <span>{{ scope.row.status == 1 ? "缁忚惀" : "鍊掗棴" }}</span>
</template>
</el-table-column>
<el-table-column prop="operation" label="鎿嶄綔" min-width="20">
@@ -93,7 +106,11 @@
@click="handleDelete(scope.row.id)"
>鍒犻櫎</el-link
>
- <el-link class="leftPx" icon="el-icon-edit" :underline="false"
+ <el-link
+ class="leftPx"
+ icon="el-icon-edit"
+ :underline="false"
+ @click="sendMessage(scope.row.contact)"
>鎺ㄩ�佷俊鎭�</el-link
>
<el-link
@@ -148,18 +165,150 @@
>
<scoreView v-if="dialogScore" :storeInfo="storeInfoScoreView" />
</el-dialog>
- <!-- 鍒嗛〉 -->
- <div class="pagination">
- <el-pagination
- background
- :current-page="currentPage"
- layout="prev, pager, next"
- :total="totalNum"
- :page-size="pageSize"
- @current-change="changeCurrentPage"
- >
- </el-pagination>
+ <!-- 鏂板缓娑堟伅 -->
+ <el-dialog
+ title="鏂板缓娑堟伅"
+ :destroy-on-close="true"
+ :key="dialogType"
+ :visible.sync="isShowDialog"
+ width="80%"
+ :before-close="handleConfirmClose"
+ >
+ <div class="mainContent">
+ <el-form
+ ref="user"
+ label-width="140px"
+ autoComplete="on"
+ :model="role"
+ :rules="rules"
+ label-position="right"
+ >
+ <!-- 娑堟伅鏍忕洰 -->
+ <el-form-item
+ class="optionItem"
+ label="鐭俊妯℃澘:"
+ prop="messageType"
+ >
+ <div class="message-item">
+ <div class="message-item__left">
+ <el-select
+ v-model="role.messageType"
+ placeholder="璇烽�夋嫨鐭俊妯℃澘"
+ @change="setTemplateValue"
+ >
+ <el-option
+ v-for="item in colList"
+ :key="item.id"
+ :label="item.title"
+ :value="item.id"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </el-form-item>
+ <!-- 娑堟伅鏍囬 -->
+ <el-form-item class="optionItems" label="鐭俊鏍囬:" prop="head">
+ <div class="message-item__left">
+ <el-input
+ v-model="role.head"
+ placeholder="璇烽�夋嫨鐭俊鏍囬"
+ ></el-input>
+ </div>
+ </el-form-item>
+ <!-- 鎺ユ敹瀵硅薄 -->
+ <el-form-item
+ class="optionItem"
+ label="鎺ユ敹鎵嬫満鍙�:"
+ prop="targetTo"
+ >
+ <!-- <div class="message-item__left">
+ <el-select v-model="role.targetTo" placeholder="璇烽�夋嫨鎺ユ敹鎺ユ敹鎵嬫満鍙�" >
+ <el-option :value="role.targetTo">
+ <el-tree ref="tree" :data="departList" :props="defaultProps" show-checkbox
+ @check="handleCheck" default-expand-all node-key="id">
+ </el-tree>
+ </el-option>
+ </el-select> -->
+ <!-- </div> -->
+ <div class="message-item__left">
+ <el-input v-model="role.phoneNumber"></el-input>
+ </div>
+ </el-form-item>
+ <!-- 娑堟伅鍐呭 -->
+ <el-form-item class="optionItem" label="娑堟伅鍐呭:" prop="body">
+ <MyEditor ref="edit"></MyEditor>
+ </el-form-item>
+
+ <el-form-item>
+ <div class="optionBtn">
+ <el-button
+ type="primary"
+ @click.native.prevent="handleSubmit(2)"
+ class="btn submit"
+ >鍙戝竷</el-button
+ >
+ <el-button
+ class="btn cancel"
+ @click.native.prevent="handleResetq"
+ >閲嶇疆</el-button
+ >
+ </div>
+ </el-form-item>
+ </el-form>
+ </div>
+ </el-dialog>
+ <div class="tools">
+ <div class="funs">
+ <div class="funsItem">
+ <el-checkbox v-model="all" @change="selectAll()">鍏ㄩ��</el-checkbox>
+ </div>
+ <div class="funsItem">
+ <el-checkbox v-model="unsame" @change="disSame(tableData)"
+ >鍙嶉��</el-checkbox
+ >
+ </div>
+ <div class="funsItem">
+ <el-select
+ v-model="myIdx"
+ placeholder="鎵归噺鎿嶄綔"
+ @change="selectChange"
+ >
+ <el-option
+ v-for="item in options"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ :disabled="item.disabled"
+ >
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ <div class="pagination">
+ <el-pagination
+ background
+ :current-page="currentPage"
+ layout="prev, pager, next"
+ :total="totalNum"
+ :page-size="pageSize"
+ @current-change="changeCurrentPage"
+ >
+ </el-pagination>
+ </div>
</div>
+ <!-- 鍒嗛〉 -->
+ <!-- <div class="pagination">-->
+ <!-- <el-pagination-->
+ <!-- background-->
+ <!-- :current-page="currentPage"-->
+ <!-- layout="prev, pager, next"-->
+ <!-- :total="totalNum"-->
+ <!-- :page-size="pageSize"-->
+ <!-- @current-change="changeCurrentPage"-->
+ <!-- >-->
+ <!-- </el-pagination>-->
+ <!-- </div>-->
</main>
</div>
</template>
@@ -170,18 +319,32 @@
getStoreInfoList,
deleteStoreInfo,
} from "@/api/operate/storeManagement";
+import { sendMessageByMobileNumber } from "@/api/operate/messageManagement";
+import MyEditor from "@/components/edit";
+import SMS from "@/api/operate/SMS";
export default {
- components: { updateUser, scoreView },
-
+ components: { updateUser, scoreView, MyEditor },
created() {
this.search();
+ this.getSMSTemplateList();
},
props: ["model"],
data() {
+ const validateMessageContent = (rule, value, callback) => {
+ if (!value) {
+ callback(new Error("璇疯緭鍏ョ煭淇″唴瀹�"));
+ } else {
+ callback();
+ }
+ };
return {
+ tempList: [],
+ myIdx: 0,
+ all: false,
+ unsame: false,
storeCode: null,
storeStatus: null,
options: [
@@ -197,12 +360,163 @@
pageSize: 10,
userInfo: null,
dialogType: "",
+ isShowDialog: false,
storeInfo: null,
+ all: false,
+ unsame: false,
+ myIdx: null,
storeInfoScoreView: {},
+ role: {
+ messageType: "",
+ head: "",
+ targetTo: "",
+ targetFrom: null,
+ body: "",
+ channelCode: "02",
+ phoneNumber: null,
+ },
+ rules: {
+ messageType: [
+ {
+ required: true,
+ trigger: ["blur", "change"],
+ message: "璇烽�夋嫨鐭俊妯℃澘",
+ },
+ ],
+ head: [{ required: true, trigger: "blur", message: "璇疯緭鍏ョ煭淇℃爣棰�" }],
+ body: [
+ {
+ required: true,
+ trigger: ["blur", "change"],
+ validator: validateMessageContent,
+ },
+ ],
+ },
+ colList: [],
+ departList: [],
+ typeList: [],
+ dialogCreate: false,
+ dialogView: false,
+ defaultProps: {
+ children: "children",
+ label: "departName",
+ },
+ checkedList: [],
+ tempNameArr: [],
+ info: {},
+ sendUser: "",
};
},
methods: {
+ // 鐩戝惉琛ㄦ牸閫変腑鐘舵��
+ tableChange(list) {
+ this.tempList = list;
+ this.all = list.length === this.tableData.length;
+ },
+ // 鎵归噺鍒犻櫎
+ mulDelete(idArr) {
+ this.$axios({
+ method: "delete",
+ url: "sccg/illegal_building/batch_delete?ids=" + idArr,
+ }).then((res) => {
+ this.getUserList();
+ this.$message({
+ message: res.message,
+ type: res.code === 200 ? "success" : "warning",
+ });
+ });
+ },
+ // 鎵ц涓嬫媺妗嗘搷浣�
+ selectChange(val) {
+ let ids = [];
+ this.tempList.forEach((item) => {
+ ids.push(item.number);
+ });
+ if (ids.length !== 0) {
+ if (val === 3) {
+ this.mulDelete(ids);
+ }
+ } else {
+ this.$message({
+ type: "warning",
+ message: "鎮ㄨ繕娌¢�変腑浠讳綍鏁版嵁",
+ });
+ }
+ },
+ // 鍏ㄩ��
+ selectAll() {
+ this.$refs.multipleTable.toggleAllSelection();
+ },
+ // 鍙嶉��
+ disSame(list) {
+ list.forEach((row) => {
+ this.$refs.multipleTable.toggleRowSelection(row);
+ });
+ },
+ // 鏂板缓/淇濆瓨娑堟伅(1:鏂板缓,0淇濆瓨娑堟伅)
+ handleSubmit(mystatus) {
+ this.role.body = this.$refs.edit.editor.txt.html();
+ this.$refs.user.validate((valid) => {
+ if (valid) {
+ const params = Object.assign({}, this.role);
+ params.targetTo = this.checkedList.join(",");
+ params.status = mystatus;
+ sendMessageByMobileNumber(params)
+ .then(() => {
+ this.$message({ type: "success", message: "鎿嶄綔鎴愬姛" });
+ this.isShowDialog = false;
+ this.role.body = "";
+ this.role.head = "";
+ this.$refs.edit.editor.txt.clear();
+ this.search();
+ this.$refs.user.resetFields();
+ })
+ .catch((err) => this.$message({ type: "error", message: err }));
+ } else {
+ this.$message.warning("璇锋鏌ュ繀濉」");
+ }
+ });
+ },
+ setTemplateValue(obj) {
+ var _this = this;
+ SMS.getSMSTemplateById(obj).then((result) => {
+ _this.role.head = result.title;
+ _this.role.body = result.body;
+ _this.$refs.edit.editor.txt.html(result.body);
+ });
+ },
+ getSMSTemplateList() {
+ SMS.getSMSTemplateList({ current: 1, pageSize: 100 })
+ .then(({ records }) => {
+ this.colList = records;
+ })
+ .catch((err) => this.$message.error(err));
+ },
+ // 纭鍏抽棴寮圭獥
+ handleConfirmClose(done) {
+ this.$confirm("纭鍏抽棴?").then(() => {
+ done();
+ this.search();
+ this.role.body = "";
+ this.role.head = "";
+ this.$refs.edit.editor.txt.clear();
+ this.search();
+ this.$refs.user.resetFields();
+ });
+ },
+ // 閲嶇疆琛ㄥ崟
+ handleResetq() {
+ this.$refs.edit.editor.txt.clear();
+ this.search();
+ this.$refs.user.resetFields();
+ this.role.body = "";
+ this.role.head = "";
+ },
+ sendMessage(val) {
+ this.isShowDialog = true;
+ this.role.phoneNumber = val;
+ },
search() {
const status = this.storeStatus === 0 ? null : this.storeStatus;
getStoreInfoList({ keyword: this.storeCode, status })
@@ -273,8 +587,9 @@
.content {
flex: 1;
height: 100%;
+ margin-left: 5px;
padding-left: 20px;
-
+ border: 1px solid #ccc;
.headerContent {
display: flex;
line-height: 100px;
@@ -312,10 +627,158 @@
margin-top: 20px;
padding-bottom: 50px;
+ .mainContent {
+ display: flex;
+ justify-content: center;
+ padding-top: 50px;
+ //&:deep(.el-dialog__title) {
+ // color: #4b9bb7;
+ //}
+ //&::v-deep .el-form-item__label {
+ // color: #4b9bb7;
+ //}
+ //
+ //&::v-deep .el-input__inner {
+ // width: 400px;
+ // background-color: #09152f;
+ // border: 1px solid #17324c;
+ //}
+
+ .message-item__left {
+ width: 400px;
+ }
+
+ .message-add {
+ &:hover {
+ cursor: pointer;
+ }
+ }
+
+ .el-form-item__content :deep(.el-select) {
+ width: 400px;
+ }
+
+ //:deep(.el-input) {
+ // width: 400px;
+ //}
+
+ .message-item {
+ display: flex;
+
+ span {
+ margin-left: 20px;
+ color: #4b9bb7;
+ }
+ }
+
+ .message-tip {
+ margin-left: 20px;
+ }
+
+ //:deep(.el-input--suffix) {
+ // width: 400px;
+ //}
+ //
+ //&::v-deep .el-textarea__inner {
+ // background-color: #09152f;
+ // border: 1px solid #17324c;
+ //}
+
+ .el-form-item__content {
+ width: 400px;
+
+ .el-select {
+ width: 100%;
+ }
+ }
+
+ .optionHandleSp {
+ display: flex;
+
+ .areaNumber,
+ .moreNumber {
+ flex: 1;
+ }
+
+ .telNumber {
+ flex: 2;
+ }
+ }
+
+ .optionBtn {
+ display: flex;
+ margin-top: 20px;
+
+ .btn {
+ padding: 12px 50px;
+ }
+ }
+ }
+
.mainTitle {
line-height: 60px;
}
+ .tools {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 20px;
+ .funs {
+ display: flex;
+
+ .funsItem {
+ line-height: 28px;
+ display: flex;
+ align-items: center;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ font-size: 12px;
+ margin-left: 10px;
+
+ .el-checkbox {
+ width: 80px;
+ padding: 0 10px;
+ }
+
+ .el-select {
+ width: 120px;
+ }
+ &::v-deep .el-input__inner {
+ border: none;
+ // background-color: #09152f;
+ }
+ &:hover {
+ border: 1px solid #4b9bb7;
+ }
+
+ &:hover .el-checkbox {
+ color: #4b9bb7;
+ }
+ }
+ }
+
+ .pagination {
+ margin-top: 50px;
+ display: flex;
+ line-height: 50px;
+ justify-content: center;
+
+ .el-pagination {
+ &::v-deep li,
+ &::v-deep .btn-prev,
+ &::v-deep .btn-next {
+ // background-color: #071f39;
+ color: #4b9bb7;
+ }
+
+ &::v-deep .active {
+ background-color: #409eff;
+ color: #fff;
+ }
+ }
+ }
+ }
.el-link {
color: #4b9bb7;
}
@@ -328,7 +791,7 @@
margin-top: 50px;
display: flex;
line-height: 50px;
- justify-content: center;
+ justify-content: right;
.el-pagination {
&::v-deep li,
@@ -351,7 +814,7 @@
.operation {
display: flex;
-
+ color: var(--operation-color);
.el-button {
border: none;
}
@@ -363,4 +826,4 @@
}
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0