From cad33708aed681427ff94040fca026c670b070c7 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 24 十月 2023 20:05:55 +0800
Subject: [PATCH] 客户服务单 严重程度保存不成功的问题处理
---
src/views/service/serviceContract/index.vue | 157 ++++++++++++++++++++++++++++++++++------------------
1 files changed, 102 insertions(+), 55 deletions(-)
diff --git a/src/views/service/serviceContract/index.vue b/src/views/service/serviceContract/index.vue
index 1cdb09c..d56d3d6 100644
--- a/src/views/service/serviceContract/index.vue
+++ b/src/views/service/serviceContract/index.vue
@@ -14,8 +14,8 @@
@searchClick="onFilterSearch"
>
<template slot="leftButton">
- <el-button size="small" type="primary" @click="addBtnClick">鏂板缓</el-button>
- <el-button size="small" @click="delClick">鍒犻櫎</el-button>
+ <el-button size="small" type="primary" @click="addBtnClick">鏂板缓</el-button>
+ <!-- <el-button size="small" @click="delClick">鍒犻櫎</el-button> -->
</template>
</CommonSearch>
</div>
@@ -25,27 +25,26 @@
<div class="body-card">
<div class="list-view">
<TableCommonView
- ref="tableListRef"
- :table-list="tableList"
- :select-box="!isDetail"
- @selClientClick="selClientClick"
- @selCommonClick="selCommonClick"
- @getSelectArray="getSelectArray"
- @selTableCol="selTableCol"
+ ref="tableListRef"
+ :table-list="tableList"
+ @selClientClick="selClientClick"
+ @selCommonClick="selCommonClick"
+ @getSelectArray="getSelectArray"
+ @selTableCol="selTableCol"
>
<template slot="tableButton">
- <el-table-column label="鎿嶄綔" width="60">
+ <el-table-column label="鎿嶄綔" width="100">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">缂栬緫</el-button>
- <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> -->
+ <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button>
</template>
</el-table-column>
</template>
</TableCommonView>
</div>
- <div class="btn-pager">
- <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
- </div>
+ <div class="btn-pager">
+ <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
+ </div>
</div>
</div>
<!-- 鏂板缓/缂栬緫 -->
@@ -142,7 +141,18 @@
{ label: "鏈嶅姟鍒版湡鏃�", prop: "endTime" }, // 鏈嶅姟鍒版湡鏃�
{ label: "浠风◣鍚堣", prop: "amountTotal" } // 浠风◣鍚堣
],
- showCol:["鏈嶅姟鍚堝悓缂栧彿", "瀹㈡埛鍚嶇О", "绛剧害鏃ユ湡", "鍚堝悓绫诲瀷", "鍚堝悓鐘舵��", "璐熻矗浜�", "浜у搧鍚嶇О", "鏈嶅姟寮�濮嬫棩", "鏈嶅姟鍒版湡鏃�", "浠风◣鍚堣"]
+ showCol: [
+ "鏈嶅姟鍚堝悓缂栧彿",
+ "瀹㈡埛鍚嶇О",
+ "绛剧害鏃ユ湡",
+ "鍚堝悓绫诲瀷",
+ "鍚堝悓鐘舵��",
+ "璐熻矗浜�",
+ "浜у搧鍚嶇О",
+ "鏈嶅姟寮�濮嬫棩",
+ "鏈嶅姟鍒版湡鏃�",
+ "浠风◣鍚堣"
+ ]
}
},
created() {
@@ -159,12 +169,13 @@
methods: {
setTable() {
this.tableList = {
+ selectIndex: true,
tableInfomation: [],
allcol: [],
showcol: this.showCol,
- tableColumn:this.setColumnVisible(this.showCol)
+ tableColumn: this.setColumnVisible(this.showCol)
}
- this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label);
+ this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
this.searchOptions = []
for (let i = 0; i < this.tableList.tableColumn.length; i++) {
const label = this.tableList.tableColumn[i].label
@@ -172,27 +183,51 @@
this.searchOptions.push({ value: value, label: label })
}
},
- setColumnVisible(showCol){
- return this.tableColumn.map(ele=>{
+ setColumnVisible(showCol) {
+ return this.tableColumn.map((ele) => {
return {
...ele,
- isShowColumn:showCol.includes(ele.label)
+ isShowColumn: showCol.includes(ele.label)
}
})
},
selTableCol(val) {
- this.showcol = val;
- this.tableList.tableColumn = this.setColumnVisible(val);
+ this.showcol = val
+ this.tableList.tableColumn = this.setColumnVisible(val)
},
// 璇锋眰鏁版嵁
async getData() {
this.loading = true
- await getServiceContractList({
- keyword: this.keyword,
- keywordType: this.keywordType,
- page: this.pagerOptions.currPage,
- pageSize: this.pagerOptions.pageSize
- })
+ let params = {}
+ console.log(this.addConfig)
+ if (this.addConfig.id && this.addConfig.keywordType === "閿�鍞満浼�") {
+ params = {
+ saleChanceId: this.addConfig.id,
+ page: this.pagerOptions.currPage,
+ pageSize: this.pagerOptions.pageSize
+ }
+ } else if (this.addConfig.id && this.addConfig.keywordType === "閿�鍞槑缁嗗崟") {
+ params = {
+ salesDetailsId: this.addConfig.id,
+ page: this.pagerOptions.currPage,
+ pageSize: this.pagerOptions.pageSize
+ }
+ } else if (this.addConfig.id && this.addConfig.keywordType === "鎶ヤ环鍗�") {
+ params = {
+ quotationId: this.addConfig.id,
+ page: this.pagerOptions.currPage,
+ pageSize: this.pagerOptions.pageSize
+ }
+ } else {
+ params = {
+ keyword: this.keyword,
+ keywordType: this.keywordType,
+ page: this.pagerOptions.currPage,
+ pageSize: this.pagerOptions.pageSize,
+ contactId: this.addConfig.client_id
+ }
+ }
+ await getServiceContractList(params)
.then((res) => {
console.log(res)
if (res.code === 200) {
@@ -223,7 +258,7 @@
})
},
// 鎼滅储
- onFilterSearch(searchText){
+ onFilterSearch(searchText) {
this.keyword = searchText ?? ""
this.keywordType = "鏈嶅姟鍚堝悓缂栧彿"
this.pagerOptions.currPage = 1
@@ -233,7 +268,15 @@
addBtnClick() {
this.editConfig.visible = true
this.editConfig.title = "鏂板缓"
- this.editConfig.infomation = { ...this.addConfig, currency: "浜烘皯甯�" }
+ this.editConfig.infomation = {
+ ...this.addConfig,
+ currency: "浜烘皯甯�",
+ client_name: Object.keys(this.addConfig).length === 0 ? "" : this.addConfig.client_name,
+ contact_name: "",
+ sale_chance_name: Object.keys(this.addConfig).length === 0 ? "" : this.addConfig.sale_chance_name,
+ contract_number: "",
+ quotation_number: ""
+ }
},
// 缂栬緫
handleClick(row) {
@@ -244,31 +287,35 @@
...row,
contract_number: row.salesDetails.number,
quotation_number: row.quotation.number,
- currency: "浜烘皯甯�"
+ currency: "浜烘皯甯�",
+ sale_chance_name: row.SaleChance.name,
+ contact_name: row.contact.name,
+ serviceContractTypeId: row.serviceContractTypeId === 0 ? null : row.serviceContractTypeId,
+ serviceContractStatusId: row.serviceContractStatusId === 0 ? null : row.serviceContractStatusId
}
},
// 鍒犻櫎
- delClick() {
- if (this.selValueList && this.selValueList.length > 0) {
- this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning"
- })
- .then(() => {
- getDelServiceContract({ ids: this.selValueList }).then((response) => {
- if (response.code === 200) {
- this.$message.success("鍒犻櫎鎴愬姛")
- this.getData()
- } else {
- this.$message.warning("鍒犻櫎澶辫触")
- }
- })
+ delClick(id) {
+ // if (this.selValueList && this.selValueList.length > 0) {
+ this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ })
+ .then(() => {
+ getDelServiceContract({ ids: [id] }).then((response) => {
+ if (response.code === 200) {
+ this.$message.success("鍒犻櫎鎴愬姛")
+ this.getData()
+ } else {
+ this.$message.warning("鍒犻櫎澶辫触")
+ }
})
- .catch(() => {})
- } else {
- this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
- }
+ })
+ .catch(() => {})
+ // } else {
+ // this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�")
+ // }
},
getSelectArray(val) {
console.log(val)
@@ -302,15 +349,15 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
-.service-contract{
+.service-contract {
height: 100%;
overflow: hidden;
- .filter{
+ .filter {
height: 80px;
display: flex;
align-items: center;
padding: 12px 20px 0 20px;
- &-card{
+ &-card {
height: 80px;
display: flex;
align-items: center;
@@ -321,7 +368,7 @@
background-color: #fff;
}
}
- .body{
+ .body {
box-sizing: border-box;
padding: 10px 20px;
border-radius: 12px;
--
Gitblit v1.8.0