add
This commit is contained in:
parent
7186893b96
commit
7d4b2d5979
@ -24,3 +24,8 @@ export function apiCustomServiceDetail(params: any) {
|
|||||||
export function apiCustomServiceDelete(params: any) {
|
export function apiCustomServiceDelete(params: any) {
|
||||||
return request.post({ url: "/custom.custom_service/delete", params });
|
return request.post({ url: "/custom.custom_service/delete", params });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 客户售后删除
|
||||||
|
export function apiCustomServiceEdit(params: any) {
|
||||||
|
return request.post({ url: "/custom.custom_service/edit", params });
|
||||||
|
}
|
||||||
|
@ -20,7 +20,15 @@ export function usePaging(options: Options) {
|
|||||||
loading: firstLoading,
|
loading: firstLoading,
|
||||||
count: 0,
|
count: 0,
|
||||||
lists: [] as any[],
|
lists: [] as any[],
|
||||||
extend: {} as Record<string, any>
|
extend: {} as Record<string, any>,
|
||||||
|
calcWidth:(value:string)=>{
|
||||||
|
let list = pager.lists.map(item => item[value])
|
||||||
|
const maxLength = list.reduce((max, str) => {
|
||||||
|
return Math.max(max, str.length);
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
return (maxLength*14+24)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// 请求分页接口
|
// 请求分页接口
|
||||||
const getLists = () => {
|
const getLists = () => {
|
||||||
|
@ -74,7 +74,8 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="指定处理人" prop="processed_user" @click="userclick"
|
<el-form-item label="指定处理人" prop="processed_user" @click="userclick"
|
||||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
<el-input v-model="formData.processed_user_name" clearable readonly placeholder="请输入指定处理人" />
|
<el-input v-model="formData.processed_user_name" clearable readonly
|
||||||
|
placeholder="请输入指定处理人" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -127,7 +128,7 @@ import type { FormInstance } from 'element-plus'
|
|||||||
import Popup from '@/components/popup/index.vue'
|
import Popup from '@/components/popup/index.vue'
|
||||||
import customDialog from '@/components/custom-dialog/index.vue'
|
import customDialog from '@/components/custom-dialog/index.vue'
|
||||||
import salescontractDialog from '@/components/salescontract/index.vue'
|
import salescontractDialog from '@/components/salescontract/index.vue'
|
||||||
import { apiCustomServiceAdd, apiCustomServiceDetail } from '@/api/custom_service'
|
import { apiCustomServiceAdd, apiCustomServiceDetail, apiCustomServiceEdit } from '@/api/custom_service'
|
||||||
import personnelselector from '@/components/personnelselector/index.vue'
|
import personnelselector from '@/components/personnelselector/index.vue'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
import peojectDialog from '@/components/project/index.vue'
|
import peojectDialog from '@/components/project/index.vue'
|
||||||
@ -240,7 +241,9 @@ const handleSubmit = async () => {
|
|||||||
await formRef.value?.validate()
|
await formRef.value?.validate()
|
||||||
const data = { ...formData, }
|
const data = { ...formData, }
|
||||||
data.date = data.date.substring(0, 10)
|
data.date = data.date.substring(0, 10)
|
||||||
await apiCustomServiceAdd(data)
|
mode.value == "edit"
|
||||||
|
? await apiCustomServiceEdit(data)
|
||||||
|
: await apiCustomServiceAdd(data)
|
||||||
popupRef.value?.close()
|
popupRef.value?.close()
|
||||||
emit('success')
|
emit('success')
|
||||||
}
|
}
|
||||||
|
@ -55,14 +55,14 @@
|
|||||||
删除
|
删除
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange" fit>
|
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column label="序号" type="index" width="55" />
|
<el-table-column label="序号" type="index" width="55" />
|
||||||
<el-table-column label="客户名称" prop="custom_name" />
|
<el-table-column label="客户名称" prop="custom_name" :width="pager.calcWidth('custom_name')" />
|
||||||
<el-table-column label="项目名称" prop="project_name" align="center" />
|
<el-table-column label="项目名称" prop="project_name" :width="pager.calcWidth('project_name')" />
|
||||||
<el-table-column label="项目编码" prop="project_code" style="width:100%" />
|
<el-table-column label="项目编码" prop="project_code" :width="pager.calcWidth('project_code')" />
|
||||||
<el-table-column label="合同编号" prop="contract_code" />
|
<el-table-column label="合同编号" prop="contract_code" :width="pager.calcWidth('contract_code')" />
|
||||||
<el-table-column label="投诉主题" prop="name" />
|
<el-table-column label="投诉主题" prop="name" :width="pager.calcWidth('name')" />
|
||||||
<el-table-column label="日期" prop="date" />
|
<el-table-column label="日期" prop="date" />
|
||||||
<el-table-column label="接待人" prop="receiver" />
|
<el-table-column label="接待人" prop="receiver" />
|
||||||
<el-table-column label="分类" prop="classification" />
|
<el-table-column label="分类" prop="classification" />
|
||||||
@ -88,7 +88,8 @@
|
|||||||
@click="handleDelete(row.id)">
|
@click="handleDelete(row.id)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-perms="['custom_service.custom_service/detail']" link @click="handledetail(row)">
|
<el-button v-perms="['custom_service.custom_service/detail']" link
|
||||||
|
@click="handledetail(row)">
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -197,31 +198,8 @@ const handledetail = async (data: any) => {
|
|||||||
detailRef.value?.setFormData(res)
|
detailRef.value?.setFormData(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
const labelHead = (h, column, index) => {
|
|
||||||
|
|
||||||
|
|
||||||
console.log(column, index)
|
|
||||||
// let l = column.label.length
|
|
||||||
// let f = 16 //每个字大小,其实是每个字的比例值,大概会比字体大小差不多大一点,
|
|
||||||
// column.minWidth = f * l //字大小乘个数即长度 ,注意不要加px像素,这里minWidth只是一个比例值,不是真正的长度
|
|
||||||
// //然后将列标题放在一个div块中,注意块的宽度一定要100%,否则表格显示不完全
|
|
||||||
// return h('div', { class: 'table-head', style: { width: '100%' } }, [column.label])
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const renderHeader = ({ column }) => {
|
|
||||||
console.log(column)
|
|
||||||
column.label = 'dgffjghdfgjhdfjgkh'
|
|
||||||
|
|
||||||
return h("div", [
|
|
||||||
h("div", column.label,),
|
|
||||||
]);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getLists()
|
getLists()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
Loading…
x
Reference in New Issue
Block a user