改配件申请100%

This commit is contained in:
xiaofajia 2024-11-12 17:44:44 +08:00
parent b8636a1728
commit 1870f2f898
3 changed files with 59 additions and 57 deletions

View File

@ -21,17 +21,24 @@
</template>
</el-table-column>
<el-table-column label="单据号" align="center" prop="no" width="200"/>
<el-table-column label="客户车牌" align="center" prop="licenseNumber"/>
<el-table-column label="服务顾问" align="center" prop="adviserName"/>
<el-table-column label="申请人" align="center" prop="repairName"/>
<el-table-column label="状态" align="center" prop="status">
<el-table-column label="客户信息" align="center">
<el-table-column label="姓名" align="center" prop="userName" width="180"/>
<el-table-column label="联系电话" align="center" prop="userMobile" width="180"/>
<el-table-column label="车牌号" align="center" prop="licenseNumber" width="180"/>
</el-table-column>
<el-table-column label="申请人" align="center" prop="repairName" width="180"/>
<el-table-column label="岗位" align="center" prop="repairWork" width="180">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.TICKET_WARES_STATUS" v-model="scope.row.status"/>
<dict-tag :type="DICT_TYPE.REPAIR_WORK_TYPE" :value="scope.row.repairWork" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center">
<el-table-column label="服务顾问" align="center" prop="adviserName" width="180"/>
<el-table-column label="备注" align="center" prop="remark" width="180" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" fixed="right" width="180">
<template slot-scope="scope">
<el-button type="text" size="mini" icon="el-icon-view" @click="handleView(scope.row)">
查看
</el-button>
<el-button type="text" size="mini" @click="handleDispose(scope.row)" icon="el-icon-edit">
处理
</el-button>
@ -39,7 +46,7 @@
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
<pagination style="margin-bottom: 2rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"
/>
@ -57,7 +64,7 @@
>
<el-table-column type="selection" width="80" align="center"/>
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
<!-- <el-table-column label="规格" align="center" prop="wares.model" width="180"/>-->
<el-table-column label="领料数量" v-if="type" align="center" prop="waresCount" width="180">
<div class="item" slot-scope="scope">
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
@ -130,9 +137,14 @@
</el-table-column>
<el-table-column label="库存" align="center" width="150" prop="stock"/>
<el-table-column label="单位" align="center" width="150" prop="unit">
<template slot-scope="scope">
<div class="item" slot-scope="scope">
<el-select class="item__input" v-model="scope.row.unit" @blur="save(scope.row)">
<el-option v-for="dict in getDictDatasToType(DICT_TYPE.REPAIR_UNIT)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
<span class="item__txt">
<dict-tag :type="DICT_TYPE.REPAIR_UNIT" v-model="scope.row.unit"/>
</template>
</span>
</div>
</el-table-column>
<el-table-column label="数量" align="center" width="150" prop="count">
<div class="item" slot-scope="scope">
@ -174,6 +186,8 @@
<el-button type="primary" @click="handleSubmit">确定</el-button>
</div>
</el-dialog>
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/>
</div>
</template>
@ -186,10 +200,11 @@ import SoTable from "@/views/repair/stockOperate/Components/SoTable.vue";
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
import {getUserProfile} from "@/api/system/user";
import TicketWaresShow from "@/views/repair/tickets/Components/TicketWaresShow.vue";
export default {
name: "WaresItem",
components: {WarehouseChoose, SoTable},
components: {TicketWaresShow, WarehouseChoose, SoTable},
props: {
type: Boolean,
},
@ -199,8 +214,7 @@ export default {
pageNo: 1,
pageSize: 10,
query: null,
type: "01",
isBack: this.type ? null : true
isBack: !this.type,
},
showSearch: true,
loading: false,
@ -217,7 +231,7 @@ export default {
// cell
clickCellMap: {},
//
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model'],
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model', 'unit'],
remark: null,
tableKey: 0,
}
@ -226,6 +240,9 @@ export default {
this.getList()
},
methods: {
getDictDatasToType(type){
return this.getDictDatas(type)
},
// truefalse
async handlePass() {
// 退
@ -304,15 +321,13 @@ export default {
const data = {twId: row.id}
const res = await listTwItem(data)
this.items = res.data
this.items = this.items.filter(item => item.waresStatus === '1')
this.items.forEach(item => {
const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
item.waresCount = this.type ? count : item.waresAlreadyCount
item.isStock = this.type ? count <= item.wares.stock : true
})
this.items = this.items.filter(item => this.type ? item.waresStatus === '02' : item.waresAlreadyCount)
if (!this.type) {
this.items = this.items.filter(item => item.waresAlreadyCount !== item.waresBackCount)
}
this.items = this.items.filter(item => this.type ? (item.waresCount > item.waresAlreadyCount) : (item.waresAlreadyCount > 0))
} finally {
this.dialogLoading = false
}
@ -497,6 +512,9 @@ export default {
}
})
return flag.filter(item => item !== "").join(",")
},
handleView(row){
this.$refs.ticketWaresShow.open(row)
}
}
}

View File

@ -95,12 +95,12 @@
<!-- </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.wareStatus === '0'">
<template slot-scope="scope" v-if="scope.row.waresStatus === '0'">
<span style="color: #ffd51c">°</span>
</template>
</el-table-column>
<el-table-column label="√" prop="wareStatus" align="center">
<template slot-scope="scope" v-if="scope.row.wareStatus === '1'">
<template slot-scope="scope" v-if="scope.row.waresStatus === '1'">
<span style="color: #3aff70">°</span>
</template>
</el-table-column>
@ -113,13 +113,13 @@
<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="wareStatus" align="center">
<template slot-scope="scope" v-if="scope.row.wareStatus === '0'">
<el-table-column label="×" prop="waresStatus" align="center">
<template slot-scope="scope" v-if="scope.row.waresStatus === '0'">
<span style="color: #ffd51c">°</span>
</template>
</el-table-column>
<el-table-column label="√" prop="wareStatus" align="center">
<template slot-scope="scope" v-if="scope.row.wareStatus === '1'">
<template slot-scope="scope" v-if="scope.row.waresStatus === '1'">
<span style="color: #3aff70">°</span>
</template>
</el-table-column>
@ -201,6 +201,9 @@ export default {
itemDiscount: 1,
}
})]
if (this.type){
this.items = [...this.items.filter(item => item.waresStatus === "")]
}
} finally {
this.loading = false
}
@ -221,40 +224,21 @@ export default {
// if (names) {
// await this.$modal.confirm("" + names + "0")
// }
this.formData['status'] = flag ? "02" : '03'
this.dialogLoading = this.$loading({
target: this.$refs.dialogRef.$el
})
this.formData['status'] = flag ? "01" : '02'
//
if (this.selectRow && this.selectRow.length > 0){
this.formData.wares = [...this.selectRow.map(item => {
this.formData.items = [...this.selectRow.map(item => {
return {
itemName: item.waresName,
itemCount: item.waresCount,
itemUnit: item.wares.unit,
itemPrice: item.wares.price,
repairIds: this.formData.repairId,
repairNames: this.formData.repairName,
saleId: this.formData.adviserId,
saleName: this.formData.adviserName,
itemDiscount: item.itemDiscount,
itemMoney: item.wares.price * item.waresCount * (item.itemDiscount / 10),
partId: item.waresId,
remark: item.remark
id: item.id
}
})]
}else {
this.formData.wares = [...this.items.map(item => {
this.formData.items = [...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
id: item.id
}
})]
}
@ -262,10 +246,9 @@ export default {
this.dialogVisible = false
this.$modal.msgSuccess("审核成功")
this.$emit('success')
} catch {
} finally {
this.dialogLoading.close()
}
},
/** 鼠标移入cell */
handleCellEnter(row, column, cell, event) {

View File

@ -45,8 +45,8 @@
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" prop="repairWares.name" />
<el-table-column label="商品编码" align="center" prop="repairWares.code" />
<el-table-column label="规格" align="center" prop="repairWares.model" />
<!-- <el-table-column label="商品编码" align="center" prop="repairWares.code" />-->
<!-- <el-table-column label="规格" align="center" prop="repairWares.model" />-->
<el-table-column label="数量" align="center" prop="goodsCount" />
</el-table>
<el-form style="margin-top: 1rem" :inline="true">
@ -132,6 +132,7 @@ export default {
this.formData['id'] = row.id
try{
this.items = []
this.image = null
this.dialogVisible = true
this.dialogLoading = true
const res = await getRepairSoiBySoId(row.id)