Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
12916957f6 | ||
|
c2fbaeb2fa | ||
|
cfa1e585bc | ||
|
b49c27c10f | ||
|
8dc907e992 | ||
|
9a74a8414f | ||
|
4bb2c20bd9 | ||
|
a0a9eaff45 | ||
|
ac6c36894c | ||
|
a79c5c6dc6 | ||
|
2222a406f5 | ||
|
1870f2f898 | ||
|
b8636a1728 |
@ -19,3 +19,12 @@ export function updateIsShow(params){
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 给配件申请表子表添加数据
|
||||||
|
export function addTwi(data){
|
||||||
|
return request({
|
||||||
|
url: preUrl + '/addTwi',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -175,3 +175,20 @@ export function removeTicketById(id){
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 验证是否有项目或配件的价格为空或0
|
||||||
|
export function hasPrice(id){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/hasPrice?id=" + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 服务顾问交车
|
||||||
|
export function overOrder(data){
|
||||||
|
return request({
|
||||||
|
url: preUrl + '/overOrder',
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -1,16 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<el-cascader
|
<el-select v-model="selectedValues" filterable :filter-method="getData" placeholder="车辆品牌">
|
||||||
placeholder="车辆品牌型号"
|
<el-option v-for="item in options" :key="item.id" :value="item.id" :label="item.brandName"/>
|
||||||
:options="options"
|
</el-select>
|
||||||
v-model="selectedValues"
|
<!-- <el-cascader-->
|
||||||
filterable
|
<!-- placeholder="车辆品牌型号"-->
|
||||||
/>
|
<!-- :options="options"-->
|
||||||
|
<!-- v-model="selectedValues"-->
|
||||||
|
<!-- filterable-->
|
||||||
|
<!-- />-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as CarBrandSelectorApi from '@/layout/components/CarBrandSelector/Api';
|
import * as CarBrandSelectorApi from '@/layout/components/CarBrandSelector/Api';
|
||||||
|
import {getCarBrandPage, getCarBrand} from '@/api/base/carbrand'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CarBrandSelector',
|
name: 'CarBrandSelector',
|
||||||
@ -18,8 +22,8 @@
|
|||||||
props: {
|
props: {
|
||||||
//v-model绑定的值
|
//v-model绑定的值
|
||||||
value: {
|
value: {
|
||||||
type: Array,
|
type: [Array, String],
|
||||||
default: () => [],
|
// default: () => [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -35,8 +39,13 @@
|
|||||||
value: {
|
value: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
|
if (newVal instanceof Array) {
|
||||||
|
this.selectedValues = newVal[0]
|
||||||
|
} else {
|
||||||
this.selectedValues = newVal;
|
this.selectedValues = newVal;
|
||||||
}
|
}
|
||||||
|
this.getData(this.selectedValues)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
selectedValues(newVal) {
|
selectedValues(newVal) {
|
||||||
this.$emit('input', newVal);
|
this.$emit('input', newVal);
|
||||||
@ -47,15 +56,31 @@
|
|||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 得到车辆品牌的分页
|
||||||
getData(keyword) {
|
getData(keyword) {
|
||||||
// this.reset()
|
const query = {
|
||||||
let param = {
|
brandName: keyword
|
||||||
modelName: keyword,
|
|
||||||
}
|
}
|
||||||
CarBrandSelectorApi.searchBrand(param).then(res => {
|
getCarBrandPage(query).then(res => {
|
||||||
this.options = res.data
|
this.options = res.data.records
|
||||||
});
|
})
|
||||||
|
// 需要的数据可能不在该页,比如修改回显的时候,那此时传入的id,那就通过ID去查了添加到options
|
||||||
|
const data = this.options.filter(item => item.id === this.selectedValues)
|
||||||
|
if (!data || data.length === 0) {
|
||||||
|
getCarBrand(this.selectedValues).then(res => {
|
||||||
|
if (res.data) {
|
||||||
|
this.options.push(res.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// // this.reset()
|
||||||
|
// let param = {
|
||||||
|
// modelName: keyword,
|
||||||
|
// }
|
||||||
|
// CarBrandSelectorApi.searchBrand(param).then(res => {
|
||||||
|
// // console.log(res.data)
|
||||||
|
// this.options = res.data
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -27,10 +27,15 @@
|
|||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="品牌型号" prop="brandAndModel">
|
<el-form-item label="车辆品牌" prop="brandAndModel">
|
||||||
<CarBrandSelector v-model="formData.brandAndModel" ref="brandForm"/>
|
<CarBrandSelector v-model="formData.brandAndModel" ref="brandForm"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="车辆型号" prop="carModel">
|
||||||
|
<el-input v-model="formData.carModel" placeholder="车辆型号"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="车辆类别" prop="carCategory">
|
<el-form-item label="车辆类别" prop="carCategory">
|
||||||
<el-select v-model="formData.carCategory" placeholder="请选择车辆类别">
|
<el-select v-model="formData.carCategory" placeholder="请选择车辆类别">
|
||||||
@ -39,6 +44,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="车辆性质" prop="carNature">
|
<el-form-item label="车辆性质" prop="carNature">
|
||||||
<el-select v-model="formData.carNature" placeholder="请选择车辆性质">
|
<el-select v-model="formData.carNature" placeholder="请选择车辆性质">
|
||||||
@ -47,8 +54,6 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="注册日期" prop="carRegisterDate" label-width="auto">
|
<el-form-item label="注册日期" prop="carRegisterDate" label-width="auto">
|
||||||
<el-date-picker clearable v-model="formData.carRegisterDate" type="date" value-format="timestamp"
|
<el-date-picker clearable v-model="formData.carRegisterDate" type="date" value-format="timestamp"
|
||||||
@ -108,7 +113,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="16">
|
<el-col :span="16">
|
||||||
<el-button :loading="buttonLoading" icon="el-icon-date" @click="compute" size="small" type="primary">计算</el-button>
|
<el-button :loading="buttonLoading" icon="el-icon-date" @click="compute" size="small" type="primary">
|
||||||
|
计算
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
@ -198,6 +205,7 @@ export default {
|
|||||||
nextInspectionDate: undefined,
|
nextInspectionDate: undefined,
|
||||||
nextMaintenanceDate: undefined,
|
nextMaintenanceDate: undefined,
|
||||||
nextMaintenanceMileage: undefined,
|
nextMaintenanceMileage: undefined,
|
||||||
|
carModel: undefined
|
||||||
},
|
},
|
||||||
buttonLoading: false,
|
buttonLoading: false,
|
||||||
// 表单校验
|
// 表单校验
|
||||||
@ -209,6 +217,7 @@ export default {
|
|||||||
carNature: [{required: true, message: '车辆性质不能为空', trigger: 'blur'}],
|
carNature: [{required: true, message: '车辆性质不能为空', trigger: 'blur'}],
|
||||||
carRegisterDate: [{required: true, message: '车辆注册日期不能为空', trigger: 'blur'}],
|
carRegisterDate: [{required: true, message: '车辆注册日期不能为空', trigger: 'blur'}],
|
||||||
brandAndModel: [{required: true, message: '品牌型号不能为空', trigger: 'blur'}],
|
brandAndModel: [{required: true, message: '品牌型号不能为空', trigger: 'blur'}],
|
||||||
|
carModel: [{required: true, message: '车辆型号不能为空', trigger: 'blur'}]
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -217,8 +226,11 @@ export default {
|
|||||||
async compute() {
|
async compute() {
|
||||||
this.buttonLoading = true
|
this.buttonLoading = true
|
||||||
try {
|
try {
|
||||||
|
const brand = this.formData.brandAndModel
|
||||||
|
if (typeof brand === 'string'){
|
||||||
|
this.formData.brandAndModel = [brand, this.formData?.carModel]
|
||||||
|
}
|
||||||
const data = this.formData;
|
const data = this.formData;
|
||||||
console.log(data,'adadadad')
|
|
||||||
debugger
|
debugger
|
||||||
const res = await CarMainApi.compute(data);
|
const res = await CarMainApi.compute(data);
|
||||||
const result = res.data;
|
const result = res.data;
|
||||||
@ -253,6 +265,10 @@ export default {
|
|||||||
async submitForm() {
|
async submitForm() {
|
||||||
// 校验主表
|
// 校验主表
|
||||||
// await this.$refs["formRef"].validate();
|
// await this.$refs["formRef"].validate();
|
||||||
|
const brand = this.formData.brandAndModel
|
||||||
|
if (typeof brand === 'string'){
|
||||||
|
this.formData.brandAndModel = [brand, this.formData?.carModel]
|
||||||
|
}
|
||||||
this.formLoading = true;
|
this.formLoading = true;
|
||||||
try {
|
try {
|
||||||
const data = this.formData;
|
const data = this.formData;
|
||||||
@ -290,6 +306,7 @@ export default {
|
|||||||
carNature: undefined,
|
carNature: undefined,
|
||||||
carRegisterDate: undefined,
|
carRegisterDate: undefined,
|
||||||
carLicenseImg: undefined,
|
carLicenseImg: undefined,
|
||||||
|
carModel: undefined
|
||||||
};
|
};
|
||||||
this.resetForm("formRef");
|
this.resetForm("formRef");
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
<el-table-column label="发动机号码" align="center" prop="engineNumber" width="180" />
|
<el-table-column label="发动机号码" align="center" prop="engineNumber" width="180" />
|
||||||
<el-table-column label="车架号" align="center" prop="vin" width="180" />
|
<el-table-column label="车架号" align="center" prop="vin" width="180" />
|
||||||
<el-table-column label="车辆品牌" align="center" prop="brandStr" />
|
<el-table-column label="车辆品牌" align="center" prop="brandStr" />
|
||||||
<el-table-column label="车辆型号" align="center" prop="modelStr" />
|
<el-table-column label="车辆型号" align="center" prop="carModel" />
|
||||||
<el-table-column label="车辆类别" align="center" prop="carCategory">
|
<el-table-column label="车辆类别" align="center" prop="carCategory">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<dict-tag :type="DICT_TYPE.DICT_CAR_CATEGORY" :value="scope.row.carCategory" />
|
<dict-tag :type="DICT_TYPE.DICT_CAR_CATEGORY" :value="scope.row.carCategory" />
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="统一社会信用代码" prop="orgCard">
|
<el-form-item label="企业简称" prop="simpleName">
|
||||||
<el-input v-model="formData.orgCard" placeholder="请输入统一社会信用代码" maxlength="18"/>
|
<el-input v-model="formData.simpleName" placeholder="请输入企业简称" maxlength="255" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -79,7 +79,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="开放服务" prop="serviceCodeArray">
|
<el-form-item label="统一社会信用代码" prop="orgCard">
|
||||||
|
<el-input v-model="formData.orgCard" placeholder="请输入统一社会信用代码" maxlength="18"/>
|
||||||
|
</el-form-item> <el-form-item label="开放服务" prop="serviceCodeArray">
|
||||||
<el-select style="width: 100%" v-model="formData.serviceCodeArray" multiple placeholder="请选择开放服务" clearable >
|
<el-select style="width: 100%" v-model="formData.serviceCodeArray" multiple placeholder="请选择开放服务" clearable >
|
||||||
<el-option v-for="item in packageList" :key="item.id" :label="item.name" :value="item.id"/>
|
<el-option v-for="item in packageList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -143,6 +145,7 @@ export default {
|
|||||||
serviceCodes:undefined,
|
serviceCodes:undefined,
|
||||||
bankAccount: null,
|
bankAccount: null,
|
||||||
account: null,
|
account: null,
|
||||||
|
simpleName: null,
|
||||||
},
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
formRules: {
|
formRules: {
|
||||||
@ -249,6 +252,7 @@ export default {
|
|||||||
serviceCodes:undefined,
|
serviceCodes:undefined,
|
||||||
bankAccount: null,
|
bankAccount: null,
|
||||||
account: null,
|
account: null,
|
||||||
|
simpleName: null
|
||||||
}
|
}
|
||||||
this.resetForm('formRef')
|
this.resetForm('formRef')
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="企业名称" align="left" prop="corpName" width="180"/>
|
<el-table-column label="企业名称" align="left" prop="corpName" width="180"/>
|
||||||
|
<el-table-column label="企业简称" align="left" prop="simpleName" width="180" />
|
||||||
<el-table-column label="统一社会信用代码" align="left" prop="orgCard" width="180"/>
|
<el-table-column label="统一社会信用代码" align="left" prop="orgCard" width="180"/>
|
||||||
<el-table-column label="注册资本(万元)" align="right" prop="registFund" width="180"/>
|
<el-table-column label="注册资本(万元)" align="right" prop="registFund" width="180"/>
|
||||||
<el-table-column label="注册日期" align="center" prop="registDate" width="180"/>
|
<el-table-column label="注册日期" align="center" prop="registDate" width="180"/>
|
||||||
|
@ -28,7 +28,11 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
carSelected(val) {
|
carSelected(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
const car = this.carList.find(item => item.id === val);
|
let car = this.carList.find(item => item.id === val);
|
||||||
|
car = {
|
||||||
|
...car,
|
||||||
|
modelStr: car?.brandStr + " " + car?.carModel
|
||||||
|
}
|
||||||
this.$emit('input', car);
|
this.$emit('input', car);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -21,17 +21,24 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单据号" align="center" prop="no" width="200"/>
|
<el-table-column label="单据号" align="center" prop="no" width="200"/>
|
||||||
<el-table-column label="客户车牌" align="center" prop="licenseNumber"/>
|
<el-table-column label="客户信息" align="center">
|
||||||
<el-table-column label="服务顾问" align="center" prop="adviserName"/>
|
<el-table-column label="姓名" align="center" prop="userName" width="180"/>
|
||||||
<el-table-column label="申请人" align="center" prop="repairName"/>
|
<el-table-column label="联系电话" align="center" prop="userMobile" width="180"/>
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="车牌号" align="center" prop="licenseNumber" width="180"/>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="申请人" align="center" prop="repairName" width="180"/>
|
||||||
|
<el-table-column label="岗位" align="center" prop="repairWork" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :type="DICT_TYPE.TICKET_WARES_STATUS" v-model="scope.row.status"/>
|
<dict-tag :type="DICT_TYPE.REPAIR_WORK_TYPE" :value="scope.row.repairWork" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark"/>
|
<el-table-column label="服务顾问" align="center" prop="adviserName" width="180"/>
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column label="备注" align="center" prop="remark" width="180" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column label="操作" align="center" fixed="right" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="mini" icon="el-icon-view" @click="handleView(scope.row)">
|
||||||
|
查看
|
||||||
|
</el-button>
|
||||||
<el-button type="text" size="mini" @click="handleDispose(scope.row)" icon="el-icon-edit">
|
<el-button type="text" size="mini" @click="handleDispose(scope.row)" icon="el-icon-edit">
|
||||||
处理
|
处理
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -39,7 +46,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
<pagination style="margin-bottom: 2rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -57,7 +64,7 @@
|
|||||||
>
|
>
|
||||||
<el-table-column type="selection" width="80" align="center"/>
|
<el-table-column type="selection" width="80" align="center"/>
|
||||||
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
|
<!-- <el-table-column label="规格" align="center" prop="wares.model" width="180"/>-->
|
||||||
<el-table-column label="领料数量" v-if="type" align="center" prop="waresCount" width="180">
|
<el-table-column label="领料数量" v-if="type" align="center" prop="waresCount" width="180">
|
||||||
<div class="item" slot-scope="scope">
|
<div class="item" slot-scope="scope">
|
||||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
|
||||||
@ -130,9 +137,14 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="库存" align="center" width="150" prop="stock"/>
|
<el-table-column label="库存" align="center" width="150" prop="stock"/>
|
||||||
<el-table-column label="单位" align="center" width="150" prop="unit">
|
<el-table-column label="单位" align="center" width="150" prop="unit">
|
||||||
<template slot-scope="scope">
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-select class="item__input" v-model="scope.row.unit" @blur="save(scope.row)">
|
||||||
|
<el-option v-for="dict in getDictDatasToType(DICT_TYPE.REPAIR_UNIT)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
<span class="item__txt">
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
|
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
|
||||||
</template>
|
</span>
|
||||||
|
</div>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="数量" align="center" width="150" prop="count">
|
<el-table-column label="数量" align="center" width="150" prop="count">
|
||||||
<div class="item" slot-scope="scope">
|
<div class="item" slot-scope="scope">
|
||||||
@ -174,6 +186,8 @@
|
|||||||
<el-button type="primary" @click="handleSubmit">确定</el-button>
|
<el-button type="primary" @click="handleSubmit">确定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -186,10 +200,11 @@ import SoTable from "@/views/repair/stockOperate/Components/SoTable.vue";
|
|||||||
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
|
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
|
||||||
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
|
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
|
||||||
import {getUserProfile} from "@/api/system/user";
|
import {getUserProfile} from "@/api/system/user";
|
||||||
|
import TicketWaresShow from "@/views/repair/tickets/Components/TicketWaresShow.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WaresItem",
|
name: "WaresItem",
|
||||||
components: {WarehouseChoose, SoTable},
|
components: {TicketWaresShow, WarehouseChoose, SoTable},
|
||||||
props: {
|
props: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
@ -199,8 +214,7 @@ export default {
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
query: null,
|
query: null,
|
||||||
type: "01",
|
isBack: !this.type,
|
||||||
isBack: this.type ? null : true
|
|
||||||
},
|
},
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
loading: false,
|
loading: false,
|
||||||
@ -217,7 +231,7 @@ export default {
|
|||||||
// 保存进入编辑的cell
|
// 保存进入编辑的cell
|
||||||
clickCellMap: {},
|
clickCellMap: {},
|
||||||
// 需要编辑的属性
|
// 需要编辑的属性
|
||||||
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model'],
|
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model', 'unit'],
|
||||||
remark: null,
|
remark: null,
|
||||||
tableKey: 0,
|
tableKey: 0,
|
||||||
}
|
}
|
||||||
@ -226,6 +240,9 @@ export default {
|
|||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getDictDatasToType(type){
|
||||||
|
return this.getDictDatas(type)
|
||||||
|
},
|
||||||
// 通过 true是全部、false是选择
|
// 通过 true是全部、false是选择
|
||||||
async handlePass() {
|
async handlePass() {
|
||||||
// 生成领料单、退料单
|
// 生成领料单、退料单
|
||||||
@ -304,15 +321,13 @@ export default {
|
|||||||
const data = {twId: row.id}
|
const data = {twId: row.id}
|
||||||
const res = await listTwItem(data)
|
const res = await listTwItem(data)
|
||||||
this.items = res.data
|
this.items = res.data
|
||||||
|
this.items = this.items.filter(item => item.waresStatus === '1')
|
||||||
this.items.forEach(item => {
|
this.items.forEach(item => {
|
||||||
const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
|
const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
|
||||||
item.waresCount = this.type ? count : item.waresAlreadyCount
|
item.waresCount = this.type ? count : item.waresAlreadyCount
|
||||||
item.isStock = this.type ? count <= item.wares.stock : true
|
item.isStock = this.type ? count <= item.wares.stock : true
|
||||||
})
|
})
|
||||||
this.items = this.items.filter(item => this.type ? item.waresStatus === '02' : item.waresAlreadyCount)
|
this.items = this.items.filter(item => this.type ? item.waresCount > 0 : item.waresAlreadyCount > 0)
|
||||||
if (!this.type) {
|
|
||||||
this.items = this.items.filter(item => item.waresAlreadyCount !== item.waresBackCount)
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
this.dialogLoading = false
|
this.dialogLoading = false
|
||||||
}
|
}
|
||||||
@ -497,6 +512,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return flag.filter(item => item !== "").join(",")
|
return flag.filter(item => item !== "").join(",")
|
||||||
|
},
|
||||||
|
handleView(row){
|
||||||
|
this.$refs.ticketWaresShow.open(row)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
405
src/views/repair/tickets/Components/TWIAdd.vue
Normal file
405
src/views/repair/tickets/Components/TWIAdd.vue
Normal file
@ -0,0 +1,405 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog title="添加配件" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<!-- 卡片头 -->
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<el-row :gutter="2">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-button type="primary" size="mini" @click="openChooseWares">选择配件</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<!-- 卡片内容 -->
|
||||||
|
<div>
|
||||||
|
<el-table :data="chooseList" :stripe="true" :show-overflow-tooltip="true"
|
||||||
|
@cell-mouse-enter="handleCellEnter"
|
||||||
|
@cell-mouse-leave="handleCellLeave"
|
||||||
|
@cell-click="handleCellClick"
|
||||||
|
>
|
||||||
|
<el-table-column label="序号" align="center">
|
||||||
|
<template scope="scope">
|
||||||
|
<span>{{ scope.$index + 1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品名称" prop="name" align="center"/>
|
||||||
|
<!-- <el-table-column label="规格" prop="model" align="center"/>-->
|
||||||
|
<el-table-column label="数量" prop="count" align="center">
|
||||||
|
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.count"/>
|
||||||
|
<span class="item__txt">{{ scope.row.count }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" prop="remark" align="center">
|
||||||
|
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"/>
|
||||||
|
<span class="item__txt">{{ scope.row.remark }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="mini" @click="deleteItem(scope.$index)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 配件选择弹窗 -->
|
||||||
|
<el-dialog title="配件选择" :visible.sync="chooseWaresVisible" width="60%" v-dialogDrag append-to-body>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-button type="primary" size="mini" @click="handleAddWares">新增配件</el-button>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getWaresList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
<el-table ref="multipleTable" @selection-change="handleSelectionChange" v-loading="loading" :data="partList" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column type="selection" align="center" />
|
||||||
|
<el-table-column label="商品名称" prop="name" align="center"/>
|
||||||
|
<!-- <el-table-column label="规格" prop="model" align="center"/>-->
|
||||||
|
</el-table>
|
||||||
|
<pagination @pagination="getWaresList" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||||
|
/>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="addWares" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="chooseWaresVisible = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="新增配件" :visible.sync="addWaresVisible" width="60%" v-dialogDrag append-to-body>
|
||||||
|
<el-form :model="waresFormData" ref="waresFormRef" :rules="waresRules" :inline="true" label-width="10rem" v-loading="wareFormLoading">
|
||||||
|
<el-row :gutter="2">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="waresFormData.name" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="所属分类" prop="type">
|
||||||
|
<TreeSelect
|
||||||
|
style="width: 20rem"
|
||||||
|
v-model="waresFormData.type"
|
||||||
|
:options="baseTypeTree"
|
||||||
|
:normalizer="normalizer"
|
||||||
|
placeholder="请选择所属分类"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="2">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="计量单位" prop="unit">
|
||||||
|
<el-select v-model="waresFormData.unit" placeholder="请选择单位">
|
||||||
|
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.REPAIR_UNIT)"
|
||||||
|
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doAddWares">确 定</el-button>
|
||||||
|
<el-button @click="addWaresVisible = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import TreeSelect from "@riophae/vue-treeselect";
|
||||||
|
import {createWares, getWaresPage} from "@/api/repair/wares";
|
||||||
|
import * as BaseTypeApi from "@/api/base/type";
|
||||||
|
import {addTwi} from "@/api/repair/tickets/TWItem";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "TWIAdd",
|
||||||
|
components: {TreeSelect},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
dialogVisible: false,
|
||||||
|
chooseList: [],
|
||||||
|
formData: {
|
||||||
|
id: null,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: null,
|
||||||
|
count: null,
|
||||||
|
remark: null,
|
||||||
|
name: null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
clickCellMap: {},
|
||||||
|
editProp: ['count', 'remark'],
|
||||||
|
chooseWaresVisible: false,
|
||||||
|
queryParams:{
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name:undefined
|
||||||
|
},
|
||||||
|
showSearch: true,
|
||||||
|
loading: false,
|
||||||
|
partList: [],
|
||||||
|
total: 0,
|
||||||
|
formLoading: false,
|
||||||
|
multipleSelection: [],
|
||||||
|
addWaresVisible: false,
|
||||||
|
waresFormData:{
|
||||||
|
name: null,
|
||||||
|
model: null,
|
||||||
|
price: null,
|
||||||
|
type: null,
|
||||||
|
unit: null,
|
||||||
|
},
|
||||||
|
waresRules:{
|
||||||
|
name: [{required: true, message: '名称不能为空', trigger: 'blur'}],
|
||||||
|
type: [{required: true, message: '所属分类不能为空', trigger: 'blur'}],
|
||||||
|
unit: [{required: true, message: '计量单位不能为空', trigger: 'blur'}],
|
||||||
|
},
|
||||||
|
wareFormLoading: false,
|
||||||
|
//类型树
|
||||||
|
baseTypeTree: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
async submitForm(){
|
||||||
|
try {
|
||||||
|
if (!this.chooseList || this.chooseList.length === 0){
|
||||||
|
this.$modal.msgError("请选择配件")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.createInit()
|
||||||
|
await addTwi(this.formData)
|
||||||
|
this.$modal.msgSuccess("添加成功")
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.$emit("success")
|
||||||
|
}catch{}
|
||||||
|
},
|
||||||
|
createInit(){
|
||||||
|
this.formData.items = [...this.chooseList.map(item => {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
count: item.count,
|
||||||
|
remark: item.remark,
|
||||||
|
name: item.name
|
||||||
|
}
|
||||||
|
})]
|
||||||
|
},
|
||||||
|
async open(row){
|
||||||
|
this.reset()
|
||||||
|
this.formData.id = row.id
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
reset(){
|
||||||
|
this.partList = []
|
||||||
|
this.chooseList = []
|
||||||
|
this.info = {}
|
||||||
|
this.formData = {
|
||||||
|
id: null,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: null,
|
||||||
|
count: null,
|
||||||
|
name: null,
|
||||||
|
remark: null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 鼠标移入cell */
|
||||||
|
handleCellEnter(row, column, cell, event) {
|
||||||
|
const property = column.property
|
||||||
|
if (row.id && this.editProp.includes(property)) {
|
||||||
|
cell.querySelector('.item__txt').classList.add('item__txt--hover')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 鼠标移出cell */
|
||||||
|
handleCellLeave(row, column, cell, event) {
|
||||||
|
const property = column.property
|
||||||
|
if (row.id && this.editProp.includes(property)) {
|
||||||
|
cell.querySelector('.item__txt').classList.remove('item__txt--hover')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 点击cell */
|
||||||
|
handleCellClick(row, column, cell, event) {
|
||||||
|
const property = column.property
|
||||||
|
if (this.editProp.includes(property)) {
|
||||||
|
if (!row.id || property !== 'goods') {
|
||||||
|
// 保存cell
|
||||||
|
this.saveCellClick(row, cell)
|
||||||
|
cell.querySelector('.item__txt').style.display = 'none'
|
||||||
|
cell.querySelector('.item__input').style.display = 'inline'
|
||||||
|
cell.querySelector('input').focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 取消编辑状态 */
|
||||||
|
cancelEditable(cell) {
|
||||||
|
cell.querySelector('.item__txt').style.display = 'inline'
|
||||||
|
cell.querySelector('.item__input').style.display = 'none'
|
||||||
|
},
|
||||||
|
/** 保存进入编辑的cell */
|
||||||
|
saveCellClick(row, cell) {
|
||||||
|
const id = row.id
|
||||||
|
if (this.clickCellMap[id] !== undefined) {
|
||||||
|
if (!this.clickCellMap[id].includes(cell)) {
|
||||||
|
this.clickCellMap[id].push(cell)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.clickCellMap[id] = [cell]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 保存数据 */
|
||||||
|
save(row) {
|
||||||
|
const id = row.id
|
||||||
|
// 取消本行所有cell的编辑状态
|
||||||
|
this.clickCellMap[id].forEach(cell => {
|
||||||
|
this.cancelEditable(cell)
|
||||||
|
})
|
||||||
|
this.clickCellMap[id] = []
|
||||||
|
},
|
||||||
|
deleteItem(index){
|
||||||
|
this.chooseList.splice(index, 1)
|
||||||
|
},
|
||||||
|
handleQuery(){
|
||||||
|
this.queryParams.pageNo = 1
|
||||||
|
this.getWaresList()
|
||||||
|
},
|
||||||
|
resetQuery(){
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
async getWaresList(){
|
||||||
|
try{
|
||||||
|
this.loading = true
|
||||||
|
const res = await getWaresPage(this.queryParams)
|
||||||
|
this.partList = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleAddWares(){
|
||||||
|
this.waresFormData = {
|
||||||
|
name: null,
|
||||||
|
model: null,
|
||||||
|
price: null,
|
||||||
|
type: null,
|
||||||
|
unit: null,
|
||||||
|
}
|
||||||
|
this.addWaresVisible = true
|
||||||
|
this.getBaseTypeTree()
|
||||||
|
},
|
||||||
|
handleSelectionChange(val){
|
||||||
|
this.multipleSelection = val;
|
||||||
|
},
|
||||||
|
addWares(){
|
||||||
|
this.chooseList.push(
|
||||||
|
...this.multipleSelection.map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
count: 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
this.chooseWaresVisible = false
|
||||||
|
},
|
||||||
|
/** 转换仓库数据结构 */
|
||||||
|
normalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.name,
|
||||||
|
children: node.children
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async doAddWares(){
|
||||||
|
try{
|
||||||
|
this.wareFormLoading = true
|
||||||
|
await this.$refs.waresFormRef.validate()
|
||||||
|
this.waresFormData = {
|
||||||
|
...this.waresFormData,
|
||||||
|
miniStock: 0,
|
||||||
|
maxStock: 0,
|
||||||
|
stock: 0,
|
||||||
|
status: '01',
|
||||||
|
purPrice: 0,
|
||||||
|
}
|
||||||
|
await createWares(this.waresFormData)
|
||||||
|
this.addWaresVisible = false
|
||||||
|
this.$modal.msgSuccess("新增成功")
|
||||||
|
await this.getWaresList()
|
||||||
|
}finally {
|
||||||
|
this.wareFormLoading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
openChooseWares() {
|
||||||
|
this.chooseWaresVisible = true
|
||||||
|
this.resetQuery()
|
||||||
|
},
|
||||||
|
/** 获得配置类型树 */
|
||||||
|
async getBaseTypeTree() {
|
||||||
|
this.baseTypeTree = [];
|
||||||
|
let param = {
|
||||||
|
type: '02'
|
||||||
|
}
|
||||||
|
const res = await BaseTypeApi.getBaseTypeList(param);
|
||||||
|
const root = {id: 0, name: '顶级配置类型', children: []};
|
||||||
|
root.children = this.handleTree(res.data, 'id', 'parentId', "children", "0")
|
||||||
|
this.baseTypeTree.push(root)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.item {
|
||||||
|
.item__input {
|
||||||
|
display: none;
|
||||||
|
width: 100px;
|
||||||
|
/* 调整elementUI中样式 如果不需要调整请忽略 */
|
||||||
|
.el-input__inner {
|
||||||
|
height: 24px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 调整elementUI中样式 如果不需要调整请忽略 */
|
||||||
|
.el-input__suffix {
|
||||||
|
i {
|
||||||
|
font-size: 12px !important;
|
||||||
|
line-height: 26px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item__txt {
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
width: 100px;
|
||||||
|
line-height: 24px;
|
||||||
|
padding: 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item__txt--hover {
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -52,7 +52,7 @@
|
|||||||
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||||
<!-- <el-input :min="0" :max="1" @blur="save(scope.row)" class="item__input" v-model="scope.row.discount"/>-->
|
<!-- <el-input :min="0" :max="1" @blur="save(scope.row)" class="item__input" v-model="scope.row.discount"/>-->
|
||||||
<DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.discount" />
|
<DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.discount" />
|
||||||
<span class="item__txt">{{ scope.row.discount === 1 ? "无折扣" : scope.row.discount }}</span>
|
<span class="item__txt">{{ scope.row.discount }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="!exportColumn.includes('totalPrice')" align="center" label="金额" width="180" prop="totalPrice">
|
<el-table-column v-if="!exportColumn.includes('totalPrice')" align="center" label="金额" width="180" prop="totalPrice">
|
||||||
@ -68,7 +68,7 @@
|
|||||||
<span class="item__txt">{{ scope.row.repair ? getRepairName(scope.row.repair) : scope.row.repair }}</span>
|
<span class="item__txt">{{ scope.row.repair ? getRepairName(scope.row.repair) : scope.row.repair }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="!exportColumn.includes('sale')" align="center" label="销售人员" width="180" prop="sale">
|
<el-table-column v-if="!exportColumn.includes('sale')" align="center" label="服务顾问" width="180" prop="sale">
|
||||||
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||||
<StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.sale"
|
<StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.sale"
|
||||||
:select-width="'15rem'" :is-get="scope.row.id"/>
|
:select-width="'15rem'" :is-get="scope.row.id"/>
|
||||||
|
@ -31,14 +31,10 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="数量" width="180" prop="itemCount"/>
|
<el-table-column align="center" label="数量" width="180" prop="itemCount"/>
|
||||||
<el-table-column align="center" label="单价" width="180" prop="itemPrice"/>
|
<el-table-column align="center" label="单价" width="180" prop="itemPrice"/>
|
||||||
<el-table-column align="center" label="折扣" width="180" prop="itemDiscount">
|
<el-table-column align="center" label="折扣" width="180" prop="itemDiscount" />
|
||||||
<template slot-scope="scope">
|
|
||||||
{{scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount}}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="金额" width="180" prop="itemMoney"/>
|
<el-table-column align="center" label="金额" width="180" prop="itemMoney"/>
|
||||||
<el-table-column align="center" label="施工人员" width="180" prop="repairNames"/>
|
<el-table-column align="center" label="施工人员" width="180" prop="repairNames"/>
|
||||||
<el-table-column align="center" label="销售人员" width="180" prop="saleName"/>
|
<el-table-column align="center" label="服务顾问" width="180" prop="saleName"/>
|
||||||
<el-table-column align="center" label="备注" width="180" prop="remark"/>
|
<el-table-column align="center" label="备注" width="180" prop="remark"/>
|
||||||
<el-table-column align="center" label="操作" width="180" fixed="right" v-if="isEdit && list.length > 0">
|
<el-table-column align="center" label="操作" width="180" fixed="right" v-if="isEdit && list.length > 0">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -68,7 +64,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="2">
|
<el-row :gutter="2">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="销售人员" prop="saleName">
|
<el-form-item label="服务顾问" prop="saleName">
|
||||||
<el-input v-model="item.saleName" disabled />
|
<el-input v-model="item.saleName" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<el-table-column label="车牌号" align="center" prop="carNo" width="180"/>
|
<el-table-column label="车牌号" align="center" prop="carNo" width="180"/>
|
||||||
<el-table-column label="车系" align="center" prop="carBrandName" width="180"/>
|
<el-table-column label="车系" align="center" prop="carBrandName" width="180"/>
|
||||||
<el-table-column label="手机号" align="center" prop="userMobile" width="180"/>
|
<el-table-column label="手机号" align="center" prop="userMobile" width="180"/>
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
<el-table-column label="操作" fixed="right" align="center" width="200" v-if="userRole !== 'repair_warehouse'">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- 都有 -->
|
<!-- 都有 -->
|
||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||||
@ -104,6 +104,16 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="200" v-if="userRole === 'repair_warehouse'">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||||
|
>查看
|
||||||
|
</el-button>
|
||||||
|
<el-button v-hasPermi="['repair:tkm:edit']" size="mini" type="text" icon="el-icon-setting" @click="handleEditTicket(scope.row)">
|
||||||
|
编辑工单
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<!-- <el-table-column label="支付金额" align="center" prop="soNo" width="180" />-->
|
<!-- <el-table-column label="支付金额" align="center" prop="soNo" width="180" />-->
|
||||||
<!-- <el-table-column label="优惠" align="center" prop="soNo" width="180" />-->
|
<!-- <el-table-column label="优惠" align="center" prop="soNo" width="180" />-->
|
||||||
<!-- <el-table-column label="本次里程" align="center" prop="soNo" width="180" />-->
|
<!-- <el-table-column label="本次里程" align="center" prop="soNo" width="180" />-->
|
||||||
<!-- <el-table-column label="销售人员" align="center" prop="soNo" width="180" />-->
|
<!-- <el-table-column label="服务顾问" align="center" prop="soNo" width="180" />-->
|
||||||
<!-- <el-table-column label="施工人员" align="center" prop="soNo" width="180" />-->
|
<!-- <el-table-column label="施工人员" align="center" prop="soNo" width="180" />-->
|
||||||
<!-- <el-table-column label="备注" align="center" prop="soNo" width="180" />-->
|
<!-- <el-table-column label="备注" align="center" prop="soNo" width="180" />-->
|
||||||
<!-- <el-table-column label="结算时间" align="center" prop="soNo" width="180" />-->
|
<!-- <el-table-column label="结算时间" align="center" prop="soNo" width="180" />-->
|
||||||
|
@ -5,12 +5,21 @@
|
|||||||
<el-form-item label="关键字" prop="query">
|
<el-form-item label="关键字" prop="query">
|
||||||
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话" v-model="queryParams.query"/>
|
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话" v-model="queryParams.query"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="状态" prop="status">-->
|
<el-form-item label="车牌号" prop="licenseNumber">
|
||||||
<!-- <el-select v-model="queryParams.status">-->
|
<el-input style="width: 20rem" type="text" placeholder="车牌号" v-model="queryParams.licenseNumber" />
|
||||||
<!-- <el-option v-for="item in this.getDictDatas(DICT_TYPE.TICKET_WARES_STATUS)" :key="item.value"-->
|
</el-form-item>
|
||||||
<!-- :label="item.label" :value="item.value"/>-->
|
<el-form-item label="手机号" prop="userMobile">
|
||||||
<!-- </el-select>-->
|
<el-input style="width: 20rem" type="text" placeholder="手机号" v-model="queryParams.userMobile" />
|
||||||
<!-- </el-form-item>-->
|
</el-form-item>
|
||||||
|
<el-form-item label="申请人" prop="repairName">
|
||||||
|
<el-input style="width: 20rem" type="text" placeholder="申请人" v-model="queryParams.repairName" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status">
|
||||||
|
<el-option v-for="item in this.getDictDatas(DICT_TYPE.TICKET_WARES_STATUS)" :key="item.value"
|
||||||
|
:label="item.label" :value="item.value"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||||
@ -20,30 +29,41 @@
|
|||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
<el-table-column label="序号" align="center" width="80">
|
<el-table-column label="序号" align="center" width="80">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<span>{{ scope.$index + 1 }}</span>
|
<span>{{ scope.$index + 1 }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单据号" align="center" prop="no"/>
|
<el-table-column label="单据号" align="center" prop="no" width="200"/>
|
||||||
<el-table-column label="客户车牌" align="center" prop="licenseNumber" />
|
<el-table-column label="客户信息" align="center">
|
||||||
<el-table-column label="服务顾问" align="center" prop="adviserName"/>
|
<el-table-column label="姓名" align="center" prop="userName" width="180"/>
|
||||||
<el-table-column label="申请人" align="center" prop="repairName"/>
|
<el-table-column label="联系电话" align="center" prop="userMobile" width="180"/>
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="车牌号" align="center" prop="licenseNumber" width="180"/>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="申请人" align="center" prop="repairName" width="180"/>
|
||||||
|
<el-table-column label="岗位" align="center" prop="repairWork" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.REPAIR_WORK_TYPE" :value="scope.row.repairWork" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="服务顾问" align="center" prop="adviserName" width="180"/>
|
||||||
|
<el-table-column label="状态" align="center" prop="status" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :type="DICT_TYPE.TICKET_WARES_STATUS" v-model="scope.row.status"/>
|
<dict-tag :type="DICT_TYPE.TICKET_WARES_STATUS" v-model="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark"/>
|
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip width="200"/>
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column label="操作" align="center" fixed="right" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button v-if="scope.row.status !== '01' || userRole !== 'service_advisor'" type="text" size="mini"
|
<el-button type="text" size="mini"
|
||||||
icon="el-icon-view" @click="handleShow(scope.row)">
|
icon="el-icon-view" @click="handleShow(scope.row, false)">
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="(userRole === 'service_advisor' || userRole === 'general_inspection') && scope.row.status === '01'"
|
v-if="scope.row.status === '01'"
|
||||||
|
v-hasPermi="['repair:tw:audit']"
|
||||||
@click="handleAudit(scope.row)" type="text" size="mini" icon="el-icon-s-check">
|
@click="handleAudit(scope.row)" type="text" size="mini" icon="el-icon-s-check">
|
||||||
审核
|
审核
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -61,7 +81,7 @@
|
|||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
<TicketWaresShow ref="ticketWaresShow" :user-role="userRole" @success="getList" :type="type"/>
|
<TicketWaresShow ref="ticketWaresShow" :user-role="userRole" @success="getList" :type="newType"/>
|
||||||
|
|
||||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||||
<el-table el-table v-loading="dialogLoading" :data="items" :stripe="true" :show-overflow-tooltip="true"
|
<el-table el-table v-loading="dialogLoading" :data="items" :stripe="true" :show-overflow-tooltip="true"
|
||||||
@ -101,8 +121,9 @@ export default {
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
query: null,
|
query: null,
|
||||||
type: this.type ? "01" : "02",
|
licenseNumber: null,
|
||||||
status: "01"
|
userMobile: null,
|
||||||
|
repairName: null
|
||||||
},
|
},
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
loading: false,
|
loading: false,
|
||||||
@ -113,7 +134,8 @@ export default {
|
|||||||
items: [],
|
items: [],
|
||||||
selections: [],
|
selections: [],
|
||||||
formData: {},
|
formData: {},
|
||||||
dialogTitle: ""
|
dialogTitle: "",
|
||||||
|
newType: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -140,11 +162,12 @@ export default {
|
|||||||
this.resetForm('queryForm')
|
this.resetForm('queryForm')
|
||||||
this.handleQuery()
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
handleShow(row) {
|
handleShow(row, type) {
|
||||||
|
this.newType = type
|
||||||
this.$refs.ticketWaresShow.open(row)
|
this.$refs.ticketWaresShow.open(row)
|
||||||
},
|
},
|
||||||
handleAudit(row) {
|
handleAudit(row) {
|
||||||
this.handleShow(row)
|
this.handleShow(row, true)
|
||||||
},
|
},
|
||||||
async handleGet(row) {
|
async handleGet(row) {
|
||||||
this.formData = {
|
this.formData = {
|
||||||
|
@ -1,39 +1,48 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-dialog title="申请单查看" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
<el-dialog title="配件申请单" :visible.sync="dialogVisible" ref="dialogRef" width="80%" v-dialogDrag append-to-body>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>申请人</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-descriptions class="margin-top" :column="5" border>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
岗位
|
||||||
|
</template>
|
||||||
|
{{ getWorkTypeByWork(this.formData.repairWork) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
姓名
|
||||||
|
</template>
|
||||||
|
{{ this.formData.repairName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
服务顾问
|
||||||
|
</template>
|
||||||
|
{{ this.formData.adviserName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
时间
|
||||||
|
</template>
|
||||||
|
{{ parseTime(this.formData.createTime, "{y}-{m}-{d}") }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<!-- 卡片头 -->
|
<!-- 卡片头 -->
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<i class="el-icon-plus"/>
|
<span>客户信息</span>
|
||||||
<span>工单信息</span>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 卡片内容 -->
|
<!-- 卡片内容 -->
|
||||||
<div>
|
<div>
|
||||||
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">
|
<el-descriptions class="margin-top" :column="2" :size="'medium'" border style="margin-bottom: 1rem">
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
订单编号
|
|
||||||
</template>
|
|
||||||
{{ info.ticketNo }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
维修类别
|
|
||||||
</template>
|
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="info.repairType"/>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
状态
|
|
||||||
</template>
|
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_WORK_STATUS" v-model="info.ticketsWorkStatus"/>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
客户名称
|
|
||||||
</template>
|
|
||||||
{{ info.userName }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
车牌号
|
车牌号
|
||||||
@ -48,163 +57,115 @@
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
手机号
|
姓名
|
||||||
</template>
|
</template>
|
||||||
{{ info.userMobile }}
|
{{ this.formData.userName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
创建时间
|
电话
|
||||||
</template>
|
</template>
|
||||||
{{ parseTime(info.createTime, '{y}-{m}-{d}') }}
|
{{ this.formData.userMobile }}
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
预计完工
|
|
||||||
</template>
|
|
||||||
{{ parseTime(info.outTime, '{y}-{m}-{d}') }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
合计金额
|
|
||||||
</template>
|
|
||||||
{{ info.totalPrice }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
参考成本
|
|
||||||
</template>
|
|
||||||
{{ info.cost }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
参考毛利
|
|
||||||
</template>
|
|
||||||
{{ info.profit }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
领料状态
|
|
||||||
</template>
|
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="info.partStatus"/>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
服务顾问
|
|
||||||
</template>
|
|
||||||
{{ info.adviserName }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
所属门店
|
|
||||||
</template>
|
|
||||||
{{ info.corpId }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
工单状态
|
|
||||||
</template>
|
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="info.ticketsStatus"/>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item>
|
|
||||||
<template slot="label">
|
|
||||||
备注
|
|
||||||
</template>
|
|
||||||
{{ info.remark }}
|
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="box-card" v-if="this.formData.images">
|
||||||
|
<!-- 卡片头 -->
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>配件申请表</span>
|
||||||
|
</div>
|
||||||
|
<!-- 卡片内容 -->
|
||||||
|
<div>
|
||||||
|
<el-image v-for="url in imageUrls"
|
||||||
|
style="width: 100px; height: 100px"
|
||||||
|
:src="url"
|
||||||
|
:preview-src-list="imageUrls">
|
||||||
|
</el-image>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<!-- 卡片头 -->
|
<!-- 卡片头 -->
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<i class="el-icon-plus"/>
|
<i class="el-icon-plus"/>
|
||||||
<span>配件信息</span>
|
<span>配件信息</span>
|
||||||
|
<div v-if="type" style="float: right; padding: 3px 0">
|
||||||
|
<el-button size="small" type="primary" @click="handleAddWares">
|
||||||
|
添加配件
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 卡片内容 -->
|
<!-- 卡片内容 -->
|
||||||
<div>
|
<div v-show="type">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
<el-table v-loading="loading" :data="items" :stripe="true" :show-overflow-tooltip="true" @selection-change="selectRows"
|
||||||
label-width="90px">
|
|
||||||
<el-form-item label="关键字" prop="query">
|
|
||||||
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话"
|
|
||||||
v-model="queryParams.query"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="状态" prop="waresStatus">
|
|
||||||
<el-select v-model="queryParams.waresStatus">
|
|
||||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.TW_ITEM_STATUS)" :key="item.value"
|
|
||||||
:label="item.label" :value="item.value"/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<!-- 操作 -->
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
<el-table v-loading="loading" :data="items" :stripe="true" :show-overflow-tooltip="true"
|
|
||||||
@cell-mouse-enter="handleCellEnter"
|
@cell-mouse-enter="handleCellEnter"
|
||||||
@cell-mouse-leave="handleCellLeave"
|
@cell-mouse-leave="handleCellLeave"
|
||||||
@cell-click="handleCellClick"
|
@cell-click="handleCellClick"
|
||||||
>
|
>
|
||||||
<el-table-column label="序号" align="center" width="80">
|
<el-table-column type="selection" align="center" width="80"/>
|
||||||
<template scope="scope">
|
|
||||||
<span>{{ scope.$index + 1 }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<!-- <el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 'service_advisor' && type" width="180">-->
|
|
||||||
<!-- <template slot-scope="scope">-->
|
|
||||||
<!-- <el-switch-->
|
|
||||||
<!-- v-model="scope.row.isShow"-->
|
|
||||||
<!-- active-text="是"-->
|
|
||||||
<!-- inactive-text="否"-->
|
|
||||||
<!-- active-value="1"-->
|
|
||||||
<!-- inactive-value="0"-->
|
|
||||||
<!-- @change="changeIsShow(scope.row)"-->
|
|
||||||
<!-- >-->
|
|
||||||
<!-- </el-switch>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
|
|
||||||
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
|
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
|
||||||
<el-table-column v-if="userRole === 'service_advisor' && type" label="销售价格" align="center" prop="wares.price" width="180">
|
<!-- <el-table-column label="销售价格" align="center" prop="wares.price" width="180">-->
|
||||||
<div v-if="formData.status === '01'" class="item" slot-scope="scope">
|
<!-- <div class="item" slot-scope="scope">-->
|
||||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.price"/>
|
<!-- <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.price"/>-->
|
||||||
<span class="item__txt">{{ scope.row.wares.price }}</span>
|
<!-- <span class="item__txt">{{ scope.row.wares.price }}</span>-->
|
||||||
</div>
|
|
||||||
<div v-else slot-scope="scope">
|
|
||||||
<span>{{ scope.row.wares.price }}</span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column v-if="userRole === 'service_advisor' && type" label="折扣" align="center"
|
|
||||||
prop="itemDiscount" width="180">
|
|
||||||
<!-- <div v-if="formData.status === '01'" class="item" slot-scope="scope">-->
|
|
||||||
<!--<!– <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>–>-->
|
|
||||||
<!-- <DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount" />-->
|
|
||||||
<!-- <span class="item__txt">{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>-->
|
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<div slot-scope="scope">
|
<!-- </el-table-column>-->
|
||||||
<span>{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>
|
<el-table-column label="状态" align="center" width="180">
|
||||||
</div>
|
<el-table-column label="待定" prop="waresStatus" align="center">
|
||||||
</el-table-column>
|
<template slot-scope="scope" v-if="scope.row.waresStatus === ''">
|
||||||
<el-table-column label="状态" align="center" prop="waresStatus" width="180">
|
<span>√</span>
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :type="DICT_TYPE.TW_ITEM_STATUS" :value="scope.row.waresStatus"/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="备注" prop="remark" width="180" :show-overflow-tooltip="true"/>
|
<el-table-column label="不通过" prop="waresStatus" align="center">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.waresStatus === '0'">
|
||||||
|
<span style="color: red">√</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="通过" prop="waresStatus" align="center">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.waresStatus === '1'">
|
||||||
|
<span style="color: #3aff70">√</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="审核人" prop="handleName" align="center"/>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div v-show="!type">
|
||||||
|
<el-table v-loading="loading" :data="items" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
|
||||||
|
<el-table-column label="状态" align="center" width="180">
|
||||||
|
<el-table-column label="待定" prop="waresStatus" align="center">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.waresStatus === ''">
|
||||||
|
<span>√</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="不通过" prop="waresStatus" align="center">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.waresStatus === '0'">
|
||||||
|
<span style="color: red">√</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="通过" prop="waresStatus" align="center">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.waresStatus === '1'">
|
||||||
|
<span style="color: #3aff70">√</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="审核人" prop="handleName" align="center"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div slot="footer" class="dialog-footer"
|
<div slot="footer" class="dialog-footer"
|
||||||
v-if="info.status === '01' && (userRole === 'service_advisor' || userRole === 'general_inspection')">
|
v-if="info.status === '01' && type" v-hasPermi="['repair:tw:audit']">
|
||||||
<el-button type="primary" @click="handleAudit(true)">通 过</el-button>
|
<el-button :disabled="this.items.length === 0" type="primary" @click="handleAudit(true)">{{this.selectRow.length > 0 ? "通过" : "通过全部"}}</el-button>
|
||||||
<el-button @click="handleAudit(false)">驳 回</el-button>
|
<el-button :disabled="this.items.length === 0" @click="handleAudit(false)">{{this.selectRow.length > 0 ? "驳回" : "驳回全部"}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<TWIAdd ref="twiAdd" @success="handleSuccess" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -214,10 +175,13 @@ import {auditTicketWares} from "@/api/repair/tickets/TicketWares";
|
|||||||
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
||||||
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
||||||
import item from "@/layout/components/Sidebar/Item.vue";
|
import item from "@/layout/components/Sidebar/Item.vue";
|
||||||
|
import {DICT_TYPE} from "@/utils/dict";
|
||||||
|
import TWOperate from "@/views/repair/tickets/form/TWOperate.vue";
|
||||||
|
import TWIAdd from "@/views/repair/tickets/Components/TWIAdd.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TicketWaresShow",
|
name: "TicketWaresShow",
|
||||||
components: {DiscountInput},
|
components: {TWIAdd, DiscountInput},
|
||||||
props: {
|
props: {
|
||||||
userRole: String,
|
userRole: String,
|
||||||
type: Boolean
|
type: Boolean
|
||||||
@ -237,10 +201,29 @@ export default {
|
|||||||
formData: {},
|
formData: {},
|
||||||
clickCellMap: {},
|
clickCellMap: {},
|
||||||
editProp: ['wares.price'],
|
editProp: ['wares.price'],
|
||||||
|
dialogLoading: null,
|
||||||
|
selectRow:[],
|
||||||
|
imageUrls: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleSuccess(){
|
||||||
|
this.open(this.formData)
|
||||||
|
},
|
||||||
|
handleAddWares(){
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.$refs.twiAdd.open(this.formData)
|
||||||
|
},
|
||||||
|
getImages(images){
|
||||||
|
this.imageUrls = images.split(",").map(item => process.env.VUE_APP_FILE_API + item)
|
||||||
|
},
|
||||||
async open(row) {
|
async open(row) {
|
||||||
|
try {
|
||||||
|
this.items = []
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.dialogLoading = this.$loading({
|
||||||
|
target: this.$refs.dialogRef.$el
|
||||||
|
})
|
||||||
if (row) {
|
if (row) {
|
||||||
this.formData = row
|
this.formData = row
|
||||||
const res = await getTicketsById(row.ticketId)
|
const res = await getTicketsById(row.ticketId)
|
||||||
@ -249,12 +232,18 @@ export default {
|
|||||||
this.queryParams.twId = row.id
|
this.queryParams.twId = row.id
|
||||||
await this.getTwItem()
|
await this.getTwItem()
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
if (this.formData.images){
|
||||||
|
this.getImages(this.formData.images)
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
this.dialogLoading.close()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async getTwItem() {
|
async getTwItem() {
|
||||||
try {
|
try {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const res = await listTwItem(this.queryParams)
|
const res = await listTwItem(this.queryParams)
|
||||||
|
if (res.data && res.data.length > 0){
|
||||||
this.items = res.data
|
this.items = res.data
|
||||||
this.items = [...this.items.map(item => {
|
this.items = [...this.items.map(item => {
|
||||||
return {
|
return {
|
||||||
@ -262,6 +251,10 @@ export default {
|
|||||||
itemDiscount: 1,
|
itemDiscount: 1,
|
||||||
}
|
}
|
||||||
})]
|
})]
|
||||||
|
if (this.type){
|
||||||
|
this.items = [...this.items.filter(item => item.waresStatus === "")]
|
||||||
|
}
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
@ -273,50 +266,40 @@ export default {
|
|||||||
this.resetForm('queryForm')
|
this.resetForm('queryForm')
|
||||||
this.handleQuery()
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
async changeIsShow(row) {
|
|
||||||
try {
|
|
||||||
this.loading = true
|
|
||||||
await updateIsShow({id: row.id, isShow: row.isShow})
|
|
||||||
await this.getTwItem()
|
|
||||||
} finally {
|
|
||||||
this.loading = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 审核
|
// 审核
|
||||||
async handleAudit(flag) {
|
async handleAudit(flag) {
|
||||||
try {
|
try {
|
||||||
const isNull = this.validateNull();
|
// const isNull = this.validateNull();
|
||||||
if (!isNull) return;
|
// if (!isNull) return;
|
||||||
const names = this.validateZero()
|
// const names = this.validateZero()
|
||||||
if (names){
|
// if (names) {
|
||||||
await this.$modal.confirm("确认配件:" + names + "的销售价格为0吗?")
|
// await this.$modal.confirm("确认配件:" + names + "的销售价格为0吗?")
|
||||||
}
|
// }
|
||||||
this.formData['status'] = flag ? "02" : '05'
|
this.dialogLoading = this.$loading({
|
||||||
|
target: this.$refs.dialogRef.$el
|
||||||
|
})
|
||||||
|
this.formData['status'] = flag ? "01" : '02'
|
||||||
// 处理配件信息
|
// 处理配件信息
|
||||||
this.formData.wares = [...this.items.map(item => {
|
if (this.selectRow && this.selectRow.length > 0){
|
||||||
|
this.formData.items = [...this.selectRow.map(item => {
|
||||||
return {
|
return {
|
||||||
itemName: item.waresName,
|
id: item.id
|
||||||
itemCount: item.waresCount,
|
|
||||||
itemUnit: item.wares.unit,
|
|
||||||
itemPrice: item.wares.price,
|
|
||||||
repairIds: this.formData.repairId,
|
|
||||||
repairNames: this.formData.repairName,
|
|
||||||
saleId: this.formData.adviserId,
|
|
||||||
saleName: this.formData.adviserName,
|
|
||||||
itemDiscount: item.itemDiscount,
|
|
||||||
itemMoney: item.wares.price * item.waresCount * (item.itemDiscount / 10),
|
|
||||||
partId: item.waresId,
|
|
||||||
remark: item.remark
|
|
||||||
}
|
}
|
||||||
})]
|
})]
|
||||||
|
}else {
|
||||||
|
this.formData.items = [...this.items.map(item => {
|
||||||
|
return {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})]
|
||||||
|
}
|
||||||
await auditTicketWares(this.formData)
|
await auditTicketWares(this.formData)
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$modal.msgSuccess("审核成功")
|
this.$modal.msgSuccess("审核成功")
|
||||||
this.$emit('success')
|
this.$emit('success')
|
||||||
} catch {
|
} finally {
|
||||||
|
this.dialogLoading.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 鼠标移入cell */
|
/** 鼠标移入cell */
|
||||||
handleCellEnter(row, column, cell, event) {
|
handleCellEnter(row, column, cell, event) {
|
||||||
@ -402,6 +385,13 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return flag.filter(item => item !== "").join(",")
|
return flag.filter(item => item !== "").join(",")
|
||||||
|
},
|
||||||
|
getWorkTypeByWork(work) {
|
||||||
|
const data = this.getDictDatas(DICT_TYPE.REPAIR_WORK_TYPE)
|
||||||
|
return data.filter(item => item.value === work)[0]?.label
|
||||||
|
},
|
||||||
|
selectRows(val){
|
||||||
|
this.selectRow = val
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,6 +199,29 @@
|
|||||||
<TicketItemShow :list="others" list-type="other"/>
|
<TicketItemShow :list="others" list-type="other"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<i class="el-icon-plus"/>
|
||||||
|
<span>合计</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-descriptions class="margin-top" :column="2" :size="'medium'" border style="margin-bottom: 1rem">
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
总数量
|
||||||
|
</template>
|
||||||
|
{{ totalCount }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
总金额
|
||||||
|
</template>
|
||||||
|
{{ totalMoney}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">关闭</el-button>
|
<el-button @click="dialogVisible = false">关闭</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -222,23 +245,44 @@ export default {
|
|||||||
info: {},
|
info: {},
|
||||||
projects: [],
|
projects: [],
|
||||||
wares: [],
|
wares: [],
|
||||||
others: []
|
others: [],
|
||||||
|
allList: [],
|
||||||
|
totalCount: 0,
|
||||||
|
totalMoney: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async open(row) {
|
async open(row) {
|
||||||
|
this.reset()
|
||||||
const res = await getTicketsById(row.id)
|
const res = await getTicketsById(row.id)
|
||||||
const data = res.data.items
|
this.allList = res.data.items
|
||||||
this.projects = data.filter(item => item.project)
|
this.computed()
|
||||||
this.wares = data.filter(item => item.ware)
|
this.projects = this.allList.filter(item => item.project)
|
||||||
this.others = data.filter(item => item.other)
|
this.wares = this.allList.filter(item => item.ware)
|
||||||
|
this.others = this.allList.filter(item => item.other)
|
||||||
this.info = row
|
this.info = row
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
async changeShow() {
|
async changeShow() {
|
||||||
try {
|
try {
|
||||||
await updateShow(this.info.id, this.info.partShow)
|
await updateShow(this.info.id, this.info.partShow)
|
||||||
}catch {}
|
} catch {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.info = {}
|
||||||
|
this.projects = []
|
||||||
|
this.wares = []
|
||||||
|
this.others = []
|
||||||
|
this.allList = []
|
||||||
|
},
|
||||||
|
computed(){
|
||||||
|
this.totalCount = 0
|
||||||
|
this.totalMoney = 0
|
||||||
|
if (this.allList && this.allList.length > 0){
|
||||||
|
this.totalCount = this.allList.reduce((acc, cur) => {return acc + cur.itemCount}, 0)
|
||||||
|
this.totalMoney = this.allList.reduce((acc, cur) => {return acc + cur.itemMoney}, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -556,7 +556,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.selectUser = {}
|
this.selectUser = {}
|
||||||
this.selectCar = {}
|
this.selectCar = {}
|
||||||
this.selectStaff = {}
|
// this.selectStaff = {}
|
||||||
this.projectList = []
|
this.projectList = []
|
||||||
this.partList = []
|
this.partList = []
|
||||||
this.otherList = []
|
this.otherList = []
|
||||||
@ -619,7 +619,7 @@ export default {
|
|||||||
case "03":
|
case "03":
|
||||||
message += "其他:"
|
message += "其他:"
|
||||||
}
|
}
|
||||||
this.$modal.msgError(message + item.itemName + (!item.repairIds ? "施工人员" : "销售人员") + "不能为空")
|
this.$modal.msgError(message + item.itemName + (!item.repairIds ? "施工人员" : "服务顾问") + "不能为空")
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-tabs v-model="activeTab">
|
<el-tabs v-model="activeTab" v-if="userRole !== 'repair_warehouse'">
|
||||||
<el-tab-pane label="全部工单" name="finish">
|
<el-tab-pane label="全部工单" name="finish">
|
||||||
<TicketManagerItem :is-type="'all'" :user-role="userRole"/>
|
<TicketManagerItem :is-type="'all'" :user-role="userRole"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -20,6 +20,11 @@
|
|||||||
<GetAndBackWares :type="false" />
|
<GetAndBackWares :type="false" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
<el-tabs v-model="activeTab" v-if="userRole === 'repair_warehouse'">
|
||||||
|
<el-tab-pane label="未结束工单" name="finish">
|
||||||
|
<TicketManagerItem :is-type="'waiting'" :user-role="userRole"/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" v-if="userRole !== 'repair_warehouse'">
|
||||||
<!-- 卡片头 -->
|
<!-- 卡片头 -->
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<i class="el-icon-plus"/>
|
<i class="el-icon-plus"/>
|
||||||
@ -178,13 +178,13 @@
|
|||||||
<TicketItemShow :is-edit="true" :list="projects" list-type="project" @remove="handleRemove" @success="open"/>
|
<TicketItemShow :is-edit="true" :list="projects" list-type="project" @remove="handleRemove" @success="open"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" v-if="!(userRole === 'service_advisor')">
|
||||||
<!-- 卡片头 -->
|
<!-- 卡片头 -->
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<i class="el-icon-plus"/>
|
<i class="el-icon-plus"/>
|
||||||
<span>配件信息</span>
|
<span>配件信息</span>
|
||||||
<div style="float: right; padding: 3px 0">
|
<div style="float: right; padding: 3px 0">
|
||||||
<el-switch v-if="wares.length > 0"
|
<el-switch v-if="wares.length > 0 && userRole !== 'repair_warehouse'"
|
||||||
v-model="info.partShow"
|
v-model="info.partShow"
|
||||||
active-text="客户可见"
|
active-text="客户可见"
|
||||||
inactive-text="客户不可见"
|
inactive-text="客户不可见"
|
||||||
@ -203,7 +203,7 @@
|
|||||||
<TicketItemShow :is-edit="true" :list="wares" list-type="ware" @remove="handleRemove" @success="open"/>
|
<TicketItemShow :is-edit="true" :list="wares" list-type="ware" @remove="handleRemove" @success="open"/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card" v-if="userRole !== 'repair_warehouse'">
|
||||||
<!-- 卡片头 -->
|
<!-- 卡片头 -->
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<i class="el-icon-plus"/>
|
<i class="el-icon-plus"/>
|
||||||
@ -290,7 +290,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getTicketsById, updateShow, addItems, updateTicket} from "@/api/repair/tickets/Tickets";
|
import {getTicketsById, updateShow, addItems, updateTicket, getUserRole} from "@/api/repair/tickets/Tickets";
|
||||||
import {removeItemById} from "@/api/repair/tickets/TicketsItem";
|
import {removeItemById} from "@/api/repair/tickets/TicketsItem";
|
||||||
import TicketItemShow from "@/views/repair/tickets/Components/TicketItemShow.vue";
|
import TicketItemShow from "@/views/repair/tickets/Components/TicketItemShow.vue";
|
||||||
import other from "@/views/repair/other/index.vue";
|
import other from "@/views/repair/other/index.vue";
|
||||||
@ -333,6 +333,7 @@ export default {
|
|||||||
threePackMoney: 0,
|
threePackMoney: 0,
|
||||||
confirmFaultMoney: 0,
|
confirmFaultMoney: 0,
|
||||||
},
|
},
|
||||||
|
userRole: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -348,10 +349,16 @@ export default {
|
|||||||
this.wares = data.filter(item => item.ware)
|
this.wares = data.filter(item => item.ware)
|
||||||
this.others = data.filter(item => item.other)
|
this.others = data.filter(item => item.other)
|
||||||
this.info = res.data
|
this.info = res.data
|
||||||
|
await this.judgeUserRole()
|
||||||
} finally {
|
} finally {
|
||||||
this.loadingInstance.close()
|
this.loadingInstance.close()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 获得当前登录用户的角色信息
|
||||||
|
async judgeUserRole(){
|
||||||
|
const res = await getUserRole()
|
||||||
|
this.userRole = res.data
|
||||||
|
},
|
||||||
async changeShow(){
|
async changeShow(){
|
||||||
try {
|
try {
|
||||||
await updateShow(this.info.id, this.info.partShow)
|
await updateShow(this.info.id, this.info.partShow)
|
||||||
|
@ -45,8 +45,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品名称" align="center" prop="repairWares.name" />
|
<el-table-column label="商品名称" align="center" prop="repairWares.name" />
|
||||||
<el-table-column label="商品编码" align="center" prop="repairWares.code" />
|
<!-- <el-table-column label="商品编码" align="center" prop="repairWares.code" />-->
|
||||||
<el-table-column label="规格" align="center" prop="repairWares.model" />
|
<!-- <el-table-column label="规格" align="center" prop="repairWares.model" />-->
|
||||||
<el-table-column label="数量" align="center" prop="goodsCount" />
|
<el-table-column label="数量" align="center" prop="goodsCount" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-form style="margin-top: 1rem" :inline="true">
|
<el-form style="margin-top: 1rem" :inline="true">
|
||||||
@ -132,6 +132,7 @@ export default {
|
|||||||
this.formData['id'] = row.id
|
this.formData['id'] = row.id
|
||||||
try{
|
try{
|
||||||
this.items = []
|
this.items = []
|
||||||
|
this.image = null
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
this.dialogLoading = true
|
this.dialogLoading = true
|
||||||
const res = await getRepairSoiBySoId(row.id)
|
const res = await getRepairSoiBySoId(row.id)
|
||||||
|
@ -1,120 +1,120 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||||
<el-card class="box-card">
|
<!-- <el-card class="box-card">-->
|
||||||
<!-- 卡片头 -->
|
<!-- <!– 卡片头 –>-->
|
||||||
<div slot="header" class="clearfix">
|
<!-- <div slot="header" class="clearfix">-->
|
||||||
<i class="el-icon-plus"/>
|
<!-- <i class="el-icon-plus"/>-->
|
||||||
<span>工单信息</span>
|
<!-- <span>工单信息</span>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<!-- 卡片内容 -->
|
<!-- <!– 卡片内容 –>-->
|
||||||
<div>
|
<!-- <div>-->
|
||||||
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">
|
<!-- <el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
订单编号
|
<!-- 订单编号-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.ticketNo }}
|
<!-- {{ info.ticketNo }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
维修类别
|
<!-- 维修类别-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="info.repairType"/>
|
<!-- <dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="info.repairType"/>-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
状态
|
<!-- 状态-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_WORK_STATUS" v-model="info.ticketsWorkStatus"/>
|
<!-- <dict-tag :type="DICT_TYPE.REPAIR_TICKETS_WORK_STATUS" v-model="info.ticketsWorkStatus"/>-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
客户名称
|
<!-- 客户名称-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.userName }}
|
<!-- {{ info.userName }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
车牌号
|
<!-- 车牌号-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.carNo }}
|
<!-- {{ info.carNo }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
车系
|
<!-- 车系-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.carBrandName }}
|
<!-- {{ info.carBrandName }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
手机号
|
<!-- 手机号-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.userMobile }}
|
<!-- {{ info.userMobile }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
创建时间
|
<!-- 创建时间-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ parseTime(info.createTime, '{y}-{m}-{d}') }}
|
<!-- {{ parseTime(info.createTime, '{y}-{m}-{d}') }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
预计完工
|
<!-- 预计完工-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ parseTime(info.outTime, '{y}-{m}-{d}') }}
|
<!-- {{ parseTime(info.outTime, '{y}-{m}-{d}') }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
合计金额
|
<!-- 合计金额-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.totalPrice }}
|
<!-- {{ info.totalPrice }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
参考成本
|
<!-- 参考成本-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.cost }}
|
<!-- {{ info.cost }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
参考毛利
|
<!-- 参考毛利-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.profit }}
|
<!-- {{ info.profit }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
领料状态
|
<!-- 领料状态-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="info.partStatus"/>
|
<!-- <dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="info.partStatus"/>-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
服务顾问
|
<!-- 服务顾问-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.adviserName }}
|
<!-- {{ info.adviserName }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
所属门店
|
<!-- 所属门店-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.corpId }}
|
<!-- {{ info.corpId }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
工单状态
|
<!-- 工单状态-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="info.ticketsStatus"/>
|
<!-- <dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="info.ticketsStatus"/>-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<!-- <el-descriptions-item>-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
备注
|
<!-- 备注-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
{{ info.remark }}
|
<!-- {{ info.remark }}-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
</el-descriptions>
|
<!-- </el-descriptions>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-card>
|
<!-- </el-card>-->
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<!-- 卡片头 -->
|
<!-- 卡片头 -->
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
@ -130,7 +130,6 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 卡片内容 -->
|
<!-- 卡片内容 -->
|
||||||
<div>
|
<div>
|
||||||
@ -168,6 +167,19 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="box-card">
|
||||||
|
<!-- 卡片头 -->
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<i class="el-icon-plus"/>
|
||||||
|
<span>上传配件申请单</span>
|
||||||
|
</div>
|
||||||
|
<!-- 卡片内容 -->
|
||||||
|
<div>
|
||||||
|
<ImageUpload v-model="images" />
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
@ -285,6 +297,7 @@ export default {
|
|||||||
adviserId: null,
|
adviserId: null,
|
||||||
adviserName: null,
|
adviserName: null,
|
||||||
licenseNumber: null,
|
licenseNumber: null,
|
||||||
|
images: null
|
||||||
},
|
},
|
||||||
addWaresVisible: false,
|
addWaresVisible: false,
|
||||||
waresFormData:{
|
waresFormData:{
|
||||||
@ -302,6 +315,7 @@ export default {
|
|||||||
wareFormLoading: false,
|
wareFormLoading: false,
|
||||||
//类型树
|
//类型树
|
||||||
baseTypeTree: [],
|
baseTypeTree: [],
|
||||||
|
images: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
@ -327,7 +341,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async submitForm(){
|
async submitForm(){
|
||||||
try {
|
try {
|
||||||
if (!this.chooseList || this.chooseList.length <= 0){
|
if ((!this.chooseList || this.chooseList.length <= 0) && !this.images){
|
||||||
this.$modal.msgError("没有选择任何配件")
|
this.$modal.msgError("没有选择任何配件")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -349,6 +363,7 @@ export default {
|
|||||||
adviserId: null,
|
adviserId: null,
|
||||||
adviserName: null,
|
adviserName: null,
|
||||||
licenseNumber: null,
|
licenseNumber: null,
|
||||||
|
images: null
|
||||||
}
|
}
|
||||||
this.formData.no = createUniqueCodeByHead(this.info.type ? 'LLSQ' : 'TLSQ')
|
this.formData.no = createUniqueCodeByHead(this.info.type ? 'LLSQ' : 'TLSQ')
|
||||||
this.formData.ticketId = this.info.id
|
this.formData.ticketId = this.info.id
|
||||||
@ -357,22 +372,31 @@ export default {
|
|||||||
this.formData.adviserId = this.info.adviserId
|
this.formData.adviserId = this.info.adviserId
|
||||||
this.formData.adviserName = this.info.adviserName
|
this.formData.adviserName = this.info.adviserName
|
||||||
this.formData.licenseNumber = this.info.carNo
|
this.formData.licenseNumber = this.info.carNo
|
||||||
|
if (this.chooseList && this.chooseList.length > 0){
|
||||||
this.formData.items = [
|
this.formData.items = [
|
||||||
...this.chooseList.map(item => {
|
...this.chooseList.map(item => {
|
||||||
return {
|
return {
|
||||||
waresId: item.id,
|
waresId: item.id,
|
||||||
waresName: item.name,
|
waresName: item.name,
|
||||||
waresCount: item.count,
|
waresCount: item.count,
|
||||||
waresStatus: "02",
|
waresStatus: "",
|
||||||
remark: item.remark,
|
remark: item.remark,
|
||||||
isShow: '1'
|
isShow: '1'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
if (this.images){
|
||||||
|
const data = this.images.split(",")
|
||||||
|
this.formData.images = data.map(item => {
|
||||||
|
return item.replace(process.env.VUE_APP_FILE_API, "")
|
||||||
|
}).join(",")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
reset(){
|
reset(){
|
||||||
this.partList = []
|
this.partList = []
|
||||||
this.chooseList = []
|
this.chooseList = []
|
||||||
|
this.images = null
|
||||||
this.info = {}
|
this.info = {}
|
||||||
this.formData = {
|
this.formData = {
|
||||||
no: null,
|
no: null,
|
||||||
|
@ -69,6 +69,10 @@
|
|||||||
<el-dropdown-item command="noticeCus" type="text" icon="el-icon-finished" v-if="userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '03'">
|
<el-dropdown-item command="noticeCus" type="text" icon="el-icon-finished" v-if="userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '03'">
|
||||||
通知客户取车
|
通知客户取车
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
<!-- 服务顾问才有 -->
|
||||||
|
<el-dropdown-item command="carToCus" type="text" icon="el-icon-circle-check" v-if="userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '03'">
|
||||||
|
交车
|
||||||
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
@ -140,6 +144,31 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="交车" :visible.sync="carToCusDialog" width="60%" v-dialogDrag append-to-body>
|
||||||
|
<el-form v-model="carToCusForm" :inline="true" label-width="15rem">
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="描述" prop="remark">
|
||||||
|
<el-input style="width: 30rem" type="textarea" v-model="carToCusForm.remark"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 8}"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="附件" prop="image">
|
||||||
|
<!-- <FileUpload v-model="formData.image" />-->
|
||||||
|
<ImageUpload v-model="carToCusForm.image"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doCarToCus">确定</el-button>
|
||||||
|
<el-button @click="carToCusDialog = false">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<UpdateRepair ref="updateRepair" @success="getList" :user-role="userRole"/>
|
<UpdateRepair ref="updateRepair" @success="getList" :user-role="userRole"/>
|
||||||
<EditTickets ref="editTickets" @success="getList"/>
|
<EditTickets ref="editTickets" @success="getList"/>
|
||||||
<RecordSetting ref="recordSet" />
|
<RecordSetting ref="recordSet" />
|
||||||
@ -147,7 +176,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getPageByRole, inspection, confirm, noticeCus} from "@/api/repair/tickets/Tickets";
|
import {getPageByRole, inspection, confirm, noticeCus, hasPrice, overOrder} from "@/api/repair/tickets/Tickets";
|
||||||
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
|
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
|
||||||
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
|
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
|
||||||
import {getUserProfile} from "@/api/system/user";
|
import {getUserProfile} from "@/api/system/user";
|
||||||
@ -191,7 +220,13 @@ export default {
|
|||||||
},
|
},
|
||||||
noticeLoading: false,
|
noticeLoading: false,
|
||||||
noticeDialog: false,
|
noticeDialog: false,
|
||||||
isNoticeChoose: false
|
isNoticeChoose: false,
|
||||||
|
carToCusDialog: false,
|
||||||
|
carToCusForm:{
|
||||||
|
id: null,
|
||||||
|
remark: null,
|
||||||
|
image: null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -260,6 +295,21 @@ export default {
|
|||||||
this.$refs.updateRepair.open(row)
|
this.$refs.updateRepair.open(row)
|
||||||
},
|
},
|
||||||
async noticeCus(row){
|
async noticeCus(row){
|
||||||
|
// 在下面的代码执行之前,先去判断是否有项目或配件没有价格或为0
|
||||||
|
const flag = await hasPrice(row.id)
|
||||||
|
let choose = true
|
||||||
|
if (!flag.data){
|
||||||
|
await this.$confirm('有项目或配件的价格为0,是否确认通知客户?', '选择', {
|
||||||
|
confirmButtonText: '是',
|
||||||
|
cancelButtonText: '否',
|
||||||
|
type: 'info'
|
||||||
|
}).then(() => {
|
||||||
|
choose = true
|
||||||
|
}).catch(() => {
|
||||||
|
choose = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (choose){
|
||||||
this.$confirm('请选择使用什么方式通知客户?', '选择', {
|
this.$confirm('请选择使用什么方式通知客户?', '选择', {
|
||||||
confirmButtonText: '短信通知',
|
confirmButtonText: '短信通知',
|
||||||
cancelButtonText: '拨打电话',
|
cancelButtonText: '拨打电话',
|
||||||
@ -289,7 +339,7 @@ export default {
|
|||||||
this.noticeData.name = row.userName
|
this.noticeData.name = row.userName
|
||||||
this.noticeData.mobile = row.userMobile
|
this.noticeData.mobile = row.userMobile
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async doNotice(){
|
async doNotice(){
|
||||||
try {
|
try {
|
||||||
@ -322,6 +372,27 @@ export default {
|
|||||||
case 'noticeCus':
|
case 'noticeCus':
|
||||||
this.noticeCus(row)
|
this.noticeCus(row)
|
||||||
break
|
break
|
||||||
|
case 'carToCus':
|
||||||
|
this.carToCus(row)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
|
carToCus(row){
|
||||||
|
this.carToCusForm = {
|
||||||
|
id: null,
|
||||||
|
remark: null,
|
||||||
|
image: null
|
||||||
|
}
|
||||||
|
this.carToCusForm.id = row.id
|
||||||
|
this.carToCusDialog = true
|
||||||
|
},
|
||||||
|
async doCarToCus(){
|
||||||
|
try {
|
||||||
|
await overOrder(this.carToCusForm)
|
||||||
|
this.carToCusDialog = false
|
||||||
|
this.$modal.msgSuccess("交车成功")
|
||||||
|
await this.getList()
|
||||||
|
}catch{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,25 +47,47 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button v-if="formData.recordType !== 'sgwczj' && projectList.length > 0" type="primary" @click="doUpdate(null)">确
|
<el-button v-if="formData.recordType !== 'sgwczj' && projectList.length > 0" type="primary"
|
||||||
|
@click="doUpdate(null)">确
|
||||||
定
|
定
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary" @click="doUpdate(null)">
|
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary"
|
||||||
|
@click="doUpdate(null)">
|
||||||
部分完成
|
部分完成
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary" @click="doFinish(true)">
|
<el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary"
|
||||||
完成并移交下一班组
|
@click="handleFinish">
|
||||||
</el-button>
|
完成
|
||||||
<el-button v-if="formData.recordType === 'sgwczj' && !isNext && projectList.length !== 0" type="primary"
|
|
||||||
@click="doFinish(false)">
|
|
||||||
{{ isEndCheck ? "完成并移交总检" : "完成工单" }}
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<!-- <el-button v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary" @click="doFinish(true)">-->
|
||||||
|
<!-- 完成并移交下一班组-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<!-- <el-button v-if="formData.recordType === 'sgwczj' && !isNext && projectList.length !== 0" type="primary"-->
|
||||||
|
<!-- @click="doFinish(false)">-->
|
||||||
|
<!-- {{ isEndCheck ? "完成并移交总检" : "完成工单" }}-->
|
||||||
|
<!-- </el-button>-->
|
||||||
<!-- <el-button v-if="formData.recordType === 'sgwczj'" type="success" @click="doFinish">-->
|
<!-- <el-button v-if="formData.recordType === 'sgwczj'" type="success" @click="doFinish">-->
|
||||||
<!-- {{isNext ? "整体完成并指派下一项目" : (isEndCheck ? "整体完成并移交总检" : "整体完成")}}-->
|
<!-- {{isNext ? "整体完成并指派下一项目" : (isEndCheck ? "整体完成并移交总检" : "整体完成")}}-->
|
||||||
<!-- </el-button>-->
|
<!-- </el-button>-->
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="选择"
|
||||||
|
:visible.sync="chooseVisible"
|
||||||
|
width="30%">
|
||||||
|
<span>{{isEndCheck ? '这个工单需要总检,' : '这个工单不需要总检,'}}请选择完成方式</span>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" v-if="formData.recordType === 'sgwczj' && projectList.length !== 0"
|
||||||
|
@click="doFinish(true)">完成并移交下一班组</el-button>
|
||||||
|
<el-button v-if="formData.recordType === 'sgwczj' && !isNext && projectList.length !== 0" type="primary"
|
||||||
|
@click="doFinish(false)">
|
||||||
|
{{ isEndCheck ? "完成并移交总检" : "完成工单" }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="chooseVisible = false">取 消</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<UpdateRepair ref="updateRepair" @success="doUpdate"/>
|
<UpdateRepair ref="updateRepair" @success="doUpdate"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -104,10 +126,14 @@ export default {
|
|||||||
isNext: false,
|
isNext: false,
|
||||||
// 是否需要总检
|
// 是否需要总检
|
||||||
isEndCheck: true,
|
isEndCheck: true,
|
||||||
clickRow: null
|
clickRow: null,
|
||||||
|
chooseVisible: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleFinish() {
|
||||||
|
this.chooseVisible = true
|
||||||
|
},
|
||||||
init() {
|
init() {
|
||||||
this.formData = {
|
this.formData = {
|
||||||
// 主表信息
|
// 主表信息
|
||||||
@ -177,6 +203,7 @@ export default {
|
|||||||
this.$modal.msgSuccess("操作成功")
|
this.$modal.msgSuccess("操作成功")
|
||||||
}
|
}
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
|
this.chooseVisible = false
|
||||||
this.$emit("success")
|
this.$emit("success")
|
||||||
} else {
|
} else {
|
||||||
this.formLoading = true
|
this.formLoading = true
|
||||||
@ -185,6 +212,7 @@ export default {
|
|||||||
this.$modal.msgSuccess("操作成功")
|
this.$modal.msgSuccess("操作成功")
|
||||||
}
|
}
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
|
this.chooseVisible = false
|
||||||
this.$emit("success")
|
this.$emit("success")
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
@ -192,6 +220,9 @@ export default {
|
|||||||
},
|
},
|
||||||
async doFinish(flag) {
|
async doFinish(flag) {
|
||||||
try {
|
try {
|
||||||
|
if (!this.formData.item.id){
|
||||||
|
this.$modal.msgError("请先选择要完成的项目")
|
||||||
|
}
|
||||||
await this.$refs.formRef.validate()
|
await this.$refs.formRef.validate()
|
||||||
this.formLoading = true
|
this.formLoading = true
|
||||||
// 不论是什么按钮,这个工单子项是完了的
|
// 不论是什么按钮,这个工单子项是完了的
|
||||||
|
@ -115,10 +115,15 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="品牌型号" prop="carInfo.brandAndModel">
|
<el-form-item label="车辆品牌" prop="carInfo.brandAndModel">
|
||||||
<CarBrandSelector v-model="formData.carInfo.brandAndModel" ref="brandForm"/>
|
<CarBrandSelector v-model="formData.carInfo.brandAndModel" ref="brandForm"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="车辆型号" prop="carInfo.carModel">
|
||||||
|
<el-input type="text" v-model="formData.carInfo.carModel" placeholder="请输入车辆型号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="车辆类别" prop="carInfo.carCategory">
|
<el-form-item label="车辆类别" prop="carInfo.carCategory">
|
||||||
<el-select v-model="formData.carInfo.carCategory" placeholder="请选择车辆类别">
|
<el-select v-model="formData.carInfo.carCategory" placeholder="请选择车辆类别">
|
||||||
@ -127,6 +132,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="车辆性质" prop="carInfo.carNature">
|
<el-form-item label="车辆性质" prop="carInfo.carNature">
|
||||||
<el-select v-model="formData.carInfo.carNature" placeholder="请选择车辆性质">
|
<el-select v-model="formData.carInfo.carNature" placeholder="请选择车辆性质">
|
||||||
@ -135,8 +142,6 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="注册日期" prop="carInfo.carRegisterDate">
|
<el-form-item label="注册日期" prop="carInfo.carRegisterDate">
|
||||||
<el-date-picker clearable v-model="formData.carInfo.carRegisterDate" type="date" value-format="timestamp"
|
<el-date-picker clearable v-model="formData.carInfo.carRegisterDate" type="date" value-format="timestamp"
|
||||||
@ -303,6 +308,7 @@ export default {
|
|||||||
nextInspectionDate: undefined,
|
nextInspectionDate: undefined,
|
||||||
nextMaintenanceDate: undefined,
|
nextMaintenanceDate: undefined,
|
||||||
nextMaintenanceMileage: undefined,
|
nextMaintenanceMileage: undefined,
|
||||||
|
carModel: undefined
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
@ -311,7 +317,8 @@ export default {
|
|||||||
'carInfo.licenseNumber': [{required: true, message: "车牌号不能为空", trigger: 'blur'}],
|
'carInfo.licenseNumber': [{required: true, message: "车牌号不能为空", trigger: 'blur'}],
|
||||||
'carInfo.brandAndModel': [{required: true, message: "品牌型号不能为空", trigger: 'blur'}],
|
'carInfo.brandAndModel': [{required: true, message: "品牌型号不能为空", trigger: 'blur'}],
|
||||||
'carInfo.carCategory': [{required: true, message: '车辆类别不能为空', trigger: 'blur'}],
|
'carInfo.carCategory': [{required: true, message: '车辆类别不能为空', trigger: 'blur'}],
|
||||||
'carInfo.carNature': [{required: true, message: '车辆性质不能为空', trigger: 'blur'}]
|
'carInfo.carNature': [{required: true, message: '车辆性质不能为空', trigger: 'blur'}],
|
||||||
|
'carInfo.carModel': [{required: true, message: '车辆型号不能为空', trigger: 'blur'}]
|
||||||
},
|
},
|
||||||
formLoading: false,
|
formLoading: false,
|
||||||
//折叠面板默认展开
|
//折叠面板默认展开
|
||||||
@ -342,7 +349,8 @@ export default {
|
|||||||
this.formData.carInfo = {
|
this.formData.carInfo = {
|
||||||
...this.formData.carInfo,
|
...this.formData.carInfo,
|
||||||
...data.carInfo,
|
...data.carInfo,
|
||||||
brandAndModel: [data.carInfo?.carBrand, data.carInfo?.carModel]
|
brandAndModel: data.carInfo?.carBrand,
|
||||||
|
carModel: data.carInfo?.carModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// await this.listLevel()
|
// await this.listLevel()
|
||||||
@ -354,7 +362,10 @@ export default {
|
|||||||
this.buttonLoading = true
|
this.buttonLoading = true
|
||||||
try{
|
try{
|
||||||
const data = this.formData.carInfo;
|
const data = this.formData.carInfo;
|
||||||
debugger
|
const brand = data.brandAndModel
|
||||||
|
if (typeof brand === 'string'){
|
||||||
|
data.brandAndModel = [brand, data?.carModel]
|
||||||
|
}
|
||||||
const res = await CarMainApi.compute(data);
|
const res = await CarMainApi.compute(data);
|
||||||
const result = res.data;
|
const result = res.data;
|
||||||
this.formData.carInfo.insuranceExpiryDate = result.insuranceExpiryDate
|
this.formData.carInfo.insuranceExpiryDate = result.insuranceExpiryDate
|
||||||
@ -368,6 +379,10 @@ export default {
|
|||||||
async submitForm(){
|
async submitForm(){
|
||||||
await this.$refs["formRef"].validate();
|
await this.$refs["formRef"].validate();
|
||||||
this.formLoading = true
|
this.formLoading = true
|
||||||
|
const brand = this.formData.carInfo.brandAndModel
|
||||||
|
if (typeof brand === 'string'){
|
||||||
|
this.formData.carInfo.brandAndModel = [brand, this.formData.carInfo?.carModel]
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await updateCustomerAndCar(this.formData)
|
await updateCustomerAndCar(this.formData)
|
||||||
this.$modal.msgSuccess(this.formData?.userInfo?.id ? "修改成功" : "新增成功")
|
this.$modal.msgSuccess(this.formData?.userInfo?.id ? "修改成功" : "新增成功")
|
||||||
@ -429,6 +444,7 @@ export default {
|
|||||||
nextInspectionDate: undefined,
|
nextInspectionDate: undefined,
|
||||||
nextMaintenanceDate: undefined,
|
nextMaintenanceDate: undefined,
|
||||||
nextMaintenanceMileage: undefined,
|
nextMaintenanceMileage: undefined,
|
||||||
|
carModel: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.resetForm("formRef")
|
this.resetForm("formRef")
|
||||||
|
Loading…
Reference in New Issue
Block a user