Merge branch 'repair'
This commit is contained in:
commit
9874d7b76e
@ -3,7 +3,7 @@
|
||||
<!-- 搜索 -->
|
||||
<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-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话" v-model="queryParams.query" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
@ -14,8 +14,7 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
:loading="exportLoading"
|
||||
>导出
|
||||
:loading="exportLoading">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
|
||||
@ -26,21 +25,21 @@
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单据号" align="center" prop="no" width="200"/>
|
||||
<el-table-column label="单据号" align="center" prop="no" width="200" />
|
||||
<el-table-column label="客户信息" align="center">
|
||||
<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 label="车架号" align="center" prop="vin" width="180"/>
|
||||
<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 label="车架号" align="center" prop="vin" width="180" />
|
||||
</el-table-column>
|
||||
<el-table-column label="申请人" align="center" prop="repairName" width="180"/>
|
||||
<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"/>
|
||||
<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="remark" width="180" :show-overflow-tooltip="true"/>
|
||||
<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)">
|
||||
@ -54,9 +53,7 @@
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination style="margin-bottom: 2rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-dialog title="单据处理" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||
<!-- 车辆信息显示区域 -->
|
||||
@ -74,10 +71,10 @@
|
||||
{{ formData.vin || '--' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="名称" prop="query">
|
||||
<el-input v-model="query"/>
|
||||
<el-input v-model="query" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="searchByQuery">搜索</el-button>
|
||||
@ -87,40 +84,37 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-if="type" plain icon="el-icon-plus" size="mini" @click="handleAddWares"
|
||||
>添加配件</el-button>
|
||||
<el-button type="primary" v-if="type" plain icon="el-icon-plus" size="mini"
|
||||
@click="handleAddWares">添加配件</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
@cell-mouse-enter="handleCellEnter"
|
||||
@cell-mouse-leave="handleCellLeave"
|
||||
@cell-click="handleCellClick"
|
||||
el-table v-loading="dialogLoading"
|
||||
:data="items" :stripe="true"
|
||||
:show-overflow-tooltip="true"
|
||||
:row-class-name="getRowClass"
|
||||
@selection-change="handleSelect"
|
||||
:key="tableKey"
|
||||
ref="tableRef"
|
||||
>
|
||||
<el-table-column type="selection" width="80" align="center"/>
|
||||
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="配件添加人" align="center" prop="addUserName" width="180"/>
|
||||
<el-table-column label="售价" align="center" prop="salePrice" width="180"/>
|
||||
<el-table @cell-mouse-enter="handleCellEnter" @cell-mouse-leave="handleCellLeave" @cell-click="handleCellClick"
|
||||
el-table v-loading="dialogLoading" :data="items" :stripe="true" :show-overflow-tooltip="true"
|
||||
:row-class-name="getRowClass" @selection-change="handleSelect" :key="tableKey" ref="tableRef">
|
||||
<el-table-column type="selection" width="80" align="center" />
|
||||
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="配件添加人" align="center" prop="addUserName" width="180" />
|
||||
<el-table-column label="售价" align="center" prop="salePrice" width="180">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.salePrice" placeholder="请输入售价">
|
||||
</el-input>
|
||||
<span class="item__txt">{{ scope.row.salePrice }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<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"
|
||||
placeholder="请输入数量"></el-input>
|
||||
placeholder="请输入数量"></el-input>
|
||||
<span class="item__txt">{{ scope.row.waresCount }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" v-if="type" align="center" prop="wares.stock" width="180"/>
|
||||
<el-table-column label="已领数量" v-if="!type" align="center" prop="waresAlreadyCount" width="180"/>
|
||||
<el-table-column label="库存数量" v-if="type" align="center" prop="wares.stock" width="180" />
|
||||
<el-table-column label="已领数量" v-if="!type" align="center" prop="waresAlreadyCount" 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"
|
||||
placeholder="请输入数量"></el-input>
|
||||
placeholder="请输入数量"></el-input>
|
||||
<span class="item__txt">{{ scope.row.waresCount }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
@ -130,11 +124,11 @@
|
||||
申领完成
|
||||
</el-button>
|
||||
<el-button type="primary" v-if="type" @click="handlePassBefore"
|
||||
:disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0">
|
||||
:disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0">
|
||||
通知领料
|
||||
</el-button>
|
||||
<el-button type="primary" v-else @click="handlePassBefore"
|
||||
:disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0">
|
||||
:disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0">
|
||||
通知退料
|
||||
</el-button>
|
||||
<el-button v-if="type" type="primary" @click="handleCreate" :disabled="allSelectRows.length === 0">
|
||||
@ -146,7 +140,7 @@
|
||||
<el-dialog title="采购单" :visible.sync="inStockDialog" width="80%" v-dialogDrag append-to-body>
|
||||
<el-form :inline="true">
|
||||
<el-form-item label="供应商">
|
||||
<SupplierChoose v-model="chooseSupplier"/>
|
||||
<SupplierChoose v-model="chooseSupplier" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-descriptions class="margin-top" title="车辆信息" :column="3" border>
|
||||
@ -171,44 +165,31 @@
|
||||
</el-descriptions>
|
||||
<el-collapse>
|
||||
<el-collapse-item v-for="[key, value] in partList" :title="key + `(${value.length})`">
|
||||
<el-table
|
||||
:data="value"
|
||||
:stripe="true"
|
||||
:show-overflow-tooltip="true"
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
@cell-mouse-enter="handleCellEnter"
|
||||
@cell-mouse-leave="handleCellLeave"
|
||||
@cell-click="handleCellClick"
|
||||
>
|
||||
<el-table :data="value" :stripe="true" :show-overflow-tooltip="true" show-summary
|
||||
:summary-method="getSummaries" @cell-mouse-enter="handleCellEnter" @cell-mouse-leave="handleCellLeave"
|
||||
@cell-click="handleCellClick">
|
||||
<el-table-column label="序号" align="center">
|
||||
<template scope="scope">
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品名称" align="center" prop="waresName" width="200"/>
|
||||
<el-table-column label="商品名称" align="center" prop="waresName" width="200" />
|
||||
<el-table-column label="规格" align="center" width="180" prop="wares.model">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.model"
|
||||
placeholder="请输入规格"></el-input>
|
||||
placeholder="请输入规格"></el-input>
|
||||
<span class="item__txt">{{ scope.row.wares.model }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类" align="center" width="180" prop="wares.type">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-select class="item__input" clearable ref="selectTree" v-model="scope.row.wares.type"
|
||||
@change="save(scope.row)">
|
||||
<el-option v-for="server in optionData(serverList)"
|
||||
:key="server.value"
|
||||
:label="server.label"
|
||||
:value="server.value" style="display: none"/>
|
||||
<el-tree class="item__input" ref="selectedTree"
|
||||
:data="serverList"
|
||||
:props="treeProps"
|
||||
highlight-current
|
||||
@node-click="handleNodeClick($event, scope.row)"
|
||||
:expand-on-click-node="expandOnClickNode"
|
||||
default-expand-all/>
|
||||
@change="save(scope.row)">
|
||||
<el-option v-for="server in optionData(serverList)" :key="server.value" :label="server.label"
|
||||
:value="server.value" style="display: none" />
|
||||
<el-tree class="item__input" ref="selectedTree" :data="serverList" :props="treeProps"
|
||||
highlight-current @node-click="handleNodeClick($event, scope.row)"
|
||||
:expand-on-click-node="expandOnClickNode" default-expand-all />
|
||||
</el-select>
|
||||
<span class="item__txt">{{ getTypeById(scope.row.wares.type) }}</span>
|
||||
</div>
|
||||
@ -216,63 +197,61 @@
|
||||
<el-table-column label="商品编码" align="center" width="180" prop="wares.code">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.code"
|
||||
placeholder="请输入内容"></el-input>
|
||||
placeholder="请输入内容"></el-input>
|
||||
<span class="item__txt">{{ scope.row.wares.code }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="仓库" align="center" width="150" prop="wares.warehouse">
|
||||
<div class="item" slot-scope="scope">
|
||||
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.wares.ware"
|
||||
@change="changeWare(scope.row)"/>
|
||||
@change="changeWare(scope.row)" />
|
||||
<span class="item__txt">{{ scope.row.wares?.ware?.name }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" align="center" width="150" prop="wares.stock"/>
|
||||
<el-table-column label="库存" align="center" width="150" prop="wares.stock" />
|
||||
<el-table-column label="单位" align="center" width="150" prop="wares.unit">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-select class="item__input" v-model="scope.row.wares.unit" @blur="save(scope.row)">
|
||||
<el-option v-for="dict in getDictDatasToType(DICT_TYPE.REPAIR_UNIT)" :key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"/>
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
<span class="item__txt">
|
||||
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.wares.unit"/>
|
||||
</span>
|
||||
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.wares.unit" />
|
||||
</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center" width="150" prop="waresCount">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
|
||||
placeholder="请输入内容"></el-input>
|
||||
placeholder="请输入内容"></el-input>
|
||||
<span class="item__txt">{{ scope.row.waresCount }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="进价" align="center" width="150" prop="wares.purPrice">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.purPrice"
|
||||
placeholder="请输入内容"></el-input>
|
||||
placeholder="请输入内容"></el-input>
|
||||
<span class="item__txt">{{ scope.row.wares.purPrice }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价" align="center" width="150" prop="wares.price">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.price"
|
||||
placeholder="请输入内容"></el-input>
|
||||
placeholder="请输入内容"></el-input>
|
||||
<span class="item__txt">{{ scope.row.wares.price }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" align="center" width="150" prop="totalPrice"/>
|
||||
<el-table-column label="总金额" align="center" width="150" prop="totalPrice" />
|
||||
<el-table-column label="备注" align="center" width="180" prop="remark">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"
|
||||
placeholder="请输入内容"></el-input>
|
||||
placeholder="请输入内容"></el-input>
|
||||
<span class="item__txt">{{ scope.row.remark }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="150">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
|
||||
>删除
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -289,11 +268,11 @@
|
||||
<el-form :inline="true" label-width="15rem">
|
||||
<el-form-item :label="type ? '领料人' : '退料人'">
|
||||
<el-select v-model="chooseStaff" multiple clearable filterable>
|
||||
<el-option v-for="staff in staffs" :key="staff.id" :value="staff.userId" :label="staff.userName"/>
|
||||
<el-option v-for="staff in staffs" :key="staff.id" :value="staff.userId" :label="staff.userName" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片上传">
|
||||
<ImageUpload v-model="images"/>
|
||||
<ImageUpload v-model="images" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -302,34 +281,34 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/>
|
||||
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false" />
|
||||
|
||||
<TWIAdd ref="twiAdd" @success="handleSuccess" :if-house-add="true"/>
|
||||
<TWIAdd ref="twiAdd" @success="handleSuccess" :if-house-add="true" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getPage, pass, passBackTicketWares, getByIds, exportData,confirmOver} from "@/api/repair/tickets/TicketWares";
|
||||
import {listTwItem} from "@/api/repair/tickets/TWItem";
|
||||
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
|
||||
import {parseTime} from "@/utils/ruoyi";
|
||||
import { getPage, pass, passBackTicketWares, getByIds, exportData, confirmOver } from "@/api/repair/tickets/TicketWares";
|
||||
import { listTwItem } from "@/api/repair/tickets/TWItem";
|
||||
import { createUniqueCodeByHead } from "@/utils/createUniqueCode";
|
||||
import { parseTime } from "@/utils/ruoyi";
|
||||
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 { createRepairSo } from "@/api/repair/stockOperate/stockOperate";
|
||||
import { getUserProfile } from "@/api/system/user";
|
||||
import TicketWaresShow from "@/views/repair/tickets/Components/TicketWaresShow.vue";
|
||||
import {getCusAndCarById} from "@/api/repair/tickets/Tickets";
|
||||
import {getCarBrand} from "@/api/base/carbrand";
|
||||
import {listGoods} from "@/views/partner/api/workOrder";
|
||||
import {getBaseTypeList} from "@/api/base/type";
|
||||
import {listByTicketId} from "@/api/repair/repairworker";
|
||||
import { getCusAndCarById } from "@/api/repair/tickets/Tickets";
|
||||
import { getCarBrand } from "@/api/base/carbrand";
|
||||
import { listGoods } from "@/views/partner/api/workOrder";
|
||||
import { getBaseTypeList } from "@/api/base/type";
|
||||
import { listByTicketId } from "@/api/repair/repairworker";
|
||||
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
||||
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
|
||||
import TWIAdd from "@/views/repair/tickets/Components/TWIAdd.vue";
|
||||
|
||||
export default {
|
||||
name: "WaresItem",
|
||||
components: {TWIAdd, SupplierChoose, StaffChoose, TicketWaresShow, WarehouseChoose, SoTable},
|
||||
components: { TWIAdd, SupplierChoose, StaffChoose, TicketWaresShow, WarehouseChoose, SoTable },
|
||||
props: {
|
||||
type: Boolean,
|
||||
},
|
||||
@ -357,7 +336,7 @@ export default {
|
||||
// 保存进入编辑的cell
|
||||
clickCellMap: {},
|
||||
// 需要编辑的属性
|
||||
editProp: ['wares.warehouse', 'wares.type', 'waresCount', 'wares.purPrice', 'wares.price', 'remark', 'wares.code', 'waresCount', 'wares.model', 'wares.unit'],
|
||||
editProp: ['wares.warehouse', 'wares.type', 'waresCount', 'wares.purPrice', 'wares.price', 'remark', 'wares.code', 'waresCount', 'wares.model', 'wares.unit','salePrice'],
|
||||
remark: null,
|
||||
tableKey: 0,
|
||||
query: null,
|
||||
@ -386,18 +365,18 @@ export default {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleAddWares(){
|
||||
this.$refs.twiAdd.open({id: this.twId})
|
||||
handleAddWares() {
|
||||
this.$refs.twiAdd.open({ id: this.twId })
|
||||
},
|
||||
handleSuccess(data){
|
||||
this.getTwitemList({twId: this.twId})
|
||||
handleSuccess(data) {
|
||||
this.getTwitemList({ twId: this.twId })
|
||||
},
|
||||
getTypeById(id) {
|
||||
return this.typeMap.get(id)
|
||||
},
|
||||
async listServer() {
|
||||
if (!this.serverList || this.serverList.length === 0) {
|
||||
const res = await getBaseTypeList({type: "02"})
|
||||
const res = await getBaseTypeList({ type: "02" })
|
||||
this.serverList = this.handleTree(res.data, 'id', 'parentId', "children", "0")
|
||||
this.typeMap = new Map()
|
||||
this.extractNodesToMap(this.serverList, this.typeMap)
|
||||
@ -417,7 +396,7 @@ export default {
|
||||
},
|
||||
optionData(array, result = []) {
|
||||
array.forEach(item => {
|
||||
result.push({label: item.name, value: item.id})
|
||||
result.push({ label: item.name, value: item.id })
|
||||
if (item.children && item.children.length !== 0) {
|
||||
this.optionData(item.children, result)
|
||||
}
|
||||
@ -504,6 +483,7 @@ export default {
|
||||
soiType: this.type ? '02' : "04",
|
||||
goodsId: item.waresId,
|
||||
goodsCount: item.waresCount,
|
||||
goodsPrice: item.salePrice
|
||||
}
|
||||
})]
|
||||
this.formData.ids = this.allSelectRows.map(item => item.id)
|
||||
@ -576,7 +556,7 @@ export default {
|
||||
...row
|
||||
}
|
||||
this.dialogVisible = true
|
||||
const data = {twId: row.id}
|
||||
const data = { twId: row.id }
|
||||
this.twId = row.id
|
||||
this.ticketId = row.ticketId
|
||||
this.getTwitemList(data)
|
||||
@ -633,7 +613,7 @@ export default {
|
||||
},
|
||||
// 设置不统计的字段
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
@ -829,7 +809,7 @@ export default {
|
||||
handleExport() {
|
||||
this.$modal.confirm('是否确认导出当前查询条件所有数据项?').then(() => {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.exportLoading = true;
|
||||
@ -846,13 +826,15 @@ export default {
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-table .stock td {
|
||||
color: #ff0000 !important; /* 红色背景 */
|
||||
color: #ff0000 !important;
|
||||
/* 红色背景 */
|
||||
}
|
||||
|
||||
.item {
|
||||
.item__input {
|
||||
display: none;
|
||||
width: 100px;
|
||||
|
||||
/* 调整elementUI中样式 如果不需要调整请忽略 */
|
||||
.el-input__inner {
|
||||
height: 24px !important;
|
||||
|
||||
314
src/views/repair/tickets/Components/ParentTicketDialog.vue
Normal file
314
src/views/repair/tickets/Components/ParentTicketDialog.vue
Normal file
@ -0,0 +1,314 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="选择A单"
|
||||
:visible.sync="dialogVisible"
|
||||
width="900px"
|
||||
append-to-body
|
||||
class="parent-ticket-dialog"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="dialog-content">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="search-area">
|
||||
<el-input
|
||||
v-model="searchParams.ticketNo"
|
||||
placeholder="请输入A单关键词"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
@clear="handleSearch"
|
||||
@keyup.enter.native="handleSearch"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" @click="handleSearch" />
|
||||
</el-input>
|
||||
<el-button type="primary" @click="handleSearch" style="margin-left: 10px">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="resetSearch">重置</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<div class="table-area">
|
||||
<el-table
|
||||
ref="ticketTable"
|
||||
v-loading="loading"
|
||||
:data="ticketList"
|
||||
:stripe="true"
|
||||
:highlight-current-row="true"
|
||||
@row-click="handleRowClick"
|
||||
style="width: 100%"
|
||||
height="400"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column label="A单编号" prop="ticketNo" width="180" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<span class="ticket-no">{{ row.ticketNo }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="客户姓名" prop="userName" width="120" align="center" />
|
||||
<el-table-column label="车牌号" prop="carNo" width="120" align="center" />
|
||||
<el-table-column label="创建时间" width="160" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
{{ formatTime(row.ticketTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-tag
|
||||
:type="getStatusType(row.ticketsStatus)"
|
||||
size="small"
|
||||
>
|
||||
{{ getStatusText(row.ticketsStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleSelect(row)"
|
||||
>
|
||||
选择
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-area">
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="searchParams.pageNo"
|
||||
:limit.sync="searchParams.pageSize"
|
||||
@pagination="getTicketList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 选中信息显示 -->
|
||||
<div v-if="selectedTicket" class="selected-info">
|
||||
<el-alert
|
||||
title="已选中A单"
|
||||
type="success"
|
||||
:closable="false"
|
||||
show-icon
|
||||
>
|
||||
<div class="selected-details">
|
||||
<span><strong>单号:</strong>{{ selectedTicket.ticketNo }}</span>
|
||||
<span><strong>客户:</strong>{{ selectedTicket.userName }}</span>
|
||||
<span><strong>车牌:</strong>{{ selectedTicket.carNo }}</span>
|
||||
</div>
|
||||
</el-alert>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!selectedTicket"
|
||||
@click="handleConfirm"
|
||||
>
|
||||
确定选择
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTicketsPage } from "@/api/repair/tickets/Tickets";
|
||||
import Pagination from "@/components/Pagination";
|
||||
|
||||
export default {
|
||||
name: "ParentTicketDialog",
|
||||
components: {
|
||||
Pagination
|
||||
},
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
ticketList: [],
|
||||
total: 0,
|
||||
selectedTicket: null,
|
||||
searchParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
ticketNo: null,
|
||||
ticketType: "01", // 只查询A单
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
visible: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
this.dialogVisible = val;
|
||||
if (val) {
|
||||
this.resetSelection();
|
||||
this.getTicketList();
|
||||
}
|
||||
}
|
||||
},
|
||||
dialogVisible(val) {
|
||||
this.$emit("update:visible", val);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取A单列表
|
||||
async getTicketList() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const res = await getTicketsPage(this.searchParams);
|
||||
this.ticketList = res.data.records || [];
|
||||
this.total = res.data.total || 0;
|
||||
} catch (error) {
|
||||
console.error("获取A单列表失败:", error);
|
||||
this.$modal.msgError("获取A单列表失败");
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchParams.pageNo = 1;
|
||||
this.getTicketList();
|
||||
},
|
||||
|
||||
// 重置搜索
|
||||
resetSearch() {
|
||||
this.searchParams = {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
ticketNo: null,
|
||||
ticketType: "01",
|
||||
ticketsStatus: "01"
|
||||
};
|
||||
this.getTicketList();
|
||||
},
|
||||
|
||||
// 行点击事件
|
||||
handleRowClick(row) {
|
||||
this.selectedTicket = row;
|
||||
},
|
||||
|
||||
// 选择按钮点击
|
||||
handleSelect(row) {
|
||||
this.selectedTicket = row;
|
||||
},
|
||||
|
||||
// 格式化时间
|
||||
formatTime(time) {
|
||||
if (!time) return "-";
|
||||
return this.parseTime(time, "{y}-{m}-{d} {h}:{m}");
|
||||
},
|
||||
|
||||
// 获取状态类型
|
||||
getStatusType(status) {
|
||||
const statusMap = {
|
||||
"01": "success", // 未结算
|
||||
"02": "warning", // 已结算
|
||||
"03": "info", // 已挂单
|
||||
"04": "danger" // 已取消
|
||||
};
|
||||
return statusMap[status] || "info";
|
||||
},
|
||||
|
||||
// 获取状态文本
|
||||
getStatusText(status) {
|
||||
const statusMap = {
|
||||
"01": "未结算",
|
||||
"02": "已结算",
|
||||
"03": "已挂单",
|
||||
"04": "已取消"
|
||||
};
|
||||
return statusMap[status] || "未知";
|
||||
},
|
||||
|
||||
// 重置选择
|
||||
resetSelection() {
|
||||
this.selectedTicket = null;
|
||||
this.searchParams.pageNo = 1;
|
||||
this.searchParams.ticketNo = null;
|
||||
},
|
||||
|
||||
// 取消
|
||||
handleCancel() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
|
||||
// 确认选择
|
||||
handleConfirm() {
|
||||
if (this.selectedTicket) {
|
||||
this.$emit("selected", this.selectedTicket);
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.parent-ticket-dialog {
|
||||
.dialog-content {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin-bottom: 20px;
|
||||
|
||||
.ticket-no {
|
||||
font-weight: bold;
|
||||
color: #409EFF;
|
||||
}
|
||||
}
|
||||
|
||||
.selected-info {
|
||||
margin-top: 20px;
|
||||
|
||||
.selected-details {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 8px;
|
||||
|
||||
span {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-area {
|
||||
margin-top: 15px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__body {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
::v-deep .el-table {
|
||||
.el-table__body tr:hover > td {
|
||||
background-color: #f5f7fa;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.current-row {
|
||||
background-color: #ecf5ff !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -32,6 +32,21 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单类型" prop="ticketType">
|
||||
<el-select
|
||||
v-model="queryParams.ticketType"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in this.getDictDatas('repair_tickets_type')"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种" prop="workType">
|
||||
<el-select
|
||||
v-model="queryParams.workType"
|
||||
@ -179,6 +194,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工单类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.REPAIR_TICKETS_TYPE"
|
||||
v-model="scope.row.ticketType"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="客户名称"
|
||||
align="center"
|
||||
@ -699,7 +722,7 @@ export default {
|
||||
pageSize: 10,
|
||||
ticketNo: null,
|
||||
searchTimeArray: [],
|
||||
ticketsStatus: this.isType,
|
||||
// ticketsStatus: this.isType,
|
||||
selectType: 'all',
|
||||
...this.externalQueryParams
|
||||
},
|
||||
|
||||
@ -854,8 +854,8 @@ export default {
|
||||
if (type == 'js') {
|
||||
this.settlementFormData = {
|
||||
ticketId: row.id,
|
||||
money: row.totalPrice,
|
||||
actualMoney: row.totalPrice,
|
||||
money: row.totalPrice + row.btickets?.reduce((sum, item) => sum + item.totalPrice, 0),
|
||||
actualMoney: row.totalPrice + row.btickets.reduce((sum, item) => sum + item.totalPrice, 0),
|
||||
discountType: this.defaultDiscountType,
|
||||
discount: 0
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
车辆选择
|
||||
</template>
|
||||
<CarChoose v-if="selectUser && selectUser.id" v-model="selectCar" :cus-name="selectUser.cusName"
|
||||
:customer-info="selectUser" :in-list="carInData" />
|
||||
:customer-info="selectUser" :in-list="carInData" :car-list="carList" />
|
||||
<span v-else>请先选择客户</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
@ -471,6 +471,7 @@ export default {
|
||||
finaCouponList: [],
|
||||
userInData: null,
|
||||
carInData: null,
|
||||
carList: null,
|
||||
ticketChooseDialogVisible: false, // A单选择对话框显示状态
|
||||
busiAndCusList: [], // 业务渠道和来源列表
|
||||
channelList: [], // 渠道列表
|
||||
@ -813,6 +814,7 @@ export default {
|
||||
...cusRes.data,
|
||||
isRes: true
|
||||
}
|
||||
this.carList = cusRes.carLi
|
||||
// 查车辆
|
||||
const carRes = await getByLicenseNumber(car)
|
||||
this.carInData = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user