配件申请单加上图片和一些其他修改

This commit is contained in:
xiaofajia 2024-11-13 19:56:41 +08:00
parent 1870f2f898
commit 2222a406f5
10 changed files with 707 additions and 178 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

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

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

@ -62,7 +62,8 @@
查看
</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>

View File

@ -71,11 +71,31 @@
</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 v-show="type">
@ -94,14 +114,19 @@
<!-- </div>-->
<!-- </el-table-column>-->
<el-table-column label="状态" align="center" width="180">
<el-table-column label="×" prop="wareStatus" align="center">
<template slot-scope="scope" v-if="scope.row.waresStatus === '0'">
<span style="color: #ffd51c">°</span>
<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="wareStatus" align="center">
<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>
<span style="color: #3aff70"></span>
</template>
</el-table-column>
</el-table-column>
@ -113,14 +138,19 @@
<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 === '0'">
<span style="color: #ffd51c">°</span>
<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="wareStatus" align="center">
<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>
<span style="color: #3aff70"></span>
</template>
</el-table-column>
</el-table-column>
@ -129,11 +159,13 @@
</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)">{{this.selectRow.length > 0 ? "通过" : "通过全部"}}</el-button>
<el-button @click="handleAudit(false)">{{this.selectRow.length > 0 ? "驳回" : "驳回全部"}}</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>
@ -144,10 +176,12 @@ 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
@ -168,10 +202,21 @@ export default {
clickCellMap: {},
editProp: ['wares.price'],
dialogLoading: null,
selectRow:[]
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.dialogVisible = true
@ -186,6 +231,9 @@ export default {
this.queryParams.twId = row.id
await this.getTwItem()
}
if (this.formData.images){
this.getImages(this.formData.images)
}
} finally {
this.dialogLoading.close()
}
@ -194,15 +242,17 @@ export default {
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 === "")]
}
})]
if (this.type){
this.items = [...this.items.filter(item => item.waresStatus === "")]
}
} finally {
this.loading = false

View File

@ -174,12 +174,12 @@
<i class="el-icon-plus"/>
<span>材料信息</span>
<el-switch v-if="userRole === 'service_advisor'" style="float: right; padding: 3px 0"
v-model="info.partShow"
active-text="客户可见"
inactive-text="客户不可见"
active-value="1"
inactive-value="0"
@change="changeShow"
v-model="info.partShow"
active-text="客户可见"
inactive-text="客户不可见"
active-value="1"
inactive-value="0"
@change="changeShow"
>
</el-switch>
</div>
@ -199,6 +199,29 @@
<TicketItemShow :list="others" list-type="other"/>
</div>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>合计</span>
</div>
<div>
<el-descriptions class="margin-top" :column="2" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
总数量
</template>
{{ totalCount }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
总金额
</template>
{{ totalMoney}}
</el-descriptions-item>
</el-descriptions>
</div>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
@ -212,7 +235,7 @@ import {getTicketsById, updateShow} from "@/api/repair/tickets/Tickets";
export default {
name: "TicketsShow",
props:{
props: {
userRole: String
},
components: {TicketItemShow},
@ -222,23 +245,44 @@ export default {
info: {},
projects: [],
wares: [],
others: []
others: [],
allList: [],
totalCount: 0,
totalMoney: 0
}
},
methods: {
async open(row) {
this.reset()
const res = await getTicketsById(row.id)
const data = res.data.items
this.projects = data.filter(item => item.project)
this.wares = data.filter(item => item.ware)
this.others = data.filter(item => item.other)
this.allList = res.data.items
this.computed()
this.projects = this.allList.filter(item => item.project)
this.wares = this.allList.filter(item => item.ware)
this.others = this.allList.filter(item => item.other)
this.info = row
this.dialogVisible = true
},
async changeShow(){
async changeShow() {
try {
await updateShow(this.info.id, this.info.partShow)
}catch {}
} catch {
}
},
reset() {
this.info = {}
this.projects = []
this.wares = []
this.others = []
this.allList = []
},
computed(){
this.totalCount = 0
this.totalMoney = 0
if (this.allList && this.allList.length > 0){
this.totalCount = this.allList.reduce((acc, cur) => {return acc + cur.itemCount}, 0)
this.totalMoney = this.allList.reduce((acc, cur) => {return acc + cur.itemMoney}, 0)
}
}
}
}

View File

@ -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,120 +1,120 @@
<template>
<div class="app-container">
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>工单信息</span>
</div>
<!-- 卡片内容 -->
<div>
<el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">
<el-descriptions-item>
<template slot="label">
订单编号
</template>
{{ info.ticketNo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
维修类别
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="info.repairType"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_WORK_STATUS" v-model="info.ticketsWorkStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
客户名称
</template>
{{ info.userName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
车牌号
</template>
{{ info.carNo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
车系
</template>
{{ info.carBrandName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
手机号
</template>
{{ info.userMobile }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
创建时间
</template>
{{ parseTime(info.createTime, '{y}-{m}-{d}') }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
预计完工
</template>
{{ parseTime(info.outTime, '{y}-{m}-{d}') }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
合计金额
</template>
{{ info.totalPrice }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
参考成本
</template>
{{ info.cost }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
参考毛利
</template>
{{ info.profit }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
领料状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="info.partStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
服务顾问
</template>
{{ info.adviserName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
所属门店
</template>
{{ info.corpId }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
工单状态
</template>
<dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="info.ticketsStatus"/>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
备注
</template>
{{ info.remark }}
</el-descriptions-item>
</el-descriptions>
</div>
</el-card>
<!-- <el-card class="box-card">-->
<!-- &lt;!&ndash; 卡片头 &ndash;&gt;-->
<!-- <div slot="header" class="clearfix">-->
<!-- <i class="el-icon-plus"/>-->
<!-- <span>工单信息</span>-->
<!-- </div>-->
<!-- &lt;!&ndash; 卡片内容 &ndash;&gt;-->
<!-- <div>-->
<!-- <el-descriptions class="margin-top" :column="4" :size="'medium'" border style="margin-bottom: 1rem">-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 订单编号-->
<!-- </template>-->
<!-- {{ info.ticketNo }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 维修类别-->
<!-- </template>-->
<!-- <dict-tag :type="DICT_TYPE.REPAIR_TYPE" v-model="info.repairType"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 状态-->
<!-- </template>-->
<!-- <dict-tag :type="DICT_TYPE.REPAIR_TICKETS_WORK_STATUS" v-model="info.ticketsWorkStatus"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 客户名称-->
<!-- </template>-->
<!-- {{ info.userName }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 车牌号-->
<!-- </template>-->
<!-- {{ info.carNo }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 车系-->
<!-- </template>-->
<!-- {{ info.carBrandName }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 手机号-->
<!-- </template>-->
<!-- {{ info.userMobile }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 创建时间-->
<!-- </template>-->
<!-- {{ parseTime(info.createTime, '{y}-{m}-{d}') }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 预计完工-->
<!-- </template>-->
<!-- {{ parseTime(info.outTime, '{y}-{m}-{d}') }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 合计金额-->
<!-- </template>-->
<!-- {{ info.totalPrice }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 参考成本-->
<!-- </template>-->
<!-- {{ info.cost }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 参考毛利-->
<!-- </template>-->
<!-- {{ info.profit }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 领料状态-->
<!-- </template>-->
<!-- <dict-tag :type="DICT_TYPE.REPAIR_PART_STATUS" v-model="info.partStatus"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 服务顾问-->
<!-- </template>-->
<!-- {{ info.adviserName }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 所属门店-->
<!-- </template>-->
<!-- {{ info.corpId }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 工单状态-->
<!-- </template>-->
<!-- <dict-tag :type="DICT_TYPE.REPAIR_TICKETS_STATUS" v-model="info.ticketsStatus"/>-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item>-->
<!-- <template slot="label">-->
<!-- 备注-->
<!-- </template>-->
<!-- {{ info.remark }}-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
<!-- </div>-->
<!-- </el-card>-->
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
@ -130,7 +130,6 @@
</el-form>
</el-col>
</el-row>
</div>
<!-- 卡片内容 -->
<div>
@ -168,6 +167,19 @@
</el-table>
</div>
</el-card>
<el-card class="box-card">
<!-- 卡片头 -->
<div slot="header" class="clearfix">
<i class="el-icon-plus"/>
<span>上传配件申请单</span>
</div>
<!-- 卡片内容 -->
<div>
<ImageUpload v-model="images" />
</div>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
@ -285,6 +297,7 @@ export default {
adviserId: null,
adviserName: null,
licenseNumber: null,
images: null
},
addWaresVisible: false,
waresFormData:{
@ -302,6 +315,7 @@ export default {
wareFormLoading: false,
//
baseTypeTree: [],
images: null,
}
},
methods:{
@ -327,7 +341,7 @@ export default {
},
async submitForm(){
try {
if (!this.chooseList || this.chooseList.length <= 0){
if ((!this.chooseList || this.chooseList.length <= 0) && !this.images){
this.$modal.msgError("没有选择任何配件")
return
}
@ -349,6 +363,7 @@ export default {
adviserId: null,
adviserName: null,
licenseNumber: null,
images: null
}
this.formData.no = createUniqueCodeByHead(this.info.type ? 'LLSQ' : 'TLSQ')
this.formData.ticketId = this.info.id
@ -357,22 +372,31 @@ export default {
this.formData.adviserId = this.info.adviserId
this.formData.adviserName = this.info.adviserName
this.formData.licenseNumber = this.info.carNo
this.formData.items = [
...this.chooseList.map(item => {
return {
waresId: item.id,
waresName: item.name,
waresCount: item.count,
waresStatus: "0",
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,