Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4bb2c20bd9 | ||
|
a0a9eaff45 | ||
|
ac6c36894c | ||
|
a79c5c6dc6 | ||
|
2222a406f5 | ||
|
1870f2f898 | ||
|
b8636a1728 |
@ -19,3 +19,12 @@ export function updateIsShow(params){
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 给配件申请表子表添加数据
|
||||
export function addTwi(data){
|
||||
return request({
|
||||
url: preUrl + '/addTwi',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
@ -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')
|
||||
}
|
||||
|
@ -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"/>
|
||||
|
@ -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">
|
||||
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
|
||||
</template>
|
||||
<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"/>
|
||||
</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)
|
||||
},
|
||||
// 通过 true是全部、false是选择
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
405
src/views/repair/tickets/Components/TWIAdd.vue
Normal file
405
src/views/repair/tickets/Components/TWIAdd.vue
Normal file
@ -0,0 +1,405 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog title="添加配件" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||
<el-card class="box-card">
|
||||
<!-- 卡片头 -->
|
||||
<div slot="header" class="clearfix">
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-button type="primary" size="mini" @click="openChooseWares">选择配件</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<!-- 卡片内容 -->
|
||||
<div>
|
||||
<el-table :data="chooseList" :stripe="true" :show-overflow-tooltip="true"
|
||||
@cell-mouse-enter="handleCellEnter"
|
||||
@cell-mouse-leave="handleCellLeave"
|
||||
@cell-click="handleCellClick"
|
||||
>
|
||||
<el-table-column label="序号" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" prop="name" align="center"/>
|
||||
<!-- <el-table-column label="规格" prop="model" align="center"/>-->
|
||||
<el-table-column label="数量" prop="count" align="center">
|
||||
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.count"/>
|
||||
<span class="item__txt">{{ scope.row.count }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" align="center">
|
||||
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"/>
|
||||
<span class="item__txt">{{ scope.row.remark }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="deleteItem(scope.$index)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 配件选择弹窗 -->
|
||||
<el-dialog title="配件选择" :visible.sync="chooseWaresVisible" width="60%" v-dialogDrag append-to-body>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-button type="primary" size="mini" @click="handleAddWares">新增配件</el-button>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getWaresList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table ref="multipleTable" @selection-change="handleSelectionChange" v-loading="loading" :data="partList" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column type="selection" align="center" />
|
||||
<el-table-column label="商品名称" prop="name" align="center"/>
|
||||
<!-- <el-table-column label="规格" prop="model" align="center"/>-->
|
||||
</el-table>
|
||||
<pagination @pagination="getWaresList" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="addWares" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="chooseWaresVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="新增配件" :visible.sync="addWaresVisible" width="60%" v-dialogDrag append-to-body>
|
||||
<el-form :model="waresFormData" ref="waresFormRef" :rules="waresRules" :inline="true" label-width="10rem" v-loading="wareFormLoading">
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="waresFormData.name" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属分类" prop="type">
|
||||
<TreeSelect
|
||||
style="width: 20rem"
|
||||
v-model="waresFormData.type"
|
||||
:options="baseTypeTree"
|
||||
:normalizer="normalizer"
|
||||
placeholder="请选择所属分类"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计量单位" prop="unit">
|
||||
<el-select v-model="waresFormData.unit" placeholder="请选择单位">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.REPAIR_UNIT)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doAddWares">确 定</el-button>
|
||||
<el-button @click="addWaresVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TreeSelect from "@riophae/vue-treeselect";
|
||||
import {createWares, getWaresPage} from "@/api/repair/wares";
|
||||
import * as BaseTypeApi from "@/api/base/type";
|
||||
import {addTwi} from "@/api/repair/tickets/TWItem";
|
||||
|
||||
export default {
|
||||
name: "TWIAdd",
|
||||
components: {TreeSelect},
|
||||
data(){
|
||||
return{
|
||||
dialogVisible: false,
|
||||
chooseList: [],
|
||||
formData: {
|
||||
id: null,
|
||||
items: [
|
||||
{
|
||||
id: null,
|
||||
count: null,
|
||||
remark: null,
|
||||
name: null
|
||||
}
|
||||
]
|
||||
},
|
||||
clickCellMap: {},
|
||||
editProp: ['count', 'remark'],
|
||||
chooseWaresVisible: false,
|
||||
queryParams:{
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name:undefined
|
||||
},
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
partList: [],
|
||||
total: 0,
|
||||
formLoading: false,
|
||||
multipleSelection: [],
|
||||
addWaresVisible: false,
|
||||
waresFormData:{
|
||||
name: null,
|
||||
model: null,
|
||||
price: null,
|
||||
type: null,
|
||||
unit: null,
|
||||
},
|
||||
waresRules:{
|
||||
name: [{required: true, message: '名称不能为空', trigger: 'blur'}],
|
||||
type: [{required: true, message: '所属分类不能为空', trigger: 'blur'}],
|
||||
unit: [{required: true, message: '计量单位不能为空', trigger: 'blur'}],
|
||||
},
|
||||
wareFormLoading: false,
|
||||
//类型树
|
||||
baseTypeTree: [],
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
async submitForm(){
|
||||
try {
|
||||
if (!this.chooseList || this.chooseList.length === 0){
|
||||
this.$modal.msgError("请选择配件")
|
||||
return
|
||||
}
|
||||
this.createInit()
|
||||
await addTwi(this.formData)
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.dialogVisible = false
|
||||
this.$emit("success")
|
||||
}catch{}
|
||||
},
|
||||
createInit(){
|
||||
this.formData.items = [...this.chooseList.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
count: item.count,
|
||||
remark: item.remark,
|
||||
name: item.name
|
||||
}
|
||||
})]
|
||||
},
|
||||
async open(row){
|
||||
this.reset()
|
||||
this.formData.id = row.id
|
||||
this.dialogVisible = true
|
||||
},
|
||||
reset(){
|
||||
this.partList = []
|
||||
this.chooseList = []
|
||||
this.info = {}
|
||||
this.formData = {
|
||||
id: null,
|
||||
items: [
|
||||
{
|
||||
id: null,
|
||||
count: null,
|
||||
name: null,
|
||||
remark: null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
/** 鼠标移入cell */
|
||||
handleCellEnter(row, column, cell, event) {
|
||||
const property = column.property
|
||||
if (row.id && this.editProp.includes(property)) {
|
||||
cell.querySelector('.item__txt').classList.add('item__txt--hover')
|
||||
}
|
||||
},
|
||||
/** 鼠标移出cell */
|
||||
handleCellLeave(row, column, cell, event) {
|
||||
const property = column.property
|
||||
if (row.id && this.editProp.includes(property)) {
|
||||
cell.querySelector('.item__txt').classList.remove('item__txt--hover')
|
||||
}
|
||||
},
|
||||
/** 点击cell */
|
||||
handleCellClick(row, column, cell, event) {
|
||||
const property = column.property
|
||||
if (this.editProp.includes(property)) {
|
||||
if (!row.id || property !== 'goods') {
|
||||
// 保存cell
|
||||
this.saveCellClick(row, cell)
|
||||
cell.querySelector('.item__txt').style.display = 'none'
|
||||
cell.querySelector('.item__input').style.display = 'inline'
|
||||
cell.querySelector('input').focus()
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 取消编辑状态 */
|
||||
cancelEditable(cell) {
|
||||
cell.querySelector('.item__txt').style.display = 'inline'
|
||||
cell.querySelector('.item__input').style.display = 'none'
|
||||
},
|
||||
/** 保存进入编辑的cell */
|
||||
saveCellClick(row, cell) {
|
||||
const id = row.id
|
||||
if (this.clickCellMap[id] !== undefined) {
|
||||
if (!this.clickCellMap[id].includes(cell)) {
|
||||
this.clickCellMap[id].push(cell)
|
||||
}
|
||||
} else {
|
||||
this.clickCellMap[id] = [cell]
|
||||
}
|
||||
},
|
||||
/** 保存数据 */
|
||||
save(row) {
|
||||
const id = row.id
|
||||
// 取消本行所有cell的编辑状态
|
||||
this.clickCellMap[id].forEach(cell => {
|
||||
this.cancelEditable(cell)
|
||||
})
|
||||
this.clickCellMap[id] = []
|
||||
},
|
||||
deleteItem(index){
|
||||
this.chooseList.splice(index, 1)
|
||||
},
|
||||
handleQuery(){
|
||||
this.queryParams.pageNo = 1
|
||||
this.getWaresList()
|
||||
},
|
||||
resetQuery(){
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
async getWaresList(){
|
||||
try{
|
||||
this.loading = true
|
||||
const res = await getWaresPage(this.queryParams)
|
||||
this.partList = res.data.records
|
||||
this.total = res.data.total
|
||||
}finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
handleAddWares(){
|
||||
this.waresFormData = {
|
||||
name: null,
|
||||
model: null,
|
||||
price: null,
|
||||
type: null,
|
||||
unit: null,
|
||||
}
|
||||
this.addWaresVisible = true
|
||||
this.getBaseTypeTree()
|
||||
},
|
||||
handleSelectionChange(val){
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
addWares(){
|
||||
this.chooseList.push(
|
||||
...this.multipleSelection.map(item => {
|
||||
return {
|
||||
...item,
|
||||
count: 1
|
||||
}
|
||||
})
|
||||
)
|
||||
this.chooseWaresVisible = false
|
||||
},
|
||||
/** 转换仓库数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
};
|
||||
},
|
||||
async doAddWares(){
|
||||
try{
|
||||
this.wareFormLoading = true
|
||||
await this.$refs.waresFormRef.validate()
|
||||
this.waresFormData = {
|
||||
...this.waresFormData,
|
||||
miniStock: 0,
|
||||
maxStock: 0,
|
||||
stock: 0,
|
||||
status: '01',
|
||||
purPrice: 0,
|
||||
}
|
||||
await createWares(this.waresFormData)
|
||||
this.addWaresVisible = false
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
await this.getWaresList()
|
||||
}finally {
|
||||
this.wareFormLoading = false
|
||||
}
|
||||
},
|
||||
openChooseWares() {
|
||||
this.chooseWaresVisible = true
|
||||
this.resetQuery()
|
||||
},
|
||||
/** 获得配置类型树 */
|
||||
async getBaseTypeTree() {
|
||||
this.baseTypeTree = [];
|
||||
let param = {
|
||||
type: '02'
|
||||
}
|
||||
const res = await BaseTypeApi.getBaseTypeList(param);
|
||||
const root = {id: 0, name: '顶级配置类型', children: []};
|
||||
root.children = this.handleTree(res.data, 'id', 'parentId', "children", "0")
|
||||
this.baseTypeTree.push(root)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.item {
|
||||
.item__input {
|
||||
display: none;
|
||||
width: 100px;
|
||||
/* 调整elementUI中样式 如果不需要调整请忽略 */
|
||||
.el-input__inner {
|
||||
height: 24px !important;
|
||||
}
|
||||
|
||||
/* 调整elementUI中样式 如果不需要调整请忽略 */
|
||||
.el-input__suffix {
|
||||
i {
|
||||
font-size: 12px !important;
|
||||
line-height: 26px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item__txt {
|
||||
box-sizing: border-box;
|
||||
border: 1px solid transparent;
|
||||
width: 100px;
|
||||
line-height: 24px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.item__txt--hover {
|
||||
border: 1px solid #dddddd;
|
||||
border-radius: 4px;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -52,7 +52,7 @@
|
||||
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||
<!-- <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"/>
|
||||
|
@ -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>
|
||||
|
@ -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" />-->
|
||||
|
@ -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 = {
|
||||
|
@ -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 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">-->
|
||||
<!--<!– <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>–>-->
|
||||
<!-- <DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount" />-->
|
||||
<!-- <span class="item__txt">{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>-->
|
||||
<!-- </div>-->
|
||||
<div 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" />
|
||||
</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,31 +201,60 @@ 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) {
|
||||
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 +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 => {
|
||||
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 +357,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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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++
|
||||
}
|
||||
})
|
||||
|
@ -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)
|
||||
|
@ -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">-->
|
||||
<!-- <!– 卡片头 –>-->
|
||||
<!-- <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">
|
||||
<!-- 卡片头 -->
|
||||
<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,
|
||||
|
@ -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
|
||||
// 不论是什么按钮,这个工单子项是完了的
|
||||
|
Loading…
Reference in New Issue
Block a user