Compare commits
2 Commits
12916957f6
...
8c1c1f6e60
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8c1c1f6e60 | ||
![]() |
c36226d14c |
@ -63,3 +63,28 @@ export function passBackTicketWares(data){
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改是否传给保险公司
|
||||||
|
export function updateSafe(data){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/updateSafe",
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查单个配件申请单的信息
|
||||||
|
export function getById(id){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/getById?id=" + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据选择的配件生成采购单需要的数据
|
||||||
|
export function getByIds(ids){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/getByIds?ids=" + ids,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -192,3 +192,11 @@ export function overOrder(data){
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据工单ID查客户和车辆信息
|
||||||
|
export function getCusAndCarById(id){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/getCusAndCarById?id=" + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<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">
|
<el-table-column label="岗位" align="center" prop="repairWork" width="180">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="服务顾问" align="center" prop="adviserName" width="180"/>
|
<el-table-column label="服务顾问" align="center" prop="adviserName" width="180"/>
|
||||||
@ -46,11 +46,21 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<pagination style="margin-bottom: 2rem" 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"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<el-dialog title="单据处理" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
<el-dialog title="单据处理" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||||
|
<el-form :inline="true">
|
||||||
|
<el-form-item label="名称" prop="query">
|
||||||
|
<el-input v-model="query"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="searchByQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" @click=resetByQuery>重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
<el-table
|
<el-table
|
||||||
@cell-mouse-enter="handleCellEnter"
|
@cell-mouse-enter="handleCellEnter"
|
||||||
@cell-mouse-leave="handleCellLeave"
|
@cell-mouse-leave="handleCellLeave"
|
||||||
@ -61,10 +71,11 @@
|
|||||||
:row-class-name="getRowClass"
|
:row-class-name="getRowClass"
|
||||||
@selection-change="handleSelect"
|
@selection-change="handleSelect"
|
||||||
:key="tableKey"
|
:key="tableKey"
|
||||||
|
ref="tableRef"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="80" align="center"/>
|
<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="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">
|
<el-table-column label="领料数量" v-if="type" align="center" prop="waresCount" width="180">
|
||||||
<div class="item" slot-scope="scope">
|
<div class="item" slot-scope="scope">
|
||||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
|
||||||
@ -98,93 +109,110 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog title="采购单" :visible.sync="inStockDialog" width="80%" v-dialogDrag append-to-body>
|
<el-dialog title="采购单" :visible.sync="inStockDialog" width="80%" v-dialogDrag append-to-body>
|
||||||
<el-table
|
<el-descriptions class="margin-top" title="车辆信息" :column="3" border>
|
||||||
:data="partList"
|
<el-descriptions-item>
|
||||||
:stripe="true"
|
<template slot="label">
|
||||||
: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>
|
</template>
|
||||||
</el-table-column>
|
{{carInfo.licenseNumber}}
|
||||||
<el-table-column label="商品名称" align="center" prop="name" width="200"/>
|
</el-descriptions-item>
|
||||||
<el-table-column label="规格" align="center" width="180" prop="model">
|
<el-descriptions-item>
|
||||||
<div class="item" slot-scope="scope">
|
<template slot="label">
|
||||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.model"
|
品牌
|
||||||
placeholder="请输入规格"></el-input>
|
|
||||||
<span class="item__txt">{{ scope.row.model }}</span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="商品编码" align="center" width="180" prop="code">
|
|
||||||
<div class="item" slot-scope="scope">
|
|
||||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.code"
|
|
||||||
placeholder="请输入内容"></el-input>
|
|
||||||
<span class="item__txt">{{ scope.row.code }}</span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="仓库" align="center" width="150" prop="warehouse">
|
|
||||||
<div class="item" slot-scope="scope">
|
|
||||||
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.ware"
|
|
||||||
@change="changeWare(scope.row)"/>
|
|
||||||
<span class="item__txt">{{ scope.row.warehouseName }}</span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="库存" align="center" width="150" prop="stock"/>
|
|
||||||
<el-table-column label="单位" align="center" width="150" prop="unit">
|
|
||||||
<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">
|
|
||||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.count"
|
|
||||||
placeholder="请输入内容"></el-input>
|
|
||||||
<span class="item__txt">{{ scope.row.count }}</span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="上次进价" align="center" width="150" prop="purPrice"/>
|
|
||||||
<el-table-column label="采购单价" align="center" width="150" prop="newPrice">
|
|
||||||
<div class="item" slot-scope="scope">
|
|
||||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.newPrice"
|
|
||||||
placeholder="请输入内容"></el-input>
|
|
||||||
<span class="item__txt">{{ scope.row.newPrice }}</span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="采购金额" align="center" width="150" prop="totalPrice"/>
|
|
||||||
<el-table-column label="备注" align="center" width="180" prop="remark">
|
|
||||||
<div class="item" slot-scope="scope">
|
|
||||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"
|
|
||||||
placeholder="请输入内容"></el-input>
|
|
||||||
<span class="item__txt">{{ scope.row.remark }}</span>
|
|
||||||
</div>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="150">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
|
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
{{carInfo.carBrand}}
|
||||||
</el-table>
|
</el-descriptions-item>
|
||||||
<el-row :gutter="1" style="margin-top: 1rem">
|
<el-descriptions-item>
|
||||||
<el-col :span="24">
|
<template slot="label">
|
||||||
<el-input v-model="remark" placeholder="备注"/>
|
型号
|
||||||
</el-col>
|
</template>
|
||||||
</el-row>
|
{{carInfo.carModel}}
|
||||||
<div slot="footer" class="dialog-footer">
|
</el-descriptions-item>
|
||||||
<el-button type="primary" @click="handleSubmit">确定</el-button>
|
</el-descriptions>
|
||||||
</div>
|
<el-collapse>
|
||||||
|
<el-collapse-item v-for="[key, value] in partList" :title="key">
|
||||||
|
<el-table
|
||||||
|
:data="value"
|
||||||
|
:stripe="true"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
show-summary
|
||||||
|
:summary-method="getSummaries"
|
||||||
|
@cell-mouse-enter="handleCellEnter"
|
||||||
|
@cell-mouse-leave="handleCellLeave"
|
||||||
|
@cell-click="handleCellClick"
|
||||||
|
>
|
||||||
|
<el-table-column label="序号" align="center">
|
||||||
|
<template scope="scope">
|
||||||
|
<span>{{ scope.$index + 1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品名称" align="center" prop="waresName" width="200"/>
|
||||||
|
<el-table-column label="规格" align="center" width="180" prop="wares.model">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.model"
|
||||||
|
placeholder="请输入规格"></el-input>
|
||||||
|
<span class="item__txt">{{ scope.row.wares.model }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品编码" align="center" width="180" prop="wares.code">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.code"
|
||||||
|
placeholder="请输入内容"></el-input>
|
||||||
|
<span class="item__txt">{{ scope.row.wares.code }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="仓库" align="center" width="150" prop="wares.warehouse">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<WarehouseChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.wares.ware"
|
||||||
|
@change="changeWare(scope.row)"/>
|
||||||
|
<span class="item__txt">{{ scope.row.wares.warehouseName }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="库存" align="center" width="150" prop="wares.stock"/>
|
||||||
|
<el-table-column label="单位" align="center" width="150" prop="wares.unit">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-select class="item__input" v-model="scope.row.wares.unit" @blur="save(scope.row)">
|
||||||
|
<el-option v-for="dict in getDictDatasToType(DICT_TYPE.REPAIR_UNIT)" :key="dict.value" :label="dict.label"
|
||||||
|
:value="dict.value"/>
|
||||||
|
</el-select>
|
||||||
|
<span class="item__txt">
|
||||||
|
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.wares.unit"/>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="数量" align="center" width="150" prop="waresCount">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
|
||||||
|
placeholder="请输入内容"></el-input>
|
||||||
|
<span class="item__txt">{{ scope.row.waresCount }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="上次进价" align="center" width="150" prop="wares.purPrice"/>
|
||||||
|
<el-table-column label="采购单价" align="center" width="150" prop="wares.newPrice">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.wares.newPrice"
|
||||||
|
placeholder="请输入内容"></el-input>
|
||||||
|
<span class="item__txt">{{ scope.row.wares.newPrice }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="采购金额" align="center" width="150" prop="totalPrice"/>
|
||||||
|
<el-table-column label="备注" align="center" width="180" prop="remark">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"
|
||||||
|
placeholder="请输入内容"></el-input>
|
||||||
|
<span class="item__txt">{{ scope.row.remark }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="150">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteItem(scope.$index)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/>
|
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/>
|
||||||
@ -192,7 +220,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getPage, pass, passBackTicketWares} from "@/api/repair/tickets/TicketWares";
|
import {getPage, pass, passBackTicketWares, getByIds} from "@/api/repair/tickets/TicketWares";
|
||||||
import {listTwItem} from "@/api/repair/tickets/TWItem";
|
import {listTwItem} from "@/api/repair/tickets/TWItem";
|
||||||
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
|
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
|
||||||
import {parseTime} from "@/utils/ruoyi";
|
import {parseTime} from "@/utils/ruoyi";
|
||||||
@ -201,6 +229,8 @@ import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
|
|||||||
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
|
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
|
||||||
import {getUserProfile} from "@/api/system/user";
|
import {getUserProfile} from "@/api/system/user";
|
||||||
import TicketWaresShow from "@/views/repair/tickets/Components/TicketWaresShow.vue";
|
import TicketWaresShow from "@/views/repair/tickets/Components/TicketWaresShow.vue";
|
||||||
|
import {getCusAndCarById} from "@/api/repair/tickets/Tickets";
|
||||||
|
import {getCarBrand} from "@/api/base/carbrand";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WaresItem",
|
name: "WaresItem",
|
||||||
@ -224,6 +254,7 @@ export default {
|
|||||||
items: [],
|
items: [],
|
||||||
dialogLoading: false,
|
dialogLoading: false,
|
||||||
selections: [],
|
selections: [],
|
||||||
|
selectionIds: [],
|
||||||
formData: {},
|
formData: {},
|
||||||
inStockDialog: false,
|
inStockDialog: false,
|
||||||
partList: [],
|
partList: [],
|
||||||
@ -231,16 +262,43 @@ export default {
|
|||||||
// 保存进入编辑的cell
|
// 保存进入编辑的cell
|
||||||
clickCellMap: {},
|
clickCellMap: {},
|
||||||
// 需要编辑的属性
|
// 需要编辑的属性
|
||||||
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model', 'unit'],
|
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'wares.model', 'unit'],
|
||||||
remark: null,
|
remark: null,
|
||||||
tableKey: 0,
|
tableKey: 0,
|
||||||
|
query: null,
|
||||||
|
twId: null,
|
||||||
|
carInfo: {},
|
||||||
|
ticketId: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDictDatasToType(type){
|
searchByQuery(){
|
||||||
|
const data = {
|
||||||
|
twId: this.twId,
|
||||||
|
query: this.query
|
||||||
|
}
|
||||||
|
this.getTwitemList(data).then(() => {
|
||||||
|
this.setSelectedRows();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setSelectedRows() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.tableRef.clearSelection(); // 清除所有选择
|
||||||
|
this.items.forEach(row => {
|
||||||
|
if (this.selectionIds.includes(row.id)) {
|
||||||
|
this.$refs.tableRef.toggleRowSelection(row, true); // 选中行
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetByQuery() {
|
||||||
|
this.query = null
|
||||||
|
this.searchByQuery()
|
||||||
|
},
|
||||||
|
getDictDatasToType(type) {
|
||||||
return this.getDictDatas(type)
|
return this.getDictDatas(type)
|
||||||
},
|
},
|
||||||
// 通过 true是全部、false是选择
|
// 通过 true是全部、false是选择
|
||||||
@ -279,16 +337,19 @@ export default {
|
|||||||
},
|
},
|
||||||
// 生成采购 true是全部、false是选择
|
// 生成采购 true是全部、false是选择
|
||||||
async handleCreate() {
|
async handleCreate() {
|
||||||
this.inStockDialog = true
|
try {
|
||||||
this.partList = [...this.selections.map(item => {
|
const carRes = await getCusAndCarById(this.ticketId)
|
||||||
return {
|
this.carInfo = carRes.data.carInfo
|
||||||
...item.wares,
|
if (this.carInfo.carBrand){
|
||||||
count: item.waresCount,
|
const brandRes = await getCarBrand(this.carInfo.carBrand)
|
||||||
newPrice: item.wares.purPrice,
|
this.carInfo.carBrand = brandRes.data.brandName
|
||||||
totalPrice: item.waresCount * item.wares.purPrice
|
|
||||||
}
|
}
|
||||||
})]
|
const ids = this.selections.map(item => item.id)
|
||||||
this.dialogVisible = false
|
const res = await getByIds(ids)
|
||||||
|
this.partList = Object.entries(res.data)
|
||||||
|
this.inStockDialog = true
|
||||||
|
this.dialogVisible = false
|
||||||
|
}catch{}
|
||||||
},
|
},
|
||||||
async getList() {
|
async getList() {
|
||||||
try {
|
try {
|
||||||
@ -310,15 +371,19 @@ export default {
|
|||||||
this.resetForm('queryForm')
|
this.resetForm('queryForm')
|
||||||
this.handleQuery()
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
async handleDispose(row) {
|
handleDispose(row) {
|
||||||
this.formData = {}
|
this.formData = {}
|
||||||
this.formData = {
|
this.formData = {
|
||||||
...row
|
...row
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
|
const data = {twId: row.id}
|
||||||
|
this.twId = row.id
|
||||||
|
this.ticketId = row.ticketId
|
||||||
|
this.getTwitemList(data)
|
||||||
|
},
|
||||||
|
async getTwitemList(data) {
|
||||||
try {
|
try {
|
||||||
this.dialogLoading = true
|
|
||||||
const data = {twId: row.id}
|
|
||||||
const res = await listTwItem(data)
|
const res = await listTwItem(data)
|
||||||
this.items = res.data
|
this.items = res.data
|
||||||
this.items = this.items.filter(item => item.waresStatus === '1')
|
this.items = this.items.filter(item => item.waresStatus === '1')
|
||||||
@ -328,8 +393,7 @@ export default {
|
|||||||
item.isStock = this.type ? count <= item.wares.stock : true
|
item.isStock = this.type ? count <= item.wares.stock : true
|
||||||
})
|
})
|
||||||
this.items = this.items.filter(item => this.type ? item.waresCount > 0 : item.waresAlreadyCount > 0)
|
this.items = this.items.filter(item => this.type ? item.waresCount > 0 : item.waresAlreadyCount > 0)
|
||||||
} finally {
|
} catch {
|
||||||
this.dialogLoading = false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getRowClass(row) {
|
getRowClass(row) {
|
||||||
@ -340,6 +404,9 @@ export default {
|
|||||||
},
|
},
|
||||||
handleSelect(row) {
|
handleSelect(row) {
|
||||||
this.selections = row
|
this.selections = row
|
||||||
|
if (row && row.length > 0){
|
||||||
|
this.selectionIds = row.map(item => item.id);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 设置不统计的字段
|
// 设置不统计的字段
|
||||||
getSummaries(param) {
|
getSummaries(param) {
|
||||||
@ -443,7 +510,7 @@ export default {
|
|||||||
const isNull = this.validateNull();
|
const isNull = this.validateNull();
|
||||||
if (!isNull) return;
|
if (!isNull) return;
|
||||||
const names = this.validateZero()
|
const names = this.validateZero()
|
||||||
if (names){
|
if (names) {
|
||||||
await this.$modal.confirm("确认配件:" + names + "的采购价格为0吗?")
|
await this.$modal.confirm("确认配件:" + names + "的采购价格为0吗?")
|
||||||
}
|
}
|
||||||
await this.createInit()
|
await this.createInit()
|
||||||
@ -484,36 +551,36 @@ export default {
|
|||||||
}
|
}
|
||||||
})]
|
})]
|
||||||
},
|
},
|
||||||
validateNull(){
|
validateNull() {
|
||||||
const flag = this.partList.map(item => {
|
const flag = this.partList.map(item => {
|
||||||
const price = item.newPrice
|
const price = item.newPrice
|
||||||
if (price === null || price === ""){
|
if (price === null || price === "") {
|
||||||
this.$modal.msgError("配件:" + item.name + "采购价格为空")
|
this.$modal.msgError("配件:" + item.name + "采购价格为空")
|
||||||
return false
|
return false
|
||||||
}else {
|
} else {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
let count = 0
|
let count = 0
|
||||||
flag.forEach(item => {
|
flag.forEach(item => {
|
||||||
if (!item){
|
if (!item) {
|
||||||
count++
|
count++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return count === 0
|
return count === 0
|
||||||
},
|
},
|
||||||
validateZero(){
|
validateZero() {
|
||||||
const flag = this.partList.map(item => {
|
const flag = this.partList.map(item => {
|
||||||
const price = parseFloat(item.newPrice)
|
const price = parseFloat(item.newPrice)
|
||||||
if (price === 0){
|
if (price === 0) {
|
||||||
return item.name
|
return item.name
|
||||||
}else {
|
} else {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return flag.filter(item => item !== "").join(",")
|
return flag.filter(item => item !== "").join(",")
|
||||||
},
|
},
|
||||||
handleView(row){
|
handleView(row) {
|
||||||
this.$refs.ticketWaresShow.open(row)
|
this.$refs.ticketWaresShow.open(row)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,9 @@
|
|||||||
<el-button size="small" type="primary" @click="handleAddWares">
|
<el-button size="small" type="primary" @click="handleAddWares">
|
||||||
添加配件
|
添加配件
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button size="small" type="primary" @click="handleSetting">
|
||||||
|
设置可见
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 卡片内容 -->
|
<!-- 卡片内容 -->
|
||||||
@ -166,12 +169,56 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<TWIAdd ref="twiAdd" @success="handleSuccess" />
|
<TWIAdd ref="twiAdd" @success="handleSuccess" />
|
||||||
|
|
||||||
|
<el-dialog title="设置" width="40%" :visible.sync="settingDialog" v-dialogDrag append-to-body>
|
||||||
|
<el-form v-model="settingForm" :inline="true" label-width="20rem">
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="是否传给保险公司" prop="toSafe">
|
||||||
|
<el-switch
|
||||||
|
v-model="settingForm.toSafe"
|
||||||
|
active-text="是"
|
||||||
|
active-value="1"
|
||||||
|
inactive-text="否"
|
||||||
|
inactive-value="0"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="保险公司名称" prop="safeName">
|
||||||
|
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeName" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="联系人" prop="safeContact">
|
||||||
|
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeContact" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="1">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="联系电话" prop="safeMobile">
|
||||||
|
<el-input :disabled="settingForm.toSafe !== '1'" v-model="settingForm.safeMobile" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doSetting">确认</el-button>
|
||||||
|
<el-button @click="settingDialog = false" >取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getTicketsById} from "@/api/repair/tickets/Tickets";
|
import {getTicketsById} from "@/api/repair/tickets/Tickets";
|
||||||
import {auditTicketWares} from "@/api/repair/tickets/TicketWares";
|
import {auditTicketWares, updateSafe, getById} from "@/api/repair/tickets/TicketWares";
|
||||||
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
||||||
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
||||||
import item from "@/layout/components/Sidebar/Item.vue";
|
import item from "@/layout/components/Sidebar/Item.vue";
|
||||||
@ -203,10 +250,37 @@ export default {
|
|||||||
editProp: ['wares.price'],
|
editProp: ['wares.price'],
|
||||||
dialogLoading: null,
|
dialogLoading: null,
|
||||||
selectRow:[],
|
selectRow:[],
|
||||||
imageUrls: []
|
imageUrls: [],
|
||||||
|
settingDialog: false,
|
||||||
|
settingForm: {
|
||||||
|
safeName: null,
|
||||||
|
safeContact: null,
|
||||||
|
safeMobile: null,
|
||||||
|
toSafe: null,
|
||||||
|
id: null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async doSetting(){
|
||||||
|
try {
|
||||||
|
await updateSafe(this.settingForm)
|
||||||
|
this.settingDialog = false
|
||||||
|
this.$modal.msgSuccess("设置成功")
|
||||||
|
await this.open(this.formData)
|
||||||
|
}catch{}
|
||||||
|
},
|
||||||
|
async handleSetting(){
|
||||||
|
try {
|
||||||
|
const res = await getById(this.formData.id)
|
||||||
|
this.settingForm.id = this.formData.id
|
||||||
|
this.settingForm.toSafe = res.data.toSafe
|
||||||
|
this.settingForm.safeName = res.data.safeName
|
||||||
|
this.settingForm.safeContact = res.data.safeContact
|
||||||
|
this.settingForm.safeMobile = res.data.safeMobile
|
||||||
|
this.settingDialog = true
|
||||||
|
}catch{}
|
||||||
|
},
|
||||||
handleSuccess(){
|
handleSuccess(){
|
||||||
this.open(this.formData)
|
this.open(this.formData)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user