Merge remote-tracking branch 'origin/master'

This commit is contained in:
13405411873 2024-11-25 20:11:37 +08:00
commit 1af4b7042d
45 changed files with 2191 additions and 862 deletions

View File

@ -18,6 +18,15 @@ export function updateDlInspectionProject(data) {
})
}
// 更新检测项目排序
export function updateSort(data) {
return request({
url: '/inspection/dl-inspection-project/updateSort',
method: 'put',
data: data
})
}
// 删除检测项目
export function deleteDlInspectionProject(id) {
return request({

View File

@ -26,3 +26,11 @@ export function getRepairSoiBySoId(soId){
method: 'get'
})
}
// 根据主表的ID得到子表的所有数据按类型区分的map支持条件查询
export function getMapBySoIdAndQuery(id, query){
return request({
url: preUrl + "/getMapBySoIdAndQuery?id=" + id + "&query=" + query,
method: 'get'
})
}

View File

@ -19,3 +19,12 @@ export function updateIsShow(params){
params
})
}
// 给配件申请表子表添加数据
export function addTwi(data){
return request({
url: preUrl + '/addTwi',
method: 'post',
data
})
}

View File

@ -63,3 +63,28 @@ export function passBackTicketWares(data){
data
})
}
// 修改是否传给保险公司
export function updateSafe(data){
return request({
url: preUrl + "/updateSafe",
method: "post",
data
})
}
// 查单个配件申请单的信息
export function getById(id){
return request({
url: preUrl + "/getById?id=" + id,
method: 'get'
})
}
// 根据选择的配件生成采购单需要的数据
export function getByIds(ids){
return request({
url: preUrl + "/getByIds?ids=" + ids,
method: 'get'
})
}

View File

@ -175,3 +175,28 @@ export function removeTicketById(id){
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
})
}
// 根据工单ID查客户和车辆信息
export function getCusAndCarById(id){
return request({
url: preUrl + "/getCusAndCarById?id=" + id,
method: 'get'
})
}

View File

@ -52,7 +52,7 @@ export default {
if (isExternal(item)) {
return srcList.push(item);
}
return srcList.push(process.env.VUE_APP_BASE_API + item);
return srcList.push(process.env.VUE_APP_IMAGE_URL + item);
});
return srcList;
},

View File

@ -1,64 +1,89 @@
<template>
<div class="block">
<el-cascader
placeholder="车辆品牌型号"
:options="options"
v-model="selectedValues"
filterable
/>
</div>
<div class="block">
<el-select v-model="selectedValues" filterable :filter-method="getData" placeholder="车辆品牌">
<el-option v-for="item in options" :key="item.id" :value="item.id" :label="item.brandName"/>
</el-select>
<!-- <el-cascader-->
<!-- placeholder="车辆品牌型号"-->
<!-- :options="options"-->
<!-- v-model="selectedValues"-->
<!-- filterable-->
<!-- />-->
</div>
</template>
<script>
import * as CarBrandSelectorApi from '@/layout/components/CarBrandSelector/Api';
</template>
<script>
import * as CarBrandSelectorApi from '@/layout/components/CarBrandSelector/Api';
import {getCarBrandPage, getCarBrand} from '@/api/base/carbrand'
export default {
name: 'CarBrandSelector',
export default {
name: 'CarBrandSelector',
props: {
//v-model
value: {
type: Array,
default: () => [],
},
props: {
//v-model
value: {
type: [Array, String],
// default: () => [],
},
},
data() {
return {
//
selectedValues:this.value,
options: [], //
};
},
data() {
return {
//
selectedValues: this.value,
options: [], //
};
},
watch: {
value: {
immediate: true,
handler(newVal) {
watch: {
value: {
immediate: true,
handler(newVal) {
if (newVal instanceof Array) {
this.selectedValues = newVal[0]
} else {
this.selectedValues = newVal;
}
},
selectedValues(newVal) {
this.$emit('input', newVal);
this.getData(this.selectedValues)
}
},
selectedValues(newVal) {
this.$emit('input', newVal);
}
},
created() {
this.getData();
},
methods: {
getData(keyword) {
// this.reset()
let param = {
modelName: keyword,
}
CarBrandSelectorApi.searchBrand(param).then(res => {
this.options = res.data
});
},
created() {
this.getData();
},
methods: {
//
getData(keyword) {
const query = {
brandName: keyword
}
getCarBrandPage(query).then(res => {
this.options = res.data.records
})
// idIDoptions
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
// });
},
},
};
</script>
};
</script>

View File

@ -27,10 +27,15 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="品牌型号" prop="brandAndModel">
<el-form-item label="车辆品牌" prop="brandAndModel">
<CarBrandSelector v-model="formData.brandAndModel" ref="brandForm"/>
</el-form-item>
</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-form-item label="车辆类别" prop="carCategory">
<el-select v-model="formData.carCategory" placeholder="请选择车辆类别">
@ -39,6 +44,8 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="车辆性质" prop="carNature">
<el-select v-model="formData.carNature" placeholder="请选择车辆性质">
@ -47,8 +54,6 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="注册日期" prop="carRegisterDate" label-width="auto">
<el-date-picker clearable v-model="formData.carRegisterDate" type="date" value-format="timestamp"
@ -108,7 +113,9 @@
</el-form-item>
</el-col>
<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-row>
</el-collapse-item>
@ -198,8 +205,9 @@ export default {
nextInspectionDate: undefined,
nextMaintenanceDate: undefined,
nextMaintenanceMileage: undefined,
carModel: undefined
},
buttonLoading:false,
buttonLoading: false,
//
formRules: {
engineNumber: [{required: true, message: '发动机号码不能为空', trigger: 'blur'}],
@ -209,16 +217,20 @@ export default {
carNature: [{required: true, message: '车辆性质不能为空', trigger: 'blur'}],
carRegisterDate: [{required: true, message: '车辆注册日期不能为空', trigger: 'blur'}],
brandAndModel: [{required: true, message: '品牌型号不能为空', trigger: 'blur'}],
carModel: [{required: true, message: '车辆型号不能为空', trigger: 'blur'}]
},
};
},
methods: {
/**计算车辆信息*/
async compute(){
async compute() {
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;
console.log(data,'adadadad')
debugger
const res = await CarMainApi.compute(data);
const result = res.data;
@ -253,6 +265,10 @@ export default {
async submitForm() {
//
// await this.$refs["formRef"].validate();
const brand = this.formData.brandAndModel
if (typeof brand === 'string'){
this.formData.brandAndModel = [brand, this.formData?.carModel]
}
this.formLoading = true;
try {
const data = this.formData;
@ -290,6 +306,7 @@ export default {
carNature: undefined,
carRegisterDate: undefined,
carLicenseImg: undefined,
carModel: undefined
};
this.resetForm("formRef");
}

View File

@ -109,7 +109,7 @@
<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="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">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.DICT_CAR_CATEGORY" :value="scope.row.carCategory" />

View File

@ -10,8 +10,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="统一社会信用代码" prop="orgCard">
<el-input v-model="formData.orgCard" placeholder="请输入统一社会信用代码" maxlength="18"/>
<el-form-item label="企业简称" prop="simpleName">
<el-input v-model="formData.simpleName" placeholder="请输入企业简称" maxlength="255" />
</el-form-item>
</el-col>
</el-row>
@ -79,7 +79,9 @@
</el-form-item>
</el-col>
</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-option v-for="item in packageList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
@ -143,6 +145,7 @@ export default {
serviceCodes:undefined,
bankAccount: null,
account: null,
simpleName: null,
},
//
formRules: {
@ -249,6 +252,7 @@ export default {
serviceCodes:undefined,
bankAccount: null,
account: null,
simpleName: null
}
this.resetForm('formRef')
}

View File

@ -58,6 +58,7 @@
</template>
</el-table-column>
<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="right" prop="registFund" width="180"/>
<el-table-column label="注册日期" align="center" prop="registDate" width="180"/>

View File

@ -38,20 +38,20 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- <el-row :gutter="10" class="mb8">-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- :loading="exportLoading"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<div style="display: flex;justify-content:right;font-weight: bold;font-size: 16px">
@ -396,7 +396,7 @@ export default {
this.queryParams.pageNo = 1
this.queryParams.pageSize = 500
this.$modal.msgError("系统故障,联系管理员")
// const data = await exportManagement(this.queryParams)
const data = await exportManagement(this.queryParams)
// this.$download.excel(data, `_${new Date().getTime()}.xlsx`)
} catch {
} finally {

View File

@ -231,7 +231,7 @@
getList() {
this.loading = true;
listNews(this.queryParams).then(response => {
this.newsList = response.rows;
this.newsList = response.data.records;
this.total = response.total;
this.loading = false;
});

View File

@ -233,7 +233,7 @@
this.loading = true;
this.queryParams.allPlatform = '1'
listCouponTemplate(this.queryParams).then(response => {
this.couponTemplateList = response.rows;
this.couponTemplateList = response.data.records;
this.total = response.total;
this.loading = false;
});

View File

@ -258,6 +258,7 @@
},
shopconfigList: [],
shopConfig: {},
baseImageUrl: process.env.VUE_APP_FILE_API,
//
loading: true,
//
@ -429,7 +430,7 @@
this.dialogTableVisibles = true
pinglun(data).then(res=>{
console.log(res)
this.pinglunlist = res.rows
this.pinglunlist = res.data.records
this.pltotal = res.total
})
},
@ -444,7 +445,7 @@
this.dialogTableVisibles = true
pinglun(data).then(res=>{
console.log(res)
this.pinglunlist = res.rows
this.pinglunlist = res.data.records
this.pltotal = res.total
})
},
@ -469,13 +470,13 @@
this.loading = true;
listMallPartners(this.queryParams).then(response => {
this.mallPartnersList = response.rows;
this.mallPartnersList = response.data.records;
console.log('查询合作商管理列表 ',this.mallPartnersList)
this.total = response.total;
this.loading = false;
});
listCategory(this.queryParamss).then(responses => {
this.options = responses.rows;
this.options = responses.data.records;
});
},

View File

@ -183,7 +183,7 @@
getList() {
this.loading = true;
listDetail(this.queryParams).then(response => {
this.detailList = response.rows;
this.detailList = response.data.records;
this.total = response.total;
this.loading = false;
});

View File

@ -198,7 +198,7 @@
getList() {
this.loading = true;
listInfo(this.queryParams).then(response => {
this.infoList = response.rows;
this.infoList = response.data.records;
this.total = response.total;
this.loading = false;
});

View File

@ -134,7 +134,7 @@
getList() {
this.loading = true;
listFzRecord(this.queryParams).then(response => {
this.fzRecordList = response.rows;
this.fzRecordList = response.data.records;
this.total = response.total;
this.loading = false;
});

View File

@ -122,11 +122,11 @@
</el-table-column>
<!-- <el-table-column label="不参与/参与" align="center" prop="isAttend">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.yes_no" :value="scope.row.isAttend"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="不参与/参与" align="center" prop="isAttend">
<template slot-scope="scope">
<dict-tag :options="dict.type.yes_no" :value="scope.row.isAttend"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -182,7 +182,7 @@
@pagination="getList"
/>
<!-- -->
<el-dialog title="审核" :visible.sync="dialogFormVisible">
<el-form :model="froms">
@ -293,6 +293,7 @@
resource: '',
desc: ''
},
baseImageUrl:'https://www.nuoyunr.com/minio',
formLabelWidth: '120px',
sxjarr:[
{
@ -429,13 +430,13 @@
getList() {
this.loading = true;
listInspectionGoods(this.queryParams).then(response => {
this.inspectionGoodsList = response.rows;
this.inspectionGoodsList = response.data.records;
this.inspectionGoodsList.price=this.inspectionGoodsList.price / 100
this.total = response.total;
this.loading = false;
});
listMallPartners(this.hzsarr).then(response => {
this.mallPartnersList = response.rows;
this.mallPartnersList = response.data.records;
console.log('查询合作商管理列表 ',this.mallPartnersList)
});
listCategory(this.flarr).then(response => {

View File

@ -19,6 +19,9 @@
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注"/>
</el-form-item>
<!-- <el-form-item label="排序" prop="remark">-->
<!-- <el-input v-model="formData.sort" placeholder="请输入排序"/>-->
<!-- </el-form-item>-->
<el-form-item label="提成价格">
<el-table :data="tableData" style="width: 100%" height="250">
<el-table-column fixed prop="title" label="商品名称">

View File

@ -16,12 +16,12 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="创建时间" prop="createTime">-->
<!-- <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"-->
<!-- type="daterange"-->
<!-- range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"-->
<!-- :default-time="['00:00:00', '23:59:59']"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="创建时间" prop="createTime">-->
<!-- <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"-->
<!-- type="daterange"-->
<!-- range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"-->
<!-- :default-time="['00:00:00', '23:59:59']"/>-->
<!-- </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>
@ -32,7 +32,7 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
>新增
>新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
@ -50,6 +50,17 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="排序" align="center" prop="sort">
<template slot-scope="scope">
<el-input
v-model="scope.row.sort"
type="number"
style="width: 80px"
@blur="handleSortChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@ -58,10 +69,10 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
>修改
>修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
>删除
>删除
</el-button>
</template>
</el-table-column>
@ -77,7 +88,7 @@
<script>
import * as DlInspectionProjectApi from '@/api/inspection/project';
import DlInspectionProjectForm from './DlInspectionProjectForm.vue';
import {getRole} from "@/api/inspection/project";
import {getRole, updateSort} from "@/api/inspection/project";
export default {
name: "DlInspectionProject",
@ -177,6 +188,19 @@ export default {
getRoleName(id) {
const role = this.roleList.find(item => item.id === id);
return role ? role.name : '';
},
/** 排序值变化处理函数*/
async handleSortChange(row) {
console.log('本行信息:', row)
//
console.log('排序值变化:', row.sort);
//
let data = {
id: row.id,
sort: row.sort
}
let res = await DlInspectionProjectApi.updateSort(data);
this.getList()
}
}
};

View File

@ -178,4 +178,11 @@ export function delCustomerSource(id) {
method: 'post'
})
}
export function delCustomerSourceBatch(data) {
return request({
url: '/partnerOwn/partner/delCustomerSourceBatch' ,
method: 'post',
data:data
})
}

View File

@ -25,6 +25,15 @@
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-minus"
size="mini"
@click="handleDelete"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -88,7 +97,7 @@
</template>
<script>
import { getCustomerSource,addCustomerSource,delCustomerSource} from "./api/index";
import {getCustomerSource, addCustomerSource, delCustomerSource, delCustomerSourceBatch} from "./api/index";
import { getData,updateData} from "@/api/system/dict/data";
export default {
@ -232,7 +241,7 @@
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictCode)
this.ids = selection.map(item => item.id)
this.single = selection.length!=1
this.multiple = !selection.length
},
@ -270,9 +279,14 @@
},
/** 删除按钮操作 */
handleDelete(row) {
const dictCodes = row.dictCode || this.ids;
let dictCodes = []
if (row.id) {
dictCodes.push(row.id)
} else if (this.ids) {
dictCodes = this.ids
}
this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
return delCustomerSource(dictCodes);
return delCustomerSourceBatch(dictCodes);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");

View File

@ -238,7 +238,7 @@
this.queryParams.params["endNextCheckTime"] = this.daterangeNextCheckTime[1];
}
listEquInfo(this.queryParams).then(response => {
this.equInfoList = response.rows;
this.equInfoList = response.data.records;
this.total = response.total;
this.loading = false;
});

View File

@ -232,8 +232,8 @@
this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1];
}
listInspectionFile(this.queryParams).then(response => {
this.inspectionFileList = response.rows;
this.queryParams.fatherId = response.rows[0].fatherId;
this.inspectionFileList = response.data.records;
this.queryParams.fatherId = response.data.records[0].fatherId;
this.total = response.total;
this.loading = false;
});
@ -249,10 +249,10 @@
downloadFile(item) {
// <a>
// const link = document.createElement('a');
// link.href = "https://www.nuoyunr.com/cdJdc"+item.filePath; //
let href = "https://www.nuoyunr.com/minio"+item.filePath; //
// var lastIndexOf = item.filePath.lastIndexOf(".");
// link.download = item.fileName+item.filePath.substr(lastIndexOf); //
window.open(item.filePath);
window.open(href);
// //
// link.click();
},

View File

@ -305,7 +305,7 @@
</div>
</div>
</el-dialog>
<el-dialog :title="title" :visible.sync="addOpen" width="600px" append-to-body>
<el-dialog :title="title" :visible.sync="addOpen" width="600px" append-to-body @close="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="客户姓名">
@ -355,10 +355,10 @@
<el-cascader
v-model="form.skuId"
:options="options"
@change="handleChange"></el-cascader>
@change="handleChange" :disabled="!isInsert"></el-cascader>
</el-form-item>
<el-form-item label="新旧车">
<el-select v-model="form.carStatus" placeholder="请选择客户来源">
<el-select v-model="form.carStatus" placeholder="请选择新旧车">
<el-option
v-for="dict in dict.type.car_status"
:key="dict.value"
@ -367,6 +367,16 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="引车员">
<el-select v-model="form.leadManId" placeholder="请选择引车员">
<el-option
v-for="dict in leadManList"
:key="dict.id"
:label="dict.nickname"
:value="dict.id"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="请选择检测项目">-->
<!-- 可选检测项目 -->
<div v-if="isInsert">
@ -517,6 +527,7 @@ export default {
inspectionWorkNodeStr:[],
selectInspectionProjectIds:[],
isInsert: false,
leadManList:[],
//
queryParams: {
pageNum: 1,
@ -755,6 +766,7 @@ export default {
this.open = false;
this.addOpen = false;
this.reset();
this.selectInspectionProjectIds = []
},
//
reset() {
@ -809,6 +821,7 @@ export default {
handleAdd() {
this.getINspectionProject()
this.isInsert = true
this.getLeadeMan();
listGoods().then(res => {
res.data.forEach(it => {
let temp = {}
@ -834,6 +847,7 @@ export default {
handleUpdate(row) {
this.isInsert = false
this.reset();
this.getLeadeMan();
this.form = row
let skuId = parseInt(row.skuId)
this.form.skuId = [row.goodsId, skuId]
@ -858,6 +872,18 @@ export default {
this.addOpen = true;
this.title = "工单";
},
/** 获取引车员信息*/
getLeadeMan() {
request({
url: '/system/role/getUsersByRoleCode',
method: 'get',
params: {
code: "jcycy"
}
}).then(res => {
this.leadManList = res.data
})
},
/** 提交按钮 */
submitForm() {
if (this.form.id) {
@ -927,7 +953,7 @@ export default {
handleExport() {
this.download('/system/inspectionMallPartners/exportWorkOrder', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}, `info_${new Date().getTime()}.xls`)
}
}
};

View File

@ -28,7 +28,11 @@ export default {
watch: {
carSelected(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);
}
},

View File

@ -42,41 +42,41 @@
</el-form>
<!-- 操作 -->
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" plain icon="el-icon-download" size="mini"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" plain icon="el-icon-download" size="mini"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row>
<!-- 急件 -->
<!-- <el-table v-if="goodsYes" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">-->
<!-- <el-table-column label="序号" align="center">-->
<!-- <template scope="scope">-->
<!-- <span>{{ scope.$index + 1 }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="单号" align="center" prop="soId" width="200"/>-->
<!-- <el-table-column label="商品名称" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="规格" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="商品编码" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="所属分类" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="数量" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="单位" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="成本" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="供应商" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="仓库" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="状态" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="时间" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="门店" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="操作" align="center" width="180" fixed="right">-->
<!-- <template v-slot="scope">-->
<!-- <el-button size="mini" type="text" icon="el-icon-edit"-->
<!-- >审核-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <el-table v-if="goodsYes" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">-->
<!-- <el-table-column label="序号" align="center">-->
<!-- <template scope="scope">-->
<!-- <span>{{ scope.$index + 1 }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="单号" align="center" prop="soId" width="200"/>-->
<!-- <el-table-column label="商品名称" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="规格" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="商品编码" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="所属分类" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="数量" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="单位" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="成本" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="供应商" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="仓库" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="状态" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="时间" align="center" width="150" prop="name"/>-->
<!-- <el-table-column label="门店" align="center" width="180" prop="name"/>-->
<!-- <el-table-column label="操作" align="center" width="180" fixed="right">-->
<!-- <template v-slot="scope">-->
<!-- <el-button size="mini" type="text" icon="el-icon-edit"-->
<!-- >审核-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- 采购/领料 -->
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
@ -88,9 +88,11 @@
<el-table-column label="单号" align="center" prop="soNo" width="200"/>
<el-table-column label="数量" align="center" prop="itemCount" width="150"/>
<el-table-column label="金额" align="center" prop="totalPrice" width="150"/>
<el-table-column :label="soByType ? '采购员' : !isBack ? '领料人' : '退料人'" align="center" prop="userName" width="150"/>
<el-table-column :label="soByType ? '采购员' : !isBack ? '领料人' : '退料人'" align="center" prop="userName"
width="150"/>
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="200"/>
<el-table-column :label="soByType ? '入库时间' : !isBack ? '领料时间' : '退料时间'" align="center" prop="soTime" width="150"/>
<el-table-column :label="soByType ? '入库时间' : !isBack ? '领料时间' : '退料时间'" align="center" prop="soTime"
width="150"/>
<el-table-column label="登记时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
@ -108,7 +110,8 @@
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
>查看
</el-button>
<el-button @click="handleInWares(scope.row)" v-if="scope.row.soStatus === '02'" size="mini" type="text" icon="el-icon-edit-outline"
<el-button @click="handleInWares(scope.row)" v-if="scope.row.soStatus === '02'" size="mini" type="text"
icon="el-icon-edit-outline"
>入库
</el-button>
<el-button size="mini" type="text" icon="el-icon-close" @click="handleVoidSo(scope.row)"
@ -118,35 +121,113 @@
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination @pagination="pageSo" style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo"
<pagination @pagination="pageSo" style="margin-bottom: 3rem" v-show="total > 0" :total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
/>
<SoShow :so-by-type="soByType" :is-back="isBack" ref="soShow" />
<SoShow :so-by-type="soByType" :is-back="isBack" ref="soShow"/>
<el-dialog title="入库" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-table v-loading="inLoading" :data="inItems" :stripe="true" :show-overflow-tooltip="true"
@selection-change="selectRow"
@cell-mouse-enter="handleCellEnter"
@cell-mouse-leave="handleCellLeave"
@cell-click="handleCellClick"
:key="tableKey"
>
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="商品名称" align="center" prop="repairWares.name" />
<el-table-column label="商品编码" align="center" prop="repairWares.code" width="180" />
<el-table-column label="条形码" align="center" prop="repairWares.barCode" width="180" />
<el-table-column label="规格" align="center" prop="repairWares.model" width="180" />
<el-table-column label="采购数量" align="center" prop="goodsCount" width="150" />
<el-table-column label="入库数量" align="center" prop="inCount" width="150">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.inCount"/>
<span class="item__txt">{{ scope.row.inCount }}</span>
</div>
</el-table-column>
</el-table>
<el-form :inline="true">
<el-form-item label="关键字">
<el-input v-model="inItemsQuery" placeholder="名称、规格、编码"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchByQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click=resetByQuery>重置</el-button>
</el-form-item>
</el-form>
<el-collapse>
<el-collapse-item v-for="([key, value], index) in inItems" :title="key + `(${value.length})`">
<el-table v-loading="inLoading" :ref="`tableRef_${key}`" :data="value" :stripe="true"
:show-overflow-tooltip="true"
@selection-change="selectRow"
@cell-mouse-enter="handleCellEnter"
@cell-mouse-leave="handleCellLeave"
@cell-click="handleCellClick"
>
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="商品名称" align="center" prop="wares.name"/>
<el-table-column label="规格" align="center" width="180" prop="wares.model">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.model"
placeholder="请输入规格"></el-input>
<span class="item__txt">{{ scope.row.wares.model }}</span>
</div>
</el-table-column>
<el-table-column label="分类" align="center" width="180" prop="wares.type">
<div class="item" slot-scope="scope">
<el-select class="item__input" clearable ref="selectTree" v-model="scope.row.wares.type"
@change="save(scope.row)">
<el-option v-for="server in optionData(serverList)"
:key="server.value"
:label="server.label"
:value="server.value" style="display: none"/>
<el-tree class="item__input" ref="selectedTree"
:data="serverList"
:props="treeProps"
highlight-current
@node-click="handleNodeClick($event, scope.row)"
:expand-on-click-node="expandOnClickNode"
default-expand-all/>
</el-select>
<span class="item__txt">{{ getTypeById(scope.row.wares.type) }}</span>
</div>
</el-table-column>
<el-table-column label="商品编码" align="center" width="180" prop="wares.code">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.code"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.wares.code }}</span>
</div>
</el-table-column>
<el-table-column label="仓库" align="center" width="150" prop="wares.warehouse">
<div class="item" slot-scope="scope">
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.wares.ware"
/>
<span class="item__txt">{{ scope.row.wares?.ware?.name }}</span>
</div>
</el-table-column>
<el-table-column label="库存" align="center" width="150" prop="wares.stock"/>
<el-table-column label="单位" align="center" width="150" prop="wares.unit">
<div class="item" slot-scope="scope">
<el-select class="item__input" v-model="scope.row.wares.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.wares.unit"/>
</span>
</div>
</el-table-column>
<el-table-column label="进价" align="center" width="150" prop="wares.purPrice">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.purPrice"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.wares.purPrice }}</span>
</div>
</el-table-column>
<el-table-column label="售价" align="center" width="150" prop="wares.price">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.price"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.wares.price }}</span>
</div>
</el-table-column>
<el-table-column label="采购数量" align="center" prop="goodsCount" width="150"/>
<el-table-column label="入库数量" align="center" prop="inCount" width="150">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.inCount"/>
<span class="item__txt">{{ scope.row.inCount }}</span>
</div>
</el-table-column>
</el-table>
</el-collapse-item>
</el-collapse>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :disabled="selectRows.length === 0" @click="doInWares">确定</el-button>
<el-button type="primary" :disabled="allSelectRows.length === 0" @click="doInWares">确定</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
</div>
</el-dialog>
@ -161,8 +242,10 @@ import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import {DICT_TYPE} from "@/utils/dict";
import {getRepairSoPage, voidSo, getRepairSoById, inWare} from "@/api/repair/stockOperate/stockOperate";
import SoShow from "@/views/repair/stockOperate/Components/SoSow.vue";
import {getRepairSoiByIds} from "@/api/repair/stockOperate/stockOperateItem";
import {getRepairSoiByIds, getMapBySoIdAndQuery} from "@/api/repair/stockOperate/stockOperateItem";
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
import {getBaseTypeList} from "@/api/base/type";
export default {
name: "SoIndex",
@ -173,6 +256,7 @@ export default {
}
},
components: {
WarehouseChoose,
SoShow,
StaffChoose,
SupplierChoose,
@ -189,7 +273,7 @@ export default {
defaultValue: false,
required: false
},
isBack:{
isBack: {
type: Boolean
}
},
@ -235,38 +319,113 @@ export default {
total: 0,
dialogVisible: false,
inItems: [],
inItemsQuery: null,
inLoading: false,
selectRows: [],
inWaresFormData:{
inWaresFormData: {
id: null,
soiList: [],
soNo: null
},
editProp: ['inCount'],
editProp: ['inCount', 'wares.model', 'wares.type', 'wares.code', 'wares.warehouse', 'wares.unit', 'wares.purPrice', 'wares.price'],
clickCellMap: {},
tableKey: 0
tableKey: 0,
soId: null,
expandOnClickNode: true,
serverList: [],
treeProps: {
label: "name",
children: "children"
},
typeMap: null,
selectRowIds: [],
allSelectRows: [],
isRefresh: false,
}
},
mounted() {
this.pageSo();
},
methods: {
setSelectedRows() {
this.$nextTick(() => {
Object.keys(this.$refs).forEach(key => {
if (key.startsWith('tableRef_')) {
const tableRef = this.$refs[key];
if (tableRef[0]) {
tableRef[0].clearSelection(); //
this.inItems.forEach(([key, value]) => {
const ids = this.allSelectRows.map(item => item.id)
value.forEach(item => {
if (ids.includes(item.id)) {
tableRef[0].toggleRowSelection(item, true);
}
});
});
}
}
});
});
},
getDictDatasToType(type) {
return this.getDictDatas(type)
},
getTypeById(id) {
return this.typeMap.get(id)
},
async listServer() {
if (!this.serverList || this.serverList.length === 0) {
const res = await getBaseTypeList({type: "02"})
this.serverList = this.handleTree(res.data, 'id', 'parentId', "children", "0")
this.typeMap = new Map()
this.extractNodesToMap(this.serverList, this.typeMap)
}
},
extractNodesToMap(nodes, map) {
nodes.forEach(node => {
map.set(node.id, node.name);
if (node.children && node.children.length > 0) {
this.extractNodesToMap(node.children, map);
}
});
},
handleNodeClick(data, scopeRow) {
scopeRow.wares.type = data.id;
this.save(scopeRow)
},
optionData(array, result = []) {
array.forEach(item => {
result.push({label: item.name, value: item.id})
if (item.children && item.children.length !== 0) {
this.optionData(item.children, result)
}
})
return JSON.parse(JSON.stringify(result))
},
searchByQuery() {
this.isRefresh = true
this.getSoiList().then(() => {
this.setSelectedRows()
})
},
resetByQuery() {
this.allSelectRows = []
this.inItemsQuery = null
this.searchByQuery()
},
//
async pageSo() {
this.queryParams.soType = null
this.queryParams.purchaseType = null
if (this.soByType && this.goodsYes){
if (this.soByType && this.goodsYes) {
this.queryParams.soType = "03"
this.queryParams.purchaseType = "02"
}
else if (this.soByType && !this.goodsYes){
} else if (this.soByType && !this.goodsYes) {
this.queryParams.soType = "01"
this.queryParams.purchaseType = "01"
}
else if (!this.soByType && !this.isBack){
} else if (!this.soByType && !this.isBack) {
this.queryParams.soType = "02"
}
else if (this.isBack){
} else if (this.isBack) {
this.queryParams.soType = '04'
}
try {
@ -274,7 +433,7 @@ export default {
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
}finally {
} finally {
this.loading = false
}
},
@ -321,49 +480,102 @@ export default {
}
},
//
async handleShow(row){
async handleShow(row) {
const res = await getRepairSoById(row.id)
await this.$refs.soShow.open(res.data)
},
//
async handleInWares(row){
async handleInWares(row) {
this.allSelectRows = []
this.inItemsQuery = null
await this.listServer()
this.soId = row.id
this.inWaresFormData = {
id: null,
soiList: []
soiList: []
}
this.inWaresFormData['id'] = row.id
await this.getSoiList()
},
async getSoiList() {
try {
this.dialogVisible = true
this.inLoading = true
const resRow = await getRepairSoById(row.id)
const ids = resRow.data.goodsList.map(item => item.id)
const res = await getRepairSoiByIds(ids)
this.inItems = res.data
this.inItems = this.inItems.filter(item => item.inCount !== item.goodsCount)
this.inItems = [...this.inItems.map(item => {
return {
...item,
goodsCount: item.goodsCount - item?.inCount | 0,
inCount: item.goodsCount - item?.inCount | 0
}
})]
}finally {
const res = await getMapBySoIdAndQuery(this.soId, this.inItemsQuery)
this.inItems = Object.entries(res.data)
this.inItems = this.inItems.map(([key, value]) => {
return [key, value.filter(item => (!item.inCount && item.inCount !== item.goodsCount))]
})
this.inItems = this.inItems.filter(([key, value]) => value.length > 0)
this.inItems.forEach(([key, value]) => {
value.forEach(item => {
item.goodsCount = item.goodsCount - (item.inCount ? item.inCount : 0)
item.inCount = item.goodsCount
})
})
} finally {
this.inLoading = false
}
},
selectRow(val){
this.selectRows = val
selectRow(row) {
this.selectRows = row
this.selectRowIds = row.map(item => item.id)
if (row && row.length > 0) {
// allSelectRows
this.allSelectRows = [...this.allSelectRows, ...row.filter(item => !this.allSelectRows.some(allRow => allRow.id === item.id))];
} else {
//
this.allSelectRows = this.allSelectRows.filter(item => !this.selectRowIds.includes(item.id));
}
//
//
if (!this.isRefresh) {
//
// tableRef
const allRef = this.$refs
const newRef = Object.keys(allRef).filter(item => item.startsWith('tableRef_'))
newRef.forEach(tempRef => {
if (this.$refs[tempRef][0]) {
const ids = this.$refs[tempRef][0].data.map(item => item.id);
if (!row || row.length === 0) {
this.allSelectRows = this.allSelectRows.filter(item => !ids.includes(item.id))
} else {
//
const rowIds = row.map(item => item.id)
const exIds = ids.filter(id => !rowIds.includes(id))
this.allSelectRows = this.allSelectRows.filter(item => !exIds.includes(item.id))
}
}
})
}
this.isRefresh = false
//
this.allSelectRows = this.allSelectRows.reduce((acc, item) => {
const flag = acc.find(i => i.id === item.id)
if (!flag) {
return acc.concat([item])
} else {
return acc
}
}, [])
},
async doInWares(){
async doInWares() {
try {
this.inWaresFormData.soiList = this.selectRows
this.inWaresFormData.soNo = createUniqueCodeByHead("RC")
this.inWaresFormData.soiList = this.allSelectRows
this.inWaresFormData.waresList = this.allSelectRows.map(item => {
if (item.wares.ware){
item.wares.warehouse = item.wares.ware.id
}
return item.wares
})
this.inWaresFormData.soNo = createUniqueCodeByHead("RK")
this.inLoading = true
await inWare(this.inWaresFormData)
this.dialogVisible = false
this.$modal.msgSuccess("入库成功")
await this.pageSo()
}catch{}
} catch {
}
},
/** 鼠标移入cell */
handleCellEnter(row, column, cell, event) {
@ -416,8 +628,8 @@ export default {
this.cancelEditable(cell)
})
this.clickCellMap[id] = []
this.tableKey++
this.selectRows = []
// this.tableKey++
// this.selectRows = []
},
}
}

View File

@ -21,17 +21,24 @@
</template>
</el-table-column>
<el-table-column label="单据号" align="center" prop="no" width="200"/>
<el-table-column label="客户车牌" align="center" prop="licenseNumber"/>
<el-table-column label="服务顾问" align="center" prop="adviserName"/>
<el-table-column label="申请人" align="center" prop="repairName"/>
<el-table-column label="状态" align="center" prop="status">
<el-table-column label="客户信息" align="center">
<el-table-column label="姓名" align="center" prop="userName" width="180"/>
<el-table-column label="联系电话" align="center" prop="userMobile" width="180"/>
<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.TICKET_WARES_STATUS" v-model="scope.row.status"/>
<dict-tag :type="DICT_TYPE.REPAIR_WORK_TYPE" :value="scope.row.repairWork"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center">
<el-table-column label="服务顾问" align="center" prop="adviserName" width="180"/>
<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">
<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>
@ -39,11 +46,21 @@
</el-table-column>
</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"
/>
<el-dialog title="单据处理" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-form :inline="true">
<el-form-item label="名称" prop="query">
<el-input v-model="query"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchByQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click=resetByQuery>重置</el-button>
</el-form-item>
</el-form>
<el-table
@cell-mouse-enter="handleCellEnter"
@cell-mouse-leave="handleCellLeave"
@ -54,10 +71,11 @@
:row-class-name="getRowClass"
@selection-change="handleSelect"
:key="tableKey"
ref="tableRef"
>
<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="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">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
@ -77,108 +95,161 @@
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="type" @click="handlePass"
:disabled="selections.length === 0 || selections.filter(item => !item.isStock).length !== 0">
:disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0">
通知领料
</el-button>
<el-button type="primary" v-else @click="handlePass"
:disabled="selections.length === 0 || selections.filter(item => !item.isStock).length !== 0">
:disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0">
通知退料
</el-button>
<el-button v-if="type" type="primary" @click="handleCreate" :disabled="selections.length === 0">
<el-button v-if="type" type="primary" @click="handleCreate" :disabled="allSelectRows.length === 0">
采购
</el-button>
</div>
</el-dialog>
<el-dialog title="采购单" :visible.sync="inStockDialog" width="80%" v-dialogDrag append-to-body>
<el-table
:data="partList"
:stripe="true"
:show-overflow-tooltip="true"
show-summary
:summary-method="getSummaries"
@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>
<el-descriptions class="margin-top" title="车辆信息" :column="3" border>
<el-descriptions-item>
<template slot="label">
车牌号
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" prop="name" width="200"/>
<el-table-column label="规格" align="center" width="180" prop="model">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.model"
placeholder="请输入规格"></el-input>
<span class="item__txt">{{ scope.row.model }}</span>
</div>
</el-table-column>
<el-table-column label="商品编码" align="center" width="180" prop="code">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.code"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.code }}</span>
</div>
</el-table-column>
<el-table-column label="仓库" align="center" width="150" prop="warehouse">
<div class="item" slot-scope="scope">
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.ware"
@change="changeWare(scope.row)"/>
<span class="item__txt">{{ scope.row.warehouseName }}</span>
</div>
</el-table-column>
<el-table-column label="库存" align="center" width="150" prop="stock"/>
<el-table-column label="单位" align="center" width="150" prop="unit">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
{{ carInfo.licenseNumber }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
品牌
</template>
</el-table-column>
<el-table-column label="数量" align="center" width="150" prop="count">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.count"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.count }}</span>
</div>
</el-table-column>
<el-table-column label="上次进价" align="center" width="150" prop="purPrice"/>
<el-table-column label="采购单价" align="center" width="150" prop="newPrice">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.newPrice"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.newPrice }}</span>
</div>
</el-table-column>
<el-table-column label="采购金额" align="center" width="150" prop="totalPrice"/>
<el-table-column label="备注" align="center" width="180" prop="remark">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.remark }}</span>
</div>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
>删除
</el-button>
{{ carInfo.carBrand }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
型号
</template>
</el-table-column>
</el-table>
<el-row :gutter="1" style="margin-top: 1rem">
<el-col :span="24">
<el-input v-model="remark" placeholder="备注"/>
</el-col>
</el-row>
{{ carInfo.carModel }}
</el-descriptions-item>
</el-descriptions>
<el-collapse>
<el-collapse-item v-for="[key, value] in partList" :title="key + `(${value.length})`">
<el-table
:data="value"
:stripe="true"
:show-overflow-tooltip="true"
show-summary
:summary-method="getSummaries"
@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="商品名称" align="center" prop="waresName" width="200"/>
<el-table-column label="规格" align="center" width="180" prop="wares.model">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.model"
placeholder="请输入规格"></el-input>
<span class="item__txt">{{ scope.row.wares.model }}</span>
</div>
</el-table-column>
<el-table-column label="分类" align="center" width="180" prop="wares.type">
<div class="item" slot-scope="scope">
<el-select class="item__input" clearable ref="selectTree" v-model="scope.row.wares.type" @change="save(scope.row)">
<el-option v-for="server in optionData(serverList)"
:key="server.value"
:label="server.label"
:value="server.value" style="display: none"/>
<el-tree class="item__input" ref="selectedTree"
:data="serverList"
:props="treeProps"
highlight-current
@node-click="handleNodeClick($event, scope.row)"
:expand-on-click-node="expandOnClickNode"
default-expand-all />
</el-select>
<span class="item__txt">{{ getTypeById(scope.row.wares.type) }}</span>
</div>
</el-table-column>
<el-table-column label="商品编码" align="center" width="180" prop="wares.code">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.code"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.wares.code }}</span>
</div>
</el-table-column>
<el-table-column label="仓库" align="center" width="150" prop="wares.warehouse">
<div class="item" slot-scope="scope">
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.wares.ware"
@change="changeWare(scope.row)"/>
<span class="item__txt">{{ scope.row.wares?.ware?.name }}</span>
</div>
</el-table-column>
<el-table-column label="库存" align="center" width="150" prop="wares.stock"/>
<el-table-column label="单位" align="center" width="150" prop="wares.unit">
<div class="item" slot-scope="scope">
<el-select class="item__input" v-model="scope.row.wares.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.wares.unit"/>
</span>
</div>
</el-table-column>
<el-table-column label="数量" align="center" width="150" prop="waresCount">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.waresCount }}</span>
</div>
</el-table-column>
<el-table-column label="进价" align="center" width="150" prop="wares.purPrice">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.purPrice"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.wares.purPrice }}</span>
</div>
</el-table-column>
<el-table-column label="售价" align="center" width="150" prop="wares.price">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.price"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.wares.price }}</span>
</div>
</el-table-column>
<el-table-column label="总金额" align="center" width="150" prop="totalPrice"/>
<el-table-column label="备注" align="center" width="180" prop="remark">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"
placeholder="请输入内容"></el-input>
<span class="item__txt">{{ scope.row.remark }}</span>
</div>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-collapse-item>
</el-collapse>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSubmit">确定</el-button>
<el-button type="primary" @click="handleSubmit">保存</el-button>
<el-button @click="inStockDialog = false">取消</el-button>
</div>
</el-dialog>
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/>
</div>
</template>
<script>
import {getPage, pass, passBackTicketWares} from "@/api/repair/tickets/TicketWares";
import {getPage, pass, passBackTicketWares, getByIds} from "@/api/repair/tickets/TicketWares";
import {listTwItem} from "@/api/repair/tickets/TWItem";
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
import {parseTime} from "@/utils/ruoyi";
@ -186,10 +257,15 @@ import SoTable from "@/views/repair/stockOperate/Components/SoTable.vue";
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
import {getUserProfile} from "@/api/system/user";
import TicketWaresShow from "@/views/repair/tickets/Components/TicketWaresShow.vue";
import {getCusAndCarById} from "@/api/repair/tickets/Tickets";
import {getCarBrand} from "@/api/base/carbrand";
import {listGoods} from "@/views/partner/api/workOrder";
import {getBaseTypeList} from "@/api/base/type";
export default {
name: "WaresItem",
components: {WarehouseChoose, SoTable},
components: {TicketWaresShow, WarehouseChoose, SoTable},
props: {
type: Boolean,
},
@ -199,8 +275,7 @@ export default {
pageNo: 1,
pageSize: 10,
query: null,
type: "01",
isBack: this.type ? null : true
isBack: !this.type,
},
showSearch: true,
loading: false,
@ -210,22 +285,97 @@ export default {
items: [],
dialogLoading: false,
selections: [],
selectionIds: [],
formData: {},
inStockDialog: false,
partList: [],
includeColumn: ['count', 'totalPrice'],
includeColumn: ['waresCount', 'totalPrice'],
// cell
clickCellMap: {},
//
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model'],
editProp: ['wares.warehouse', 'wares.type', 'waresCount', 'wares.purPrice', 'wares.price', 'remark', 'wares.code', 'waresCount', 'wares.model', 'wares.unit'],
remark: null,
tableKey: 0,
query: null,
twId: null,
carInfo: {},
ticketId: null,
expandOnClickNode: true,
serverList: [],
treeProps:{
label: "name",
children: "children"
},
typeMap: null,
allSelectRows: [],
isRefresh: false
}
},
mounted() {
this.getList()
},
methods: {
getTypeById(id){
return this.typeMap.get(id)
},
async listServer(){
if (!this.serverList || this.serverList.length === 0){
const res = await getBaseTypeList({type: "02"})
this.serverList = this.handleTree(res.data, 'id', 'parentId',"children","0")
this.typeMap = new Map()
this.extractNodesToMap(this.serverList, this.typeMap)
}
},
extractNodesToMap(nodes, map) {
nodes.forEach(node => {
map.set(node.id, node.name);
if (node.children && node.children.length > 0) {
this.extractNodesToMap(node.children, map);
}
});
},
handleNodeClick(data, scopeRow){
scopeRow.wares.type = data.id;
this.save(scopeRow)
},
optionData(array, result=[]){
array.forEach(item => {
result.push({label: item.name, value: item.id})
if (item.children && item.children.length !== 0){
this.optionData(item.children, result)
}
})
return JSON.parse(JSON.stringify(result))
},
searchByQuery() {
this.isRefresh = true
const data = {
twId: this.twId,
query: this.query
}
this.getTwitemList(data).then(() => {
this.setSelectedRows();
})
},
setSelectedRows() {
this.$nextTick(() => {
this.$refs.tableRef.clearSelection(); //
const ids = this.allSelectRows.map(item => item.id)
this.items.forEach(row => {
if (ids.includes(row.id)) {
this.$refs.tableRef.toggleRowSelection(row, true); //
}
});
});
},
resetByQuery() {
this.allSelectRows = []
this.query = null
this.searchByQuery()
},
getDictDatasToType(type) {
return this.getDictDatas(type)
},
// truefalse
async handlePass() {
// 退
@ -238,7 +388,7 @@ export default {
soStatus: this.type ? "04" : "07",
// purchaseType: "01"
}
this.formData.repairSois = [...this.selections.map(item => {
this.formData.repairSois = [...this.allSelectRows.map(item => {
return {
soiType: this.type ? '02' : "04",
goodsId: item.waresId,
@ -246,7 +396,7 @@ export default {
}
})]
if (this.type) {
this.formData.items = [...this.selections.map(item => {
this.formData.items = [...this.allSelectRows.map(item => {
return {
id: item.id,
}
@ -262,16 +412,26 @@ export default {
},
// truefalse
async handleCreate() {
this.inStockDialog = true
this.partList = [...this.selections.map(item => {
return {
...item.wares,
count: item.waresCount,
newPrice: item.wares.purPrice,
totalPrice: item.waresCount * item.wares.purPrice
try {
const carRes = await getCusAndCarById(this.ticketId)
this.carInfo = carRes.data.carInfo
if (this.carInfo.carBrand) {
const brandRes = await getCarBrand(this.carInfo.carBrand)
this.carInfo.carBrand = brandRes.data.brandName
}
})]
this.dialogVisible = false
const ids = this.allSelectRows.map(item => item.id)
const res = await getByIds(ids)
this.partList = Object.entries(res.data)
const values = this.partList.map(([key, value]) => value)
values.forEach(item => {
item.forEach(i => {
i.totalPrice = i.waresCount * i.wares.price
})
})
this.inStockDialog = true
this.dialogVisible = false
} catch {
}
},
async getList() {
try {
@ -293,28 +453,32 @@ export default {
this.resetForm('queryForm')
this.handleQuery()
},
async handleDispose(row) {
handleDispose(row) {
this.allSelectRows = []
this.query = null
this.listServer()
this.formData = {}
this.formData = {
...row
}
this.dialogVisible = true
const data = {twId: row.id}
this.twId = row.id
this.ticketId = row.ticketId
this.getTwitemList(data)
},
async getTwitemList(data) {
try {
this.dialogLoading = true
const data = {twId: row.id}
const res = await listTwItem(data)
this.items = res.data
this.items = this.items.filter(item => item.waresStatus === '1')
this.items.forEach(item => {
const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
item.waresCount = this.type ? count : item.waresAlreadyCount
item.isStock = this.type ? count <= item.wares.stock : true
})
this.items = this.items.filter(item => this.type ? item.waresStatus === '02' : item.waresAlreadyCount)
if (!this.type) {
this.items = this.items.filter(item => item.waresAlreadyCount !== item.waresBackCount)
}
} finally {
this.dialogLoading = false
this.items = this.items.filter(item => this.type ? item.waresCount > 0 : item.waresAlreadyCount > 0)
} catch {
}
},
getRowClass(row) {
@ -325,6 +489,33 @@ export default {
},
handleSelect(row) {
this.selections = row
this.selectionIds = row.map(item => item.id);
//
this.allSelectRows = [...this.allSelectRows, ...row]
//
//
if (!this.isRefresh){
//
const ids = this.$refs.tableRef.data.map(item => item.id);
if (!row || row.length === 0){
this.allSelectRows = this.allSelectRows.filter(item => !ids.includes(item.id))
}else {
//
const rowIds = row.map(item => item.id)
const exIds = ids.filter(id => !rowIds.includes(id))
this.allSelectRows = this.allSelectRows.filter(item => !exIds.includes(item.id))
}
}
this.isRefresh = false
//
this.allSelectRows = this.allSelectRows.reduce((acc, item) => {
const flag = acc.find(i => i.id === item.id)
if (!flag){
return acc.concat([item])
}else {
return acc
}
}, [])
},
//
getSummaries(param) {
@ -401,7 +592,13 @@ export default {
this.$modal.msgWarning("退料数量不能超过领取数量")
row.waresCount = row.waresAlreadyCount
}
row.totalPrice = row.count * row.newPrice
this.partList.forEach(([key, value]) => {
const flag = value.findIndex(f => f.id === row.id)
if (flag !== -1){
row.totalPrice = row.waresCount * row.wares.price
this.$set(value, flag, row)
}
})
const id = row.id
// cell
this.clickCellMap[id].forEach(cell => {
@ -412,11 +609,11 @@ export default {
this.tableKey++
},
changeWare(row) {
if (row.ware) {
row['wareId'] = row.ware.id
row['warehouse'] = row.ware.id
row['warehouseName'] = row.ware.name
}
// if (row.wares.ware) {
// row['wareId'] = row.ware.id
// row['warehouse'] = row.ware.id
// row['warehouseName'] = row.ware.name
// }
},
//
deleteItem(index) {
@ -425,12 +622,12 @@ export default {
//
async handleSubmit() {
try {
const isNull = this.validateNull();
if (!isNull) return;
const names = this.validateZero()
if (names){
await this.$modal.confirm("确认配件:" + names + "的采购价格为0吗")
}
// const isNull = this.validateNull();
// if (!isNull) return;
// const names = this.validateZero()
// if (names) {
// await this.$modal.confirm("" + names + "0")
// }
await this.createInit()
await createRepairSo(this.formData)
this.inStockDialog = false
@ -441,6 +638,7 @@ export default {
},
//
async createInit() {
const values = this.partList.map(([key, value]) => value).reduce((acc, value) => acc.concat(value))
const res = await getUserProfile()
this.formData = {}
this.formData = {
@ -450,53 +648,62 @@ export default {
userId: res.data.id,
userName: res.data.nickname,
soTime: parseTime(Date.now(), '{y}-{m}-{d}'),
itemCount: this.partList.length,
totalPrice: this.partList.reduce((x, y) => {
itemCount: values.length,
totalPrice: values.reduce((x, y) => {
return x + y.totalPrice
}, 0),
soStatus: "02",
remark: this.remark,
}
this.formData.goodsList = [...this.partList.map(item => {
this.formData.goodsList = [...values.map(item => {
return {
soiType: '01',
goodsId: item.id,
goodsId: item.wares.id,
goodsType: '0',
wareId: item?.wareId,
goodsCount: item.count,
goodsPrice: item.newPrice,
wareId: item.wares?.ware?.id,
goodsCount: item.waresCount,
goodsPrice: item.wares.price,
remark: item.remark
}
})]
this.formData.waresList = [...values.map(item => {
if (item.wares.ware){
item.wares.warehouse = item.wares.ware.id
}
return item.wares
})]
},
validateNull(){
validateNull() {
const flag = this.partList.map(item => {
const price = item.newPrice
if (price === null || price === ""){
if (price === null || price === "") {
this.$modal.msgError("配件:" + item.name + "采购价格为空")
return false
}else {
} else {
return true
}
})
let count = 0
flag.forEach(item => {
if (!item){
if (!item) {
count++
}
})
return count === 0
},
validateZero(){
validateZero() {
const flag = this.partList.map(item => {
const price = parseFloat(item.newPrice)
if (price === 0){
if (price === 0) {
return item.name
}else {
} else {
return ""
}
})
return flag.filter(item => item !== "").join(",")
},
handleView(row) {
this.$refs.ticketWaresShow.open(row)
}
}
}

View 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>

View File

@ -10,7 +10,7 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="getLabelName" width="200" prop="goods">
<el-table-column align="center" :label="getLabelName" width="180" prop="goods">
<div class="item" slot-scope="scope">
<ProjectChoose v-if="itemType === 'project'" @input-blur="save(scope.row)" class="item__input"
@selected="getPart" :select-width="'15rem'"/>
@ -29,76 +29,76 @@
<!-- <span class="item__txt">{{ get }}</span>-->
<!-- </div>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="规格" width="180" prop="model"/>
<el-table-column align="center" label="编码" width="180" prop="code"/>
<el-table-column align="center" label="数量" width="180" prop="count">
<el-table-column align="center" label="规格" width="100" prop="model"/>
<el-table-column align="center" label="编码" width="100" prop="code"/>
<el-table-column align="center" label="数量" width="80" prop="count">
<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 align="center" label="单位" width="180" prop="unit">
<el-table-column align="center" label="单位" width="80" prop="unit">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
</template>
</el-table-column>
<el-table-column v-if="!exportColumn.includes('price')" align="center" label="单价" width="180" prop="price">
<el-table-column v-if="!exportColumn.includes('price')" align="center" label="单价" width="100" prop="price">
<div v-if="scope.row.id" class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.price"/>
<span class="item__txt">{{ scope.row.price }}</span>
</div>
</el-table-column>
<el-table-column v-if="!exportColumn.includes('discount')" align="center" label="折扣" width="180" prop="discount">
<el-table-column v-if="!exportColumn.includes('discount')" align="center" label="折扣" width="80" prop="discount">
<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"/>-->
<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>
</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="80" prop="totalPrice">
<div v-if="scope.row.id" class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.totalPrice"/>
<span class="item__txt">{{ scope.row.totalPrice }}</span>
</div>
</el-table-column>
<el-table-column v-if="!exportColumn.includes('repair')" align="center" label="施工人员" width="180" prop="repair">
<el-table-column v-if="!exportColumn.includes('repair')" align="center" label="施工人员" width="100" prop="repair">
<div v-if="scope.row.id" class="item" slot-scope="scope">
<WorkerChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.repair"
:select-width="'15rem'"/>
<span class="item__txt">{{ scope.row.repair ? getRepairName(scope.row.repair) : scope.row.repair }}</span>
</div>
</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="100" prop="sale">
<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"
:select-width="'15rem'" :is-get="scope.row.id"/>
<span class="item__txt">{{ scope.row.sale ? scope.row.sale.name : scope.row.sale }}</span>
</div>
</el-table-column>
<el-table-column v-if="!exportColumn.includes('type')" align="center" label="类型" width="180" prop="type">
<div v-if="scope.row.id" class="item" slot-scope="scope">
<ServerChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.type"/>
<span class="item__txt">{{ scope.row.type }}</span>
</div>
</el-table-column>
<el-table-column v-if="!exportColumn.includes('accountType')" align="center" label="账类" width="180" prop="accountType">
<div v-if="scope.row.id" class="item" slot-scope="scope">
<el-select v-model="scope.row.accountType" class="item__input" @blur="save(scope.row)">
<el-option v-for="item in getDict(DICT_TYPE.REPAIR_PAY_TYPE)" :key="item.value" :label="item.label"
:value="item.value"/>
</el-select>
<dict-tag class="item__txt" :type="DICT_TYPE.REPAIR_PAY_TYPE" v-model="scope.row.accountType"/>
</div>
</el-table-column>
<el-table-column v-if="!exportColumn.includes('itemStatus')" align="center" label="状态" width="180" prop="itemStatus">
<div v-if="scope.row.id" class="item" slot-scope="scope">
<el-select v-model="scope.row.itemStatus" class="item__input" @blur="save(scope.row)">
<el-option v-for="item in getDict(DICT_TYPE.REPAIR_ITEM_STATUS)" :key="item.value" :label="item.label"
:value="item.value"/>
</el-select>
<dict-tag class="item__txt" :type="DICT_TYPE.REPAIR_ITEM_STATUS" v-model="scope.row.itemStatus"/>
</div>
</el-table-column>
<!-- <el-table-column v-if="!exportColumn.includes('type')" align="center" label="类型" width="180" prop="type">-->
<!-- <div v-if="scope.row.id" class="item" slot-scope="scope">-->
<!-- <ServerChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.type"/>-->
<!-- <span class="item__txt">{{ scope.row.type }}</span>-->
<!-- </div>-->
<!-- </el-table-column>-->
<!-- <el-table-column v-if="!exportColumn.includes('accountType')" align="center" label="账类" width="180" prop="accountType">-->
<!-- <div v-if="scope.row.id" class="item" slot-scope="scope">-->
<!-- <el-select v-model="scope.row.accountType" class="item__input" @blur="save(scope.row)">-->
<!-- <el-option v-for="item in getDict(DICT_TYPE.REPAIR_PAY_TYPE)" :key="item.value" :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<!-- <dict-tag class="item__txt" :type="DICT_TYPE.REPAIR_PAY_TYPE" v-model="scope.row.accountType"/>-->
<!-- </div>-->
<!-- </el-table-column>-->
<!-- <el-table-column v-if="!exportColumn.includes('itemStatus')" align="center" label="状态" width="180" prop="itemStatus">-->
<!-- <div v-if="scope.row.id" class="item" slot-scope="scope">-->
<!-- <el-select v-model="scope.row.itemStatus" class="item__input" @blur="save(scope.row)">-->
<!-- <el-option v-for="item in getDict(DICT_TYPE.REPAIR_ITEM_STATUS)" :key="item.value" :label="item.label"-->
<!-- :value="item.value"/>-->
<!-- </el-select>-->
<!-- <dict-tag class="item__txt" :type="DICT_TYPE.REPAIR_ITEM_STATUS" v-model="scope.row.itemStatus"/>-->
<!-- </div>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="备注" width="180" prop="remark">
<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"/>

View File

@ -31,14 +31,10 @@
</el-table-column>
<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="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="itemDiscount" />
<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="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" fixed="right" v-if="isEdit && list.length > 0">
<template slot-scope="scope">
@ -68,7 +64,7 @@
</el-row>
<el-row :gutter="2">
<el-col :span="12">
<el-form-item label="销售人员" prop="saleName">
<el-form-item label="服务顾问" prop="saleName">
<el-input v-model="item.saleName" disabled />
</el-form-item>
</el-col>

View File

@ -39,7 +39,7 @@
<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="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">
<!-- 都有 -->
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
@ -104,6 +104,16 @@
</el-dropdown>
</template>
</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>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"

View File

@ -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" />-->
@ -59,46 +59,48 @@
</template>
</el-table-column>
<el-table-column label="订单编号" align="center" prop="ticketNo" width="200"/>
<el-table-column label="维修类别" align="center" prop="repairType" width="180">
<el-table-column label="维修类别" align="center" prop="repairType" width="100">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="scope.row.repairType"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="ticketsWorkStatus" width="180">
<el-table-column label="状态" align="center" prop="ticketsWorkStatus" width="80">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_WORK_STATUS" v-model="scope.row.ticketsWorkStatus"/>
</template>
</el-table-column>
<el-table-column label="客户名称" align="center" prop="userName" 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="userMobile" width="180"/>
<el-table-column label="客户信息" align="center">
<el-table-column label="客户名称" align="center" prop="userName" width="100"/>
<el-table-column label="车牌号" align="center" prop="carNo" width="100"/>
<el-table-column label="车系" align="center" prop="carBrandName" width="100"/>
<el-table-column label="手机号" align="center" prop="userMobile" width="110"/>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column label="预计完工" align="center" prop="outTime" width="180">
<template slot-scope="scope">
{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column label="合计金额" align="center" prop="totalPrice" width="180"/>
<el-table-column label="参考成本" align="center" prop="cost" width="180"/>
<el-table-column label="参考毛利" align="center" prop="profit" width="180"/>
<el-table-column label="领料状态" align="center" prop="partStatus" width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="scope.row.partStatus"/>
</template>
</el-table-column>
<el-table-column label="服务顾问" align="center" prop="adviserName" width="180"/>
<!-- <el-table-column label="预计完工" align="center" prop="outTime" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- {{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="合计金额" align="center" prop="totalPrice" width="80"/>
<el-table-column label="参考成本" align="center" prop="cost" width="80"/>
<el-table-column label="参考毛利" align="center" prop="profit" width="80"/>
<!-- <el-table-column label="领料状态" align="center" prop="partStatus" width="80">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="scope.row.partStatus"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="服务顾问" align="center" prop="adviserName" width="100"/>
<el-table-column label="备注" align="center" prop="remark" width="180"/>
<el-table-column label="所属门店" align="center" prop="corpId" width="180"/>
<el-table-column label="工单状态" align="center" prop="ticketsStatus" width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="scope.row.ticketsStatus"/>
</template>
</el-table-column>
<!-- <el-table-column label="工单状态" align="center" prop="ticketsStatus" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="scope.row.ticketsStatus"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right" align="center" width="230">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
@ -282,7 +284,7 @@ export default {
try {
await this.$refs['formRef'].validate()
await setTicketsPaid(this.formData)
this.$modal.msgSuccess("结算成功")
this.$modal.msgSuccess(this.formData.payType === '01' ? "等待客户支付" : "结算成功")
this.dialogVisible = false
this.$emit("setVoid")
}catch{}

View File

@ -5,12 +5,21 @@
<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="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 label="车牌号" prop="licenseNumber">
<el-input style="width: 20rem" type="text" placeholder="车牌号" v-model="queryParams.licenseNumber" />
</el-form-item>
<el-form-item label="手机号" prop="userMobile">
<el-input style="width: 20rem" type="text" placeholder="手机号" v-model="queryParams.userMobile" />
</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-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
@ -20,30 +29,41 @@
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" align="center" width="80">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单据号" align="center" prop="no"/>
<el-table-column label="客户车牌" align="center" prop="licenseNumber" />
<el-table-column label="服务顾问" align="center" prop="adviserName"/>
<el-table-column label="申请人" align="center" prop="repairName"/>
<el-table-column label="状态" align="center" prop="status">
<el-table-column label="单据号" align="center" prop="no" width="200"/>
<el-table-column label="客户信息" align="center">
<el-table-column label="姓名" align="center" prop="userName" width="180"/>
<el-table-column label="联系电话" align="center" prop="userMobile" width="180"/>
<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">
<dict-tag :type="DICT_TYPE.TICKET_WARES_STATUS" v-model="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center">
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip width="200"/>
<el-table-column label="操作" align="center" fixed="right" width="180">
<template slot-scope="scope">
<el-button v-if="scope.row.status !== '01' || userRole !== 'service_advisor'" type="text" size="mini"
icon="el-icon-view" @click="handleShow(scope.row)">
<el-button type="text" size="mini"
icon="el-icon-view" @click="handleShow(scope.row, false)">
查看
</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">
审核
</el-button>
@ -61,7 +81,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@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-table el-table v-loading="dialogLoading" :data="items" :stripe="true" :show-overflow-tooltip="true"
@ -101,8 +121,9 @@ export default {
pageNo: 1,
pageSize: 10,
query: null,
type: this.type ? "01" : "02",
status: "01"
licenseNumber: null,
userMobile: null,
repairName: null
},
showSearch: true,
loading: false,
@ -113,7 +134,8 @@ export default {
items: [],
selections: [],
formData: {},
dialogTitle: ""
dialogTitle: "",
newType: false
}
},
mounted() {
@ -140,11 +162,12 @@ export default {
this.resetForm('queryForm')
this.handleQuery()
},
handleShow(row) {
handleShow(row, type) {
this.newType = type
this.$refs.ticketWaresShow.open(row)
},
handleAudit(row) {
this.handleShow(row)
this.handleShow(row, true)
},
async handleGet(row) {
this.formData = {

View File

@ -1,39 +1,48 @@
<template>
<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">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>工单信息</span>
<span>客户信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-descriptions class="margin-top" :column="4" :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 class="margin-top" :column="2" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
车牌号
@ -48,161 +57,160 @@
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
手机号
姓名
</template>
{{ info.userMobile }}
{{ this.formData.userName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
创建时间
电话
</template>
{{ parseTime(info.createTime, '{y}-{m}-{d}') }}
</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 }}
{{ this.formData.userMobile }}
</el-descriptions-item>
</el-descriptions>
</div>
</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">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>配件信息</span>
<div v-if="type" style="float: right; padding: 3px 0">
<el-button size="small" type="primary" @click="handleAddWares">
添加配件
</el-button>
<el-button size="small" type="primary" @click="handleSetting">
移交保险公司
</el-button>
</div>
</div>
<!-- 卡片内容 -->
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
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"
<div v-show="type">
<el-table v-loading="loading" :data="items" :stripe="true" :show-overflow-tooltip="true" @selection-change="selectRows"
@cell-mouse-enter="handleCellEnter"
@cell-mouse-leave="handleCellLeave"
@cell-click="handleCellClick"
>
<el-table-column label="序号" 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 type="selection" align="center" width="80"/>
<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 v-if="userRole === 'service_advisor' && type" label="销售价格" align="center" prop="wares.price" 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.wares.price"/>
<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 label="销售价格" align="center" prop="wares.price" width="180">-->
<!-- <div class="item" slot-scope="scope">-->
<!-- <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.price"/>-->
<!-- <span class="item__txt">{{ scope.row.wares.price }}</span>-->
<!-- </div>-->
<!-- </el-table-column>-->
<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 v-if="userRole === 'service_advisor' && type" label="折扣" align="center"
prop="itemDiscount" width="180">
<!-- <div v-if="formData.status === '01'" class="item" slot-scope="scope">-->
<!--&lt;!&ndash; <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>&ndash;&gt;-->
<!-- <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 slot-scope="scope">
<span>{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>
</div>
<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="状态" align="center" prop="waresStatus" width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.TW_ITEM_STATUS" :value="scope.row.waresStatus"/>
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark" width="180" :show-overflow-tooltip="true"/>
<el-table-column label="审核人" prop="handleName" align="center"/>
</el-table>
</div>
</el-card>
<div slot="footer" class="dialog-footer"
v-if="info.status === '01' && (userRole === 'service_advisor' || userRole === 'general_inspection')">
<el-button type="primary" @click="handleAudit(true)"> </el-button>
<el-button @click="handleAudit(false)"> </el-button>
v-if="info.status === '01' && type" v-hasPermi="['repair:tw:audit']">
<el-button :disabled="this.items.length === 0" type="primary" @click="handleAudit(true)">{{this.selectRow.length > 0 ? "通过" : "通过全部"}}</el-button>
<el-button :disabled="this.items.length === 0" @click="handleAudit(false)">{{this.selectRow.length > 0 ? "驳回" : "驳回全部"}}</el-button>
</div>
</el-dialog>
<TWIAdd ref="twiAdd" @success="handleSuccess" />
<el-dialog title="设置" width="40%" :visible.sync="settingDialog" v-dialogDrag append-to-body>
<el-form v-model="settingForm" :inline="true" label-width="20rem">
<el-row :gutter="1">
<el-col :span="24">
<el-form-item label="是否传给保险公司" prop="toSafe">
<el-switch
v-model="settingForm.toSafe"
active-text="是"
active-value="1"
inactive-text="否"
inactive-value="0"
>
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="1">
<el-col :span="24">
<el-form-item label="保险公司名称" prop="safeName">
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeName" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="1">
<el-col :span="24">
<el-form-item label="联系人" prop="safeContact">
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeContact" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="1">
<el-col :span="24">
<el-form-item label="联系电话" prop="safeMobile">
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeMobile" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSetting">确认</el-button>
<el-button @click="settingDialog = false" >取消</el-button>
</div>
</el-dialog>
</div>
@ -210,14 +218,17 @@
<script>
import {getTicketsById} from "@/api/repair/tickets/Tickets";
import {auditTicketWares} from "@/api/repair/tickets/TicketWares";
import {auditTicketWares, updateSafe, getById} from "@/api/repair/tickets/TicketWares";
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.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 {
name: "TicketWaresShow",
components: {DiscountInput},
components: {TWIAdd, DiscountInput},
props: {
userRole: String,
type: Boolean
@ -237,31 +248,87 @@ export default {
formData: {},
clickCellMap: {},
editProp: ['wares.price'],
dialogLoading: null,
selectRow:[],
imageUrls: [],
settingDialog: false,
settingForm: {
safeName: null,
safeContact: null,
safeMobile: null,
toSafe: null,
id: null
}
}
},
methods: {
async doSetting(){
try {
await updateSafe(this.settingForm)
this.settingDialog = false
this.$modal.msgSuccess("设置成功")
await this.open(this.formData)
}catch{}
},
async handleSetting(){
try {
const res = await getById(this.formData.id)
this.settingForm.id = this.formData.id
this.settingForm.toSafe = res.data.toSafe
this.settingForm.safeName = res.data.safeName
this.settingForm.safeContact = res.data.safeContact
this.settingForm.safeMobile = res.data.safeMobile
this.settingDialog = true
}catch{}
},
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) {
if (row) {
this.formData = row
const res = await getTicketsById(row.ticketId)
this.info = res.data
this.info.status = row.status
this.queryParams.twId = row.id
await this.getTwItem()
try {
this.items = []
this.dialogVisible = true
this.dialogLoading = this.$loading({
target: this.$refs.dialogRef.$el
})
if (row) {
this.formData = row
const res = await getTicketsById(row.ticketId)
this.info = res.data
this.info.status = row.status
this.queryParams.twId = row.id
await this.getTwItem()
}
if (this.formData.images){
this.getImages(this.formData.images)
}
} finally {
this.dialogLoading.close()
}
this.dialogVisible = true
},
async getTwItem() {
try {
this.loading = true
const res = await listTwItem(this.queryParams)
this.items = res.data
this.items = [...this.items.map(item => {
return {
...item,
itemDiscount: 1,
if (res.data && res.data.length > 0){
this.items = res.data
this.items = [...this.items.map(item => {
return {
...item,
itemDiscount: 1,
}
})]
if (this.type){
this.items = [...this.items.filter(item => item.waresStatus === "")]
}
})]
}
} finally {
this.loading = false
}
@ -273,50 +340,40 @@ export default {
this.resetForm('queryForm')
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) {
try {
const isNull = this.validateNull();
if (!isNull) return;
const names = this.validateZero()
if (names){
await this.$modal.confirm("确认配件:" + names + "的销售价格为0吗")
}
this.formData['status'] = flag ? "02" : '05'
// const isNull = this.validateNull();
// if (!isNull) return;
// const names = this.validateZero()
// if (names) {
// await this.$modal.confirm("" + names + "0")
// }
this.dialogLoading = this.$loading({
target: this.$refs.dialogRef.$el
})
this.formData['status'] = flag ? "01" : '02'
//
this.formData.wares = [...this.items.map(item => {
return {
itemName: item.waresName,
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
}
})]
if (this.selectRow && this.selectRow.length > 0){
this.formData.items = [...this.selectRow.map(item => {
return {
id: item.id
}
})]
}else {
this.formData.items = [...this.items.map(item => {
return {
id: item.id
}
})]
}
await auditTicketWares(this.formData)
this.dialogVisible = false
this.$modal.msgSuccess("审核成功")
this.$emit('success')
} catch {
} finally {
this.dialogLoading.close()
}
},
/** 鼠标移入cell */
handleCellEnter(row, column, cell, event) {
@ -374,34 +431,41 @@ export default {
})
this.clickCellMap[id] = []
},
validateNull(){
validateNull() {
const flag = this.items.map(item => {
const price = item.wares.price
if (price === null || price === ""){
if (price === null || price === "") {
this.$modal.msgError("配件:" + item.waresName + "销售价格为空")
return false
}else {
} else {
return true
}
})
let count = 0
flag.forEach(item => {
if (!item){
if (!item) {
count++
}
})
return count === 0
},
validateZero(){
validateZero() {
const flag = this.items.map(item => {
const price = parseFloat(item.wares.price)
if (price === 0){
if (price === 0) {
return item.waresName
}else {
} else {
return ""
}
})
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
}
}
}

View File

@ -174,12 +174,12 @@
<i class="el-icon-plus"/>
<span>材料信息</span>
<el-switch v-if="userRole === 'service_advisor'" style="float: right; padding: 3px 0"
v-model="info.partShow"
active-text="客户可见"
inactive-text="客户不可见"
active-value="1"
inactive-value="0"
@change="changeShow"
v-model="info.partShow"
active-text="客户可见"
inactive-text="客户不可见"
active-value="1"
inactive-value="0"
@change="changeShow"
>
</el-switch>
</div>
@ -199,6 +199,29 @@
<TicketItemShow :list="others" list-type="other"/>
</div>
</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">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
@ -212,7 +235,7 @@ import {getTicketsById, updateShow} from "@/api/repair/tickets/Tickets";
export default {
name: "TicketsShow",
props:{
props: {
userRole: String
},
components: {TicketItemShow},
@ -222,23 +245,44 @@ export default {
info: {},
projects: [],
wares: [],
others: []
others: [],
allList: [],
totalCount: 0,
totalMoney: 0
}
},
methods: {
async open(row) {
this.reset()
const res = await getTicketsById(row.id)
const data = res.data.items
this.projects = data.filter(item => item.project)
this.wares = data.filter(item => item.ware)
this.others = data.filter(item => item.other)
this.allList = res.data.items
this.computed()
this.projects = this.allList.filter(item => item.project)
this.wares = this.allList.filter(item => item.ware)
this.others = this.allList.filter(item => item.other)
this.info = row
this.dialogVisible = true
},
async changeShow(){
async changeShow() {
try {
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)
}
}
}
}

View File

@ -225,11 +225,14 @@
<el-button size="small" v-if="formData.ticketType === '02'" @click="formData.ticketType = '01'">B单</el-button>
</el-col>
</el-row>
<span style="font-size: 16px">维修项目</span>
<TicketItem item-type="project" :in-list-data="projectList" @tableData="projectData" ref="projectTable"
:coupon-list="couponList" @changeCoupon="changeCoupon"/>
<span style="font-size: 16px; margin:1rem 0" v-if="createTicketType">维修配件</span>
<TicketItem v-if="createTicketType" :in-list-data="partList" item-type="part" @tableData="partData"
:coupon-list="couponList" @changeCoupon="changeCoupon"
ref="partTable"/>
<span style="font-size: 16px" v-if="createTicketType">其他</span>
<TicketItem v-if="createTicketType" :in-list-data="otherList" item-type="other" @tableData="otherData"
:coupon-list="couponList" @changeCoupon="changeCoupon"
ref="otherTable"/>
@ -272,8 +275,9 @@
</el-descriptions>
</el-col>
<el-col v-else :span="8" style="margin-top:1rem;display: flex;justify-content: right">
<el-button type="danger">结算</el-button>
<el-button type="warning" @click="handlePendingSave">挂单</el-button>
<el-button type="success" @click="handleSave" :disabled="isEnable">完成</el-button>
<!-- <el-button type="danger">结算</el-button>-->
<!-- <el-button type="warning" @click="handlePendingSave">挂单</el-button>-->
</el-col>
</el-row>
<el-row v-if="createTicketType" :gutter="2">
@ -556,7 +560,7 @@ export default {
}
this.selectUser = {}
this.selectCar = {}
this.selectStaff = {}
// this.selectStaff = {}
this.projectList = []
this.partList = []
this.otherList = []
@ -619,7 +623,7 @@ export default {
case "03":
message += "其他:"
}
this.$modal.msgError(message + item.itemName + (!item.repairIds ? "施工人员" : "销售人员") + "不能为空")
this.$modal.msgError(message + item.itemName + (!item.repairIds ? "施工人员" : "服务顾问") + "不能为空")
count++
}
})

View File

@ -1,6 +1,6 @@
<template>
<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">
<TicketManagerItem :is-type="'all'" :user-role="userRole"/>
</el-tab-pane>
@ -20,6 +20,11 @@
<GetAndBackWares :type="false" />
</el-tab-pane>
</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>
</template>

View File

@ -162,7 +162,7 @@
</el-descriptions>
</div>
</el-card>
<el-card class="box-card">
<el-card class="box-card" v-if="userRole !== 'repair_warehouse'">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
@ -178,13 +178,13 @@
<TicketItemShow :is-edit="true" :list="projects" list-type="project" @remove="handleRemove" @success="open"/>
</div>
</el-card>
<el-card class="box-card">
<el-card class="box-card" v-if="!(userRole === 'service_advisor')">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>配件信息</span>
<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"
active-text="客户可见"
inactive-text="客户不可见"
@ -203,7 +203,7 @@
<TicketItemShow :is-edit="true" :list="wares" list-type="ware" @remove="handleRemove" @success="open"/>
</div>
</el-card>
<el-card class="box-card">
<el-card class="box-card" v-if="userRole !== 'repair_warehouse'">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
@ -290,7 +290,7 @@
</template>
<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 TicketItemShow from "@/views/repair/tickets/Components/TicketItemShow.vue";
import other from "@/views/repair/other/index.vue";
@ -333,6 +333,7 @@ export default {
threePackMoney: 0,
confirmFaultMoney: 0,
},
userRole: null,
}
},
methods: {
@ -348,10 +349,16 @@ export default {
this.wares = data.filter(item => item.ware)
this.others = data.filter(item => item.other)
this.info = res.data
await this.judgeUserRole()
} finally {
this.loadingInstance.close()
}
},
//
async judgeUserRole(){
const res = await getUserRole()
this.userRole = res.data
},
async changeShow(){
try {
await updateShow(this.info.id, this.info.partShow)

View File

@ -45,8 +45,8 @@
</template>
</el-table-column>
<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.model" />
<!-- <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="goodsCount" />
</el-table>
<el-form style="margin-top: 1rem" :inline="true">
@ -132,6 +132,7 @@ export default {
this.formData['id'] = row.id
try{
this.items = []
this.image = null
this.dialogVisible = true
this.dialogLoading = true
const res = await getRepairSoiBySoId(row.id)

View File

@ -1,120 +1,120 @@
<template>
<div class="app-container">
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<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="4" :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>
<template slot="label">
车牌号
</template>
{{ info.carNo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
车系
</template>
{{ info.carBrandName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
手机号
</template>
{{ info.userMobile }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
创建时间
</template>
{{ parseTime(info.createTime, '{y}-{m}-{d}') }}
</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>
</div>
</el-card>
<!-- <el-card class="box-card">-->
<!-- &lt;!&ndash; 卡片头 &ndash;&gt;-->
<!-- <div slot="header" class="clearfix">-->
<!-- <i class="el-icon-plus"/>-->
<!-- <span>工单信息</span>-->
<!-- </div>-->
<!-- &lt;!&ndash; 卡片内容 &ndash;&gt;-->
<!-- <div>-->
<!-- <el-descriptions class="margin-top" :column="4" :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>-->
<!-- <template slot="label">-->
<!-- 车牌号-->
<!-- </template>-->
<!-- {{ info.carNo }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 车系-->
<!-- </template>-->
<!-- {{ info.carBrandName }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 手机号-->
<!-- </template>-->
<!-- {{ info.userMobile }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 创建时间-->
<!-- </template>-->
<!-- {{ parseTime(info.createTime, '{y}-{m}-{d}') }}-->
<!-- </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>-->
<!-- </div>-->
<!-- </el-card>-->
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
@ -130,7 +130,6 @@
</el-form>
</el-col>
</el-row>
</div>
<!-- 卡片内容 -->
<div>
@ -168,6 +167,19 @@
</el-table>
</div>
</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">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
@ -285,6 +297,7 @@ export default {
adviserId: null,
adviserName: null,
licenseNumber: null,
images: null
},
addWaresVisible: false,
waresFormData:{
@ -302,6 +315,7 @@ export default {
wareFormLoading: false,
//
baseTypeTree: [],
images: null,
}
},
methods:{
@ -327,7 +341,7 @@ export default {
},
async submitForm(){
try {
if (!this.chooseList || this.chooseList.length <= 0){
if ((!this.chooseList || this.chooseList.length <= 0) && !this.images){
this.$modal.msgError("没有选择任何配件")
return
}
@ -349,6 +363,7 @@ export default {
adviserId: null,
adviserName: null,
licenseNumber: null,
images: null
}
this.formData.no = createUniqueCodeByHead(this.info.type ? 'LLSQ' : 'TLSQ')
this.formData.ticketId = this.info.id
@ -357,22 +372,31 @@ export default {
this.formData.adviserId = this.info.adviserId
this.formData.adviserName = this.info.adviserName
this.formData.licenseNumber = this.info.carNo
this.formData.items = [
...this.chooseList.map(item => {
return {
waresId: item.id,
waresName: item.name,
waresCount: item.count,
waresStatus: "02",
remark: item.remark,
isShow: '1'
}
})
]
if (this.chooseList && this.chooseList.length > 0){
this.formData.items = [
...this.chooseList.map(item => {
return {
waresId: item.id,
waresName: item.name,
waresCount: item.count,
waresStatus: "",
remark: item.remark,
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(){
this.partList = []
this.chooseList = []
this.images = null
this.info = {}
this.formData = {
no: null,

View File

@ -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>
<!-- 服务顾问才有 -->
<el-dropdown-item command="carToCus" type="text" icon="el-icon-circle-check" v-if="userRole === 'service_advisor' && scope.row.ticketsStatus === '02' ">
交车
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@ -135,11 +139,36 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="doNotice" v-if="!isNoticeChoose">确定</el-button>
<el-button type="primary" @click="doNotice">{{ !isNoticeChoose ? '发送通知' : '我已拨打电话' }}</el-button>
<el-button @click="noticeDialog = false">取消</el-button>
</div>
</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"/>
<EditTickets ref="editTickets" @success="getList"/>
<RecordSetting ref="recordSet" />
@ -147,7 +176,7 @@
</template>
<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 UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
import {getUserProfile} from "@/api/system/user";
@ -191,7 +220,14 @@ export default {
},
noticeLoading: false,
noticeDialog: false,
isNoticeChoose: false
isNoticeChoose: false,
carToCusDialog: false,
carToCusForm:{
id: null,
remark: null,
image: null
},
ticketId: null
}
},
mounted() {
@ -260,45 +296,63 @@ export default {
this.$refs.updateRepair.open(row)
},
async noticeCus(row){
this.$confirm('请选择使用什么方式通知客户?', '选择', {
confirmButtonText: '短信通知',
cancelButtonText: '拨打电话',
type: 'info'
}).then(async () => {
this.isNoticeChoose = false
this.noticeData = {
time: [],
name: null,
mobile: null,
id: null,
remark: null,
}
this.noticeDialog = true
this.noticeData.id = row.id
try {
this.noticeLoading = true
const res = await getUserProfile()
this.noticeData.name = res.data.nickname
this.noticeData.mobile = res.data.mobile
} finally {
this.noticeLoading = false
}
}).catch(() => {
this.isNoticeChoose = true
this.noticeDialog = true
this.noticeData.name = row.userName
this.noticeData.mobile = row.userMobile
})
// 0
const flag = await hasPrice(row.id)
this.ticketId = 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('请选择使用什么方式通知客户?', '选择', {
confirmButtonText: '短信通知',
cancelButtonText: '拨打电话',
type: 'info'
}).then(async () => {
this.isNoticeChoose = false
this.noticeData = {
time: [],
name: null,
mobile: null,
id: null,
remark: null,
}
this.noticeDialog = true
this.noticeData.id = row.id
try {
this.noticeLoading = true
const res = await getUserProfile()
this.noticeData.name = res.data.nickname
this.noticeData.mobile = res.data.mobile
} finally {
this.noticeLoading = false
}
}).catch(() => {
this.isNoticeChoose = true
this.noticeDialog = true
this.noticeData.name = row.userName
this.noticeData.mobile = row.userMobile
})
}
},
async doNotice(){
try {
this.noticeData.id = this.ticketId
await this.$refs.noticeRef.validate()
this.noticeLoading = true
await noticeCus(this.noticeData)
this.noticeDialog = false
this.$modal.msgSuccess("操作成功")
await this.getList()
this.ticketId = null
}catch {}
},
handleEdit(row){
@ -322,6 +376,27 @@ export default {
case 'noticeCus':
this.noticeCus(row)
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{
}
}
}

View File

@ -47,25 +47,47 @@
</el-row>
</el-form>
<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 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 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 v-if="formData.recordType === 'sgwczj' && projectList.length !== 0" type="primary"
@click="handleFinish">
完成
</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">-->
<!-- {{isNext ? "整体完成并指派下一项目" : (isEndCheck ? "整体完成并移交总检" : "整体完成")}}-->
<!-- </el-button>-->
</div>
</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"/>
</div>
</template>
@ -104,10 +126,14 @@ export default {
isNext: false,
//
isEndCheck: true,
clickRow: null
clickRow: null,
chooseVisible: false,
}
},
methods: {
handleFinish() {
this.chooseVisible = true
},
init() {
this.formData = {
//
@ -162,7 +188,7 @@ export default {
},
async doUpdate(nextName = null) {
try {
if (nextName){
if (nextName) {
this.formData['nextName'] = nextName
}
if (this.formData.recordType === 'zj') {
@ -177,6 +203,7 @@ export default {
this.$modal.msgSuccess("操作成功")
}
this.dialogVisible = false
this.chooseVisible = false
this.$emit("success")
} else {
this.formLoading = true
@ -185,6 +212,7 @@ export default {
this.$modal.msgSuccess("操作成功")
}
this.dialogVisible = false
this.chooseVisible = false
this.$emit("success")
}
} catch {
@ -192,6 +220,9 @@ export default {
},
async doFinish(flag) {
try {
if (!this.formData.item.id){
this.$modal.msgError("请先选择要完成的项目")
}
await this.$refs.formRef.validate()
this.formLoading = true
//

View File

@ -115,10 +115,15 @@
</el-row>
<el-row :gutter="20">
<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"/>
</el-form-item>
</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-form-item label="车辆类别" prop="carInfo.carCategory">
<el-select v-model="formData.carInfo.carCategory" placeholder="请选择车辆类别">
@ -127,6 +132,8 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="车辆性质" prop="carInfo.carNature">
<el-select v-model="formData.carInfo.carNature" placeholder="请选择车辆性质">
@ -135,8 +142,6 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="注册日期" prop="carInfo.carRegisterDate">
<el-date-picker clearable v-model="formData.carInfo.carRegisterDate" type="date" value-format="timestamp"
@ -303,6 +308,7 @@ export default {
nextInspectionDate: undefined,
nextMaintenanceDate: undefined,
nextMaintenanceMileage: undefined,
carModel: undefined
}
},
formRules: {
@ -311,7 +317,8 @@ export default {
'carInfo.licenseNumber': [{required: true, message: "车牌号不能为空", trigger: 'blur'}],
'carInfo.brandAndModel': [{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,
//
@ -342,7 +349,8 @@ export default {
this.formData.carInfo = {
...this.formData.carInfo,
...data.carInfo,
brandAndModel: [data.carInfo?.carBrand, data.carInfo?.carModel]
brandAndModel: data.carInfo?.carBrand,
carModel: data.carInfo?.carModel
}
}
// await this.listLevel()
@ -354,7 +362,10 @@ export default {
this.buttonLoading = true
try{
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 result = res.data;
this.formData.carInfo.insuranceExpiryDate = result.insuranceExpiryDate
@ -368,6 +379,10 @@ export default {
async submitForm(){
await this.$refs["formRef"].validate();
this.formLoading = true
const brand = this.formData.carInfo.brandAndModel
if (typeof brand === 'string'){
this.formData.carInfo.brandAndModel = [brand, this.formData.carInfo?.carModel]
}
try {
await updateCustomerAndCar(this.formData)
this.$modal.msgSuccess(this.formData?.userInfo?.id ? "修改成功" : "新增成功")
@ -429,6 +444,7 @@ export default {
nextInspectionDate: undefined,
nextMaintenanceDate: undefined,
nextMaintenanceMileage: undefined,
carModel: undefined
}
}
this.resetForm("formRef")