Compare commits

...

13 Commits

Author SHA1 Message Date
xiaofajia
12916957f6 服务顾问只能编辑除配件外的工单信息,仓库只能编辑配件信息(isFinish=0) 2024-11-16 16:55:28 +08:00
xiaofajia
c2fbaeb2fa 对接上交车接口 2024-11-16 15:54:41 +08:00
xiaofajia
cfa1e585bc 服务顾问通知客户取车前,判断项目价格、配件价格是否已填写 2024-11-16 15:37:33 +08:00
xiaofajia
b49c27c10f 代码补正 2024-11-16 12:58:34 +08:00
xiaofajia
8dc907e992 代码补正 2024-11-16 12:56:05 +08:00
xiaofajia
9a74a8414f 车辆品牌型号拆分为品牌和型号,型号为输入框 2024-11-16 12:05:12 +08:00
xiaofajia
4bb2c20bd9 企业新增企业简称 2024-11-15 17:47:37 +08:00
xiaofajia
a0a9eaff45 一些bug的修改 2024-11-15 16:23:07 +08:00
xiaofajia
ac6c36894c 代码修正 2024-11-14 18:29:09 +08:00
xiaofajia
a79c5c6dc6 点击项目完成时,先提示是否移交总检? 2024-11-14 10:05:54 +08:00
xiaofajia
2222a406f5 配件申请单加上图片和一些其他修改 2024-11-13 19:56:41 +08:00
xiaofajia
1870f2f898 改配件申请100% 2024-11-12 17:44:44 +08:00
xiaofajia
b8636a1728 改配件申请 2024-11-12 09:47:38 +08:00
25 changed files with 1245 additions and 527 deletions

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

@ -175,3 +175,20 @@ 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
})
}

View File

@ -1,16 +1,20 @@
<template>
<div class="block">
<el-cascader
placeholder="车辆品牌型号"
:options="options"
v-model="selectedValues"
filterable
/>
<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';
import {getCarBrandPage, getCarBrand} from '@/api/base/carbrand'
export default {
name: 'CarBrandSelector',
@ -18,8 +22,8 @@
props: {
//v-model
value: {
type: Array,
default: () => [],
type: [Array, String],
// default: () => [],
},
},
@ -35,8 +39,13 @@
value: {
immediate: true,
handler(newVal) {
if (newVal instanceof Array) {
this.selectedValues = newVal[0]
} else {
this.selectedValues = newVal;
}
this.getData(this.selectedValues)
}
},
selectedValues(newVal) {
this.$emit('input', newVal);
@ -47,15 +56,31 @@
this.getData();
},
methods: {
//
getData(keyword) {
// this.reset()
let param = {
modelName: keyword,
const query = {
brandName: keyword
}
CarBrandSelectorApi.searchBrand(param).then(res => {
this.options = res.data
});
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
// });
},
},

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,6 +205,7 @@ export default {
nextInspectionDate: undefined,
nextMaintenanceDate: undefined,
nextMaintenanceMileage: undefined,
carModel: undefined
},
buttonLoading: false,
//
@ -209,6 +217,7 @@ 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'}]
},
};
},
@ -217,8 +226,11 @@ export default {
async compute() {
this.buttonLoading = true
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

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

@ -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,7 +46,7 @@
</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"
/>
@ -57,7 +64,7 @@
>
<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"
@ -130,9 +137,14 @@
</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">
<div class="item" slot-scope="scope">
<el-select class="item__input" v-model="scope.row.unit" @blur="save(scope.row)">
<el-option v-for="dict in getDictDatasToType(DICT_TYPE.REPAIR_UNIT)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
<span class="item__txt">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
</template>
</span>
</div>
</el-table-column>
<el-table-column label="数量" align="center" width="150" prop="count">
<div class="item" slot-scope="scope">
@ -174,6 +186,8 @@
<el-button type="primary" @click="handleSubmit">确定</el-button>
</div>
</el-dialog>
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/>
</div>
</template>
@ -186,10 +200,11 @@ 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";
export default {
name: "WaresItem",
components: {WarehouseChoose, SoTable},
components: {TicketWaresShow, WarehouseChoose, SoTable},
props: {
type: Boolean,
},
@ -199,8 +214,7 @@ export default {
pageNo: 1,
pageSize: 10,
query: null,
type: "01",
isBack: this.type ? null : true
isBack: !this.type,
},
showSearch: true,
loading: false,
@ -217,7 +231,7 @@ export default {
// cell
clickCellMap: {},
//
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model'],
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model', 'unit'],
remark: null,
tableKey: 0,
}
@ -226,6 +240,9 @@ export default {
this.getList()
},
methods: {
getDictDatasToType(type){
return this.getDictDatas(type)
},
// truefalse
async handlePass() {
// 退
@ -304,15 +321,13 @@ export default {
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)
}
this.items = this.items.filter(item => this.type ? item.waresCount > 0 : item.waresAlreadyCount > 0)
} finally {
this.dialogLoading = false
}
@ -497,6 +512,9 @@ export default {
}
})
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

@ -52,7 +52,7 @@
<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">
@ -68,7 +68,7 @@
<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="180" 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"/>

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" />-->

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,163 +57,115 @@
</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>
</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>
<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>-->
<!-- <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>-->
<div slot-scope="scope">
<span>{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>
</div>
</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"/>
<!-- </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 align="center" label="备注" prop="remark" width="180" :show-overflow-tooltip="true"/>
<el-table-column label="不通过" prop="waresStatus" align="center">
<template slot-scope="scope" v-if="scope.row.waresStatus === '0'">
<span style="color: red"></span>
</template>
</el-table-column>
<el-table-column label="通过" prop="waresStatus" align="center">
<template slot-scope="scope" v-if="scope.row.waresStatus === '1'">
<span style="color: #3aff70"></span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="审核人" prop="handleName" align="center"/>
</el-table>
</div>
<div v-show="!type">
<el-table v-loading="loading" :data="items" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
<el-table-column label="状态" align="center" width="180">
<el-table-column label="待定" prop="waresStatus" align="center">
<template slot-scope="scope" v-if="scope.row.waresStatus === ''">
<span></span>
</template>
</el-table-column>
<el-table-column label="不通过" prop="waresStatus" align="center">
<template slot-scope="scope" v-if="scope.row.waresStatus === '0'">
<span style="color: red"></span>
</template>
</el-table-column>
<el-table-column label="通过" prop="waresStatus" align="center">
<template slot-scope="scope" v-if="scope.row.waresStatus === '1'">
<span style="color: #3aff70"></span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="审核人" prop="handleName" align="center"/>
</el-table>
</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" />
</div>
</template>
@ -214,10 +175,13 @@ import {auditTicketWares} 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,10 +201,29 @@ export default {
formData: {},
clickCellMap: {},
editProp: ['wares.price'],
dialogLoading: null,
selectRow:[],
imageUrls: []
}
},
methods: {
handleSuccess(){
this.open(this.formData)
},
handleAddWares(){
this.dialogVisible = false
this.$refs.twiAdd.open(this.formData)
},
getImages(images){
this.imageUrls = images.split(",").map(item => process.env.VUE_APP_FILE_API + item)
},
async open(row) {
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)
@ -249,12 +232,18 @@ export default {
this.queryParams.twId = row.id
await this.getTwItem()
}
this.dialogVisible = true
if (this.formData.images){
this.getImages(this.formData.images)
}
} finally {
this.dialogLoading.close()
}
},
async getTwItem() {
try {
this.loading = true
const res = await listTwItem(this.queryParams)
if (res.data && res.data.length > 0){
this.items = res.data
this.items = [...this.items.map(item => {
return {
@ -262,6 +251,10 @@ export default {
itemDiscount: 1,
}
})]
if (this.type){
this.items = [...this.items.filter(item => item.waresStatus === "")]
}
}
} finally {
this.loading = false
}
@ -273,50 +266,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 => {
if (this.selectRow && this.selectRow.length > 0){
this.formData.items = [...this.selectRow.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
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) {
@ -402,6 +385,13 @@ export default {
}
})
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

@ -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>
@ -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() {
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

@ -556,7 +556,7 @@ export default {
}
this.selectUser = {}
this.selectCar = {}
this.selectStaff = {}
// this.selectStaff = {}
this.projectList = []
this.partList = []
this.otherList = []
@ -619,7 +619,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
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: "02",
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.ticketsWorkStatus === '03'">
交车
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@ -140,6 +144,31 @@
</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,13 @@ export default {
},
noticeLoading: false,
noticeDialog: false,
isNoticeChoose: false
isNoticeChoose: false,
carToCusDialog: false,
carToCusForm:{
id: null,
remark: null,
image: null
}
}
},
mounted() {
@ -260,6 +295,21 @@ export default {
this.$refs.updateRepair.open(row)
},
async noticeCus(row){
// 0
const flag = await hasPrice(row.id)
let choose = true
if (!flag.data){
await this.$confirm('有项目或配件的价格为0是否确认通知客户?', '选择', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'info'
}).then(() => {
choose = true
}).catch(() => {
choose = false
})
}
if (choose){
this.$confirm('请选择使用什么方式通知客户?', '选择', {
confirmButtonText: '短信通知',
cancelButtonText: '拨打电话',
@ -289,7 +339,7 @@ export default {
this.noticeData.name = row.userName
this.noticeData.mobile = row.userMobile
})
}
},
async doNotice(){
try {
@ -322,6 +372,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 = {
//
@ -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")