Commit e469cd81 by 前端

Merge branch 'SAAS+V4.41' into 'master'

上线合并

See merge request !70
2 parents 474d3760 cd7da09f
......@@ -125,6 +125,27 @@ const exportProdContractApi = params => {
})
}
//查询产品分类
const getProdCategoryListApi = params => {
params.method = `scrm.api.equity.service.base.package.category.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 编辑或者新增分类
const addCategoryApi = params => {
params.method = `scrm.api.equity.service.base.package.update.category`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getContractListApi,
getBaseContractListApi,
......@@ -137,5 +158,7 @@ export default {
babchInitTemplateApi,
exportContractApi,
getProdContractListApi,
exportProdContractApi
exportProdContractApi,
getProdCategoryListApi,
addCategoryApi
}
......@@ -20,11 +20,13 @@
<el-button type="text" v-if="scope.scope.packageType == 1" @click="editContract(row.scope)">编辑</el-button>
<el-button type="text" v-if="scope.scope.packageType == 1" @click="changeTmpl(row.scope)">更换模板</el-button>
<el-button type="text" v-if="scope.scope.packageType == 1" @click="initTmpl(row.scope)">初始化模板</el-button>
<el-button type="text" @click="editCategoryFn(row.scope, 1)">编辑分类</el-button>
</span>
</GLTable>
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="viewProdDetail(scope.scope)">产品详情</el-button>
<!-- <el-button type="text" @click="editCategoryFn(scope.scope, 0)">编辑分类</el-button> -->
</span>
</GLTable>
</div>
......@@ -65,6 +67,10 @@
<p class="content">选中的商品合同模板将初始化,读取后台的最新配置</p>
</div>
</GLDialog>
<GLDialog class="cate-wrap" :visible.sync="categoryObj.visible" :close-on-click-modal="false" mode="mid" title="编辑分类" @onOk="commitCategoryFn" @onCancel="closeCategoryDialog" :before-close="closeCategoryDialog">
<label class="label" for="">产品分类:</label>
<el-autocomplete :maxlength="20" :popper-append-to-body="false" value-key="key" popper-class="my-autocomplete" v-model.trim="categoryObj.categoryName" :fetch-suggestions="querySearch" placeholder="请输入或选择内容"></el-autocomplete>
</GLDialog>
</div>
</template>
......@@ -212,24 +218,34 @@ export default {
},
{
label: 'ID',
prop: 'spuId'
prop: 'spuId',
width: 220
},
{
label: '产品名称',
prop: 'spuName'
prop: 'spuName',
width: 220
},
{
label: '产品合同编号',
prop: 'packageName',
formatter: cell => '--'
formatter: cell => '--',
width: 200
},
{
label: '产品类别',
prop: 'spuCategory',
width: 220
},
{
label: '服务项目',
prop: 'packageName'
prop: 'packageName',
width: 200
},
{
label: '创建时间',
prop: 'createdDate',
width: 220,
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
......@@ -237,6 +253,7 @@ export default {
{
label: '更新时间',
prop: 'updatedDate',
width: 220,
formatter: cellValue => {
return cellValue.updatedDate ? dayjs(cellValue.updatedDate).format('YYYY-MM-DD HH:mm:ss') : '--'
}
......@@ -264,19 +281,28 @@ export default {
},
{
label: 'ID',
prop: 'skuId'
prop: 'skuId',
width: 220
},
{
label: '产品名称',
prop: 'skuName'
prop: 'skuName',
width: 220
},
{
label: '产品合同编号',
prop: 'contractId'
prop: 'contractId',
width: 200
},
{
label: '产品类别',
prop: 'skuCategory',
width: 220
},
{
label: '服务项目',
addHtml: 'serviceItemSlot'
addHtml: 'serviceItemSlot',
width: 200
},
{
label: '创建时间',
......@@ -310,13 +336,80 @@ export default {
tipObj: {
visible: false,
ids: []
}
},
categoryObj: {
categoryName: '',
basePackageType: 0,
baseId: '',
visible: false
},
// categoryList: [{ key: 'nihao' }, { key: '你好呀' }]
categoryList: []
}
},
mounted() {},
mounted() {
this.getProdCategoryList()
},
methods: {
querySearch(queryString, cb) {
var restaurants = this.categoryList
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
// 调用 callback 返回建议列表的数据
cb(results)
},
createFilter(queryString) {
return restaurant => {
return restaurant.key.toLowerCase().indexOf(queryString.toLowerCase()) > -1
}
},
getProdCategoryList() {
this.$apis.contractManager.getProdCategoryListApi({}).then(res => {
if (res?.length) {
this.categoryList = res.map(item => ({ key: item }))
}
})
},
editCategoryFn(row, basePackageType) {
this.categoryObj = {
categoryName: (basePackageType == 1 ? row.skuCategory : row.spuCategory) || '',
basePackageType,
baseId: basePackageType == 1 ? row.skuId : row.spuId,
visible: true
}
},
commitCategoryFn() {
const { basePackageType, categoryName, baseId } = this.categoryObj
if (!categoryName) {
return this.$message({
message: '请输入或选择产品类别',
type: 'error',
customClass: 'msgHierarchy'
})
}
const params = {
basePackageType,
categoryName,
baseId
}
this.$apis.contractManager.addCategoryApi(params).then(res => {
if (res) {
this.$message.success('编辑成功')
this.closeCategoryDialog()
this.handleSearch()
this.getProdCategoryList()
}
})
},
closeCategoryDialog() {
this.categoryObj = {
categoryName: '',
basePackageType: 0,
baseId: '',
visible: false
}
},
viewProdDetail(row) {
this.detailData = JSON.parse(JSON.stringify(row))
this.detailData.skuPackageList.forEach(ele => {
......@@ -468,6 +561,17 @@ export default {
</script>
<style lang="scss" scoped>
.cate-wrap {
.label {
display: inline-block;
width: 154px;
text-align: right;
}
/deep/ .my-autocomplete,
/deep/ .el-input__inner {
width: 432px !important;
}
}
/deep/ .el-table__expanded-cell {
padding: 0;
.el-table__header-wrapper {
......
......@@ -164,10 +164,10 @@ const statusList = [
// confId: 10,
// confName: '主管审核不通过'
// },
// {
// confId: 11,
// confName: '待客户签字授权'
// },
{
confId: 11,
confName: '待客户签字授权'
},
{
confId: 12,
confName: '待核赔'
......@@ -450,7 +450,7 @@ export default {
type: 'input',
isClear: true,
maxlength: 200,
placeholder: '客户|合同号|报案号'
placeholder: '客户|合同号|报案号 | 车架号'
},
{
label: '服务状态',
......@@ -566,6 +566,12 @@ export default {
}
},
{
label: '车架号',
prop: 'vin',
width: 250,
line: 1
},
{
label: '合同号',
prop: 'contractNo',
width: 200,
......
......@@ -189,7 +189,7 @@ export default {
{
name: 'searchText',
type: 'input',
placeholder: '请输入客户名|核销码|合同号|报案号',
placeholder: '请输入客户名|核销码|合同号|报案号 | 车架号',
isClear: true,
maxlength: 200
// isHide: true
......@@ -241,6 +241,12 @@ export default {
}
},
{
label: '车架号',
prop: 'vin',
width: 250,
line: 1
},
{
label: '合同号',
prop: 'contractNo',
width: 200,
......@@ -434,7 +440,7 @@ export default {
diffHost() {
let href = window.location.host
this.showGh = href.indexOf('cgacar') != -1
if (!this.showGh) this.searchFormData[0].placeholder = '请输入客户名 | 合同号 | 报案号'
if (!this.showGh) this.searchFormData[0].placeholder = '请输入客户名 | 合同号 | 报案号 | 车架号'
},
batchAudit() {
const data = this.$refs.equityRef?.mutiSelectArr?.[this.tableParams.mutiSelectName] || []
......
......@@ -435,27 +435,42 @@ export default {
const params = {
serviceCode: this.routeInfo.serviceCode,
serviceName: this.routeInfo.serviceName,
gradeList: _gradeList,
gradeList: '',
monthlyInsuranceCost: NP.times(this.gradeFormObj.monthlyInsuranceCost || 0, 100)
}
this.$apis.serviceConfig.addGradeApi(params).then(res => {
console.log(res)
if (res) {
this.$message.success('提交成功')
this.jumpListPage()
}
this.splitParam(_gradeList, params)
// this.$apis.serviceConfig.addGradeApi(params).then(res => {
// console.log(res)
// if (res) {
// this.$message.success('提交成功')
// this.jumpListPage()
// }
// })
},
splitParam(list, params) {
let promiseList = []
for (let i = 0; i < list.length; i = i + 5) {
let _gradeList = list.slice(i, i + 5)
let _params = params
_params.gradeList = _gradeList
promiseList.push(
new Promise((resolve, reject) => {
this.$apis.serviceConfig
.addGradeApi(_params)
.then(res => {
resolve(res)
})
.catch(err => {
reject(err)
})
})
)
}
Promise.all(promiseList).then(res => {
this.$message.success('提交成功')
this.jumpListPage()
})
},
// commit() {
// const params = this.getParams()
// this.$apis.serviceConfig.addGradeApi(params).then(res => {
// console.log(res)
// if(res){
// this.$message.success('提交成功')
// this.jumpListPage()
// }
// })
// },
handleAddGrade() {
const _gradeList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
if (this.gradeList.length == _gradeList.length) return this.$message.error(`最多添加${_gradeList.length}个规格`)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!