|
@@ -78,6 +78,27 @@
|
|
|
<div class="value">{{ detail.endTime }}</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row class="img-box" v-if="detail.imgSrc && $parent.isShow !== 5">
|
|
|
+ <el-col :span="8" class="item">
|
|
|
+ <div class="label" style="height: 150px">政策封面图</div>
|
|
|
+ <div class="value" style="height: 150px">
|
|
|
+ <el-image
|
|
|
+ style="height: 120px; widht: 120px"
|
|
|
+ :src="$imageUrl + detail.imgSrc"
|
|
|
+ fit="fill"
|
|
|
+ :preview-src-list="srcList"
|
|
|
+ ></el-image>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row v-if="$parent.isShow == 5">
|
|
|
+ <el-col :span="8" class="item">
|
|
|
+ <div class="label" style="height: 150px">政策封面图</div>
|
|
|
+ <div class="value" style="height: 150px">
|
|
|
+ <ImageUpload :fileList="fileList" :multiple="false" />
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<el-row v-if="this.$parent.isShow == 4">
|
|
|
<el-col :span="8" class="item">
|
|
|
<div class="label">审核人</div>
|
|
@@ -162,7 +183,7 @@
|
|
|
<el-table-column
|
|
|
prop="saleTypeCode"
|
|
|
label="销售类型编码"
|
|
|
- width="500"
|
|
|
+
|
|
|
align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
@@ -185,7 +206,7 @@
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
width="150"
|
|
@@ -208,18 +229,18 @@
|
|
|
>
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
</el-table>
|
|
|
<!-- 分页 -->
|
|
|
<div style="margin: 20px 0">
|
|
|
<el-pagination
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
+ @size-change="handleSizeChange2"
|
|
|
+ @current-change="handleCurrentChange2"
|
|
|
+ :current-page="dcurrentPage"
|
|
|
:page-sizes="[10, 20, 30, 50]"
|
|
|
:page-size="10"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="listTotal"
|
|
|
+ :total="dlistTotal"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
</div>
|
|
@@ -343,7 +364,7 @@
|
|
|
:page-sizes="[10, 20, 30, 50]"
|
|
|
:page-size="10"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="clistTotal"
|
|
|
+ :total="clistTotals"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
</div>
|
|
@@ -361,11 +382,12 @@
|
|
|
:data="dataL"
|
|
|
element-loading-text="Loading"
|
|
|
border
|
|
|
+ ref="multipleTable"
|
|
|
+ height="480px"
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
- stripe
|
|
|
- @select-all="handleSelectionAllChange"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
+ @select-all="handleSelectionAllChange"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
>
|
|
|
<el-table-column
|
|
|
type="selection"
|
|
@@ -402,39 +424,38 @@
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="4" class="middle_box" :offset="0">
|
|
|
-
|
|
|
- <el-col>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- @click="handleAllAdd"
|
|
|
- :disabled="type == 2 "
|
|
|
- >全部添加</el-button
|
|
|
- ></el-col
|
|
|
- >
|
|
|
- <el-col>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- @click="handleAdd"
|
|
|
- :disabled="type == 2 "
|
|
|
- >增加</el-button
|
|
|
- ></el-col
|
|
|
- >
|
|
|
- <el-col>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- :disabled="type == 1 "
|
|
|
- @click="handleDelete"
|
|
|
- >删除</el-button
|
|
|
- ></el-col
|
|
|
- >
|
|
|
- <el-col>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- :disabled="type == 1 "
|
|
|
- @click="handleAllDelete"
|
|
|
- >全部删除</el-button
|
|
|
- ></el-col
|
|
|
- >
|
|
|
+ <el-col>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ @click="handleAllAdd"
|
|
|
+ :disabled="type == 2"
|
|
|
+ >全部添加</el-button
|
|
|
+ ></el-col
|
|
|
+ >
|
|
|
+ <el-col>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ @click="handleAdd"
|
|
|
+ :disabled="type == 2"
|
|
|
+ >增加</el-button
|
|
|
+ ></el-col
|
|
|
+ >
|
|
|
+ <el-col>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ :disabled="type == 1"
|
|
|
+ @click="handleDelete"
|
|
|
+ >删除</el-button
|
|
|
+ ></el-col
|
|
|
+ >
|
|
|
+ <el-col>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ :disabled="type == 1"
|
|
|
+ @click="handleAllDelete"
|
|
|
+ >全部删除</el-button
|
|
|
+ ></el-col
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="10" :offset="0">
|
|
|
<h5>已选经销商</h5>
|
|
@@ -448,11 +469,12 @@
|
|
|
:data="custoList"
|
|
|
element-loading-text="Loading"
|
|
|
border
|
|
|
+ height="480px"
|
|
|
fit
|
|
|
highlight-current-row
|
|
|
stripe
|
|
|
- @select-all="handleSelectionAllChange2"
|
|
|
- @selection-change="handleSelectionChange2"
|
|
|
+ @select-all="handleSelectionAllChange2"
|
|
|
+ @selection-change="handleSelectionChange2"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center">
|
|
|
</el-table-column>
|
|
@@ -521,7 +543,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-button type="primary" size="default" @click="handleSave">保存</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="$parent.isShow == 5"
|
|
|
+ size="default"
|
|
|
+ @click="handleSave"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -540,9 +568,10 @@ import {
|
|
|
getCrList,
|
|
|
toExamine,
|
|
|
addPoliy,
|
|
|
- updatePolicy
|
|
|
+ updatePolicy,
|
|
|
} from "@/api/policy_list";
|
|
|
import EditCondition from "./EditCondition";
|
|
|
+import ImageUpload from "@/components/Common/image-upload.vue";
|
|
|
|
|
|
import { handleImport } from "@/utils/util";
|
|
|
|
|
@@ -553,10 +582,14 @@ export default {
|
|
|
name: "examine",
|
|
|
components: {
|
|
|
EditCondition,
|
|
|
+ ImageUpload,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
baseURL: "",
|
|
|
+ dcurrentPage:1,
|
|
|
+ dpageSize:10,
|
|
|
+ dlistTotal:0,
|
|
|
currentPages: 1, // 当前页码
|
|
|
pageSizes: 10, // 每页数量
|
|
|
clistTotal: 0,
|
|
@@ -570,6 +603,8 @@ export default {
|
|
|
options: {},
|
|
|
value: "",
|
|
|
detail: {},
|
|
|
+ srcList: [],
|
|
|
+
|
|
|
screenForm: {
|
|
|
code: "",
|
|
|
createBy: "",
|
|
@@ -593,11 +628,11 @@ export default {
|
|
|
dataL: [],
|
|
|
clistTotal: 0,
|
|
|
clistTotals: 0,
|
|
|
- type:1,
|
|
|
- fileList:[],
|
|
|
+ type: 1,
|
|
|
+ fileList: [],
|
|
|
importFileList: [],
|
|
|
- leftData:[],
|
|
|
- rightData:[]
|
|
|
+ leftData: [],
|
|
|
+ rightData: [],
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
@@ -619,12 +654,19 @@ export default {
|
|
|
this.listLoading = true;
|
|
|
getPolicyDetail({ policyId: this.$parent.id }).then((res) => {
|
|
|
this.detail = res.data;
|
|
|
-
|
|
|
+ this.srcList = [this.$imageUrl + this.detail.imgSrc];
|
|
|
+ if (this.$parent.isShow == 5 && this.detail.imgSrc) {
|
|
|
+ this.fileList = [
|
|
|
+ {
|
|
|
+ hover: "",
|
|
|
+ url: this.detail.imgSrc,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }
|
|
|
this.handletwoList();
|
|
|
// 获取条件政策
|
|
|
this.getConditionList();
|
|
|
this.getCond();
|
|
|
-
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -638,22 +680,17 @@ export default {
|
|
|
// 获取经销商列表
|
|
|
getCrList(customerParams).then((res) => {
|
|
|
for (let j = 0; j < this.custoList.length; j++) {
|
|
|
-
|
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
|
-
|
|
|
if (res.data.records[i].id == this.custoList[j].customerId) {
|
|
|
-
|
|
|
- res.data.records[i].disabled = true;
|
|
|
+ res.data.records[i].disabled = true;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
- this.dataL = res.data.records;
|
|
|
- for (let k = 0; k < this.dataL .length; k++) {
|
|
|
- this.dataL[k].customerId= this.dataL[k].id,
|
|
|
- this.dataL[k].customerName= this.dataL[k].name,
|
|
|
- this.dataL[k].customerNumber= this.dataL[k].number
|
|
|
-
|
|
|
+ this.dataL = res.data.records;
|
|
|
+ for (let k = 0; k < this.dataL.length; k++) {
|
|
|
+ (this.dataL[k].customerId = this.dataL[k].id),
|
|
|
+ (this.dataL[k].customerName = this.dataL[k].name),
|
|
|
+ (this.dataL[k].customerNumber = this.dataL[k].number);
|
|
|
}
|
|
|
|
|
|
console.log(this.dataL, "获取经销商列表");
|
|
@@ -671,6 +708,17 @@ export default {
|
|
|
this.currentPages = val;
|
|
|
this.getCond();
|
|
|
},
|
|
|
+ // 更改每页数量
|
|
|
+ handleSizeChange2(val) {
|
|
|
+ this.dpageSize = val;
|
|
|
+ this.dcurrentPage = 1;
|
|
|
+ this.handletwoList()
|
|
|
+ },
|
|
|
+ // 更改当前页
|
|
|
+ handleCurrentChange2(val) {
|
|
|
+ this.dcurrentPage = val;
|
|
|
+ this.handletwoList()
|
|
|
+ },
|
|
|
getCommonApi(row) {
|
|
|
(this.isEdit = 2), (this.cid = row.id), (this.cpolicyId = row.policyId);
|
|
|
console.log(
|
|
@@ -792,7 +840,7 @@ export default {
|
|
|
// 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
|
|
|
// 如果没有返回值则默认返回false(全部无法选中)
|
|
|
},
|
|
|
- handleSelectionAllChange(e) {
|
|
|
+ handleSelectionAllChange(e) {
|
|
|
this.leftData = e;
|
|
|
this.type = 1;
|
|
|
},
|
|
@@ -809,50 +857,78 @@ export default {
|
|
|
this.type = 2;
|
|
|
},
|
|
|
handleLeft(e) {
|
|
|
-
|
|
|
this.type = 1;
|
|
|
},
|
|
|
handleRight(e) {
|
|
|
this.type = 2;
|
|
|
},
|
|
|
handleAllAdd() {
|
|
|
- this.custoList = this.leftData
|
|
|
+ if (this.type == 1 && this.leftData.length) {
|
|
|
+ for (let i = 0; i < this.dataL.length; i++) {
|
|
|
+ for (let j = 0; j < this.leftData.length; j++) {
|
|
|
+ if (this.dataL[i].id == this.leftData[j].id) {
|
|
|
+ this.dataL[i].disabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.custoList = [...this.custoList, ...this.leftData];
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
|
+ } else {
|
|
|
+ this.$errorMsg("请选择要添加的经销商");
|
|
|
+ }
|
|
|
},
|
|
|
handleAllDelete() {
|
|
|
- this.custoList = []
|
|
|
+ if (this.type == 2 && this.rightData.length) {
|
|
|
+ for (let i = 0; i < this.dataL.length; i++) {
|
|
|
+ for (let j = 0; j < this.rightData.length; j++) {
|
|
|
+ if (this.dataL[i].id == this.rightData[j].customerId) {
|
|
|
+ this.$set(this.dataL[i], "disabled", false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const arr = this.resArr(this.custoList, this.rightData);
|
|
|
+ this.custoList = arr;
|
|
|
+ } else {
|
|
|
+ this.$errorMsg("请选择要删除的经销商");
|
|
|
+ }
|
|
|
},
|
|
|
handleAdd() {
|
|
|
if (this.type == 1 && this.leftData.length) {
|
|
|
- this.custoList = [...this.custoList,...this.leftData]
|
|
|
- }else{
|
|
|
- this.$errorMsg('请选择要添加的经销商')
|
|
|
+ for (let i = 0; i < this.dataL.length; i++) {
|
|
|
+ for (let j = 0; j < this.leftData.length; j++) {
|
|
|
+ if (this.dataL[i].id == this.leftData[j].id) {
|
|
|
+ this.dataL[i].disabled = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.custoList = [...this.custoList, ...this.leftData];
|
|
|
+ this.leftData = [];
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
|
+ } else {
|
|
|
+ this.$errorMsg("请选择要添加的经销商");
|
|
|
}
|
|
|
},
|
|
|
handleDelete() {
|
|
|
if (this.type == 2 && this.rightData.length) {
|
|
|
for (let i = 0; i < this.dataL.length; i++) {
|
|
|
-
|
|
|
- for (let j = 0; j < this.rightData.length; j++) {
|
|
|
-
|
|
|
- if (this.dataL[i].id == this.rightData[j].customerId) {
|
|
|
- this.dataL[i].disabled = false;
|
|
|
-
|
|
|
- }
|
|
|
+ for (let j = 0; j < this.rightData.length; j++) {
|
|
|
+ if (this.dataL[i].id == this.rightData[j].customerId) {
|
|
|
+ this.$set(this.dataL[i], "disabled", false);
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
- const arr = this.resArr(this.custoList,this.rightData ,true)
|
|
|
- this.custoList = arr
|
|
|
- }else{
|
|
|
- this.$errorMsg('请选择要删除的经销商')
|
|
|
+ const arr = this.resArr(this.custoList, this.rightData);
|
|
|
+ this.custoList = arr;
|
|
|
+ } else {
|
|
|
+ this.$errorMsg("请选择要删除的经销商");
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
//去掉相同数据
|
|
|
resArr(arr1, arr2) {
|
|
|
return arr1.filter((v) => arr2.every((val) => val.id != v.id));
|
|
|
},
|
|
|
- async handleSave(){
|
|
|
- if (this.custoList.length) {
|
|
|
+ async handleSave() {
|
|
|
+ if (this.custoList.length) {
|
|
|
var arr = [];
|
|
|
this.custoList.forEach((el) => {
|
|
|
arr.push({
|
|
@@ -868,32 +944,18 @@ export default {
|
|
|
});
|
|
|
|
|
|
const params = {
|
|
|
- adminCompanyId: "",
|
|
|
- code: "",
|
|
|
- customerCount: 0,
|
|
|
- examineBy: "",
|
|
|
- examineRemark: "",
|
|
|
- examineStatus: "",
|
|
|
- id: "",
|
|
|
- imgSrc: this.fileList.length ? this.fileList[0].url : "",
|
|
|
- policyCustomers: arr,
|
|
|
- remark: "",
|
|
|
- status: true,
|
|
|
- title: "",
|
|
|
- type: "",
|
|
|
...this.detail,
|
|
|
+ policyCustomers: arr,
|
|
|
+ imgSrc: this.fileList.length ? this.fileList[0].url : "",
|
|
|
};
|
|
|
- await updatePolicy(params)
|
|
|
- await this.getCond();
|
|
|
- this.$successMsg("编辑成功");
|
|
|
- this.fileList = [];
|
|
|
- this.$parent.isShow = 1;
|
|
|
-
|
|
|
+ await updatePolicy(params);
|
|
|
+ await this.getCond();
|
|
|
+ this.$successMsg("编辑成功");
|
|
|
+ this.fileList = [];
|
|
|
+ this.$parent.isShow = 1;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -940,4 +1002,9 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+.img-box {
|
|
|
+ height: 150px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
</style>
|