# Conflicts:
#	src/views/repair/screen/repairBigScreen.vue
This commit is contained in:
PQZ 2024-10-22 15:22:37 +08:00
commit aa42ceb0b8
13 changed files with 405 additions and 123 deletions

View File

@ -36,3 +36,19 @@ export function getRepairSoById(id){
method: "get"
})
}
// 员工确认领料
export function confirmGet(id){
return request({
url: preUrl + "/confirmGet?id=" + id,
method: 'get'
})
}
// 员工确认退料
export function confirmBack(id){
return request({
url: preUrl + "/confirmBack?id=" + id,
method: 'get'
})
}

View File

@ -18,3 +18,11 @@ export function getRepairSoiByIds(ids){
method: "get"
})
}
// 按主表ID查
export function getRepairSoiBySoId(soId){
return request({
url: preUrl + "/getBySoId?soId=" + soId,
method: 'get'
})
}

View File

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: 'inspectionBigScreen.vue'
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,37 @@
<template>
<div class="app-container">
<el-tabs v-model="activeTab">
<el-tab-pane label="退料单据" name="receive">
<SoIndex :so-by-type="soByType" :is-back="isBack"/>
</el-tab-pane>
<el-tab-pane label="作废单据" name="voidReceive">
<SoVoid :so-by-type="soByType" :is-back="isBack"/>
</el-tab-pane>
<el-tab-pane label="退料明细" name="detailReceive">
<SoiTable :so-by-type="soByType" :is-back="isBack"/>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import SoVoid from "@/views/repair/stockOperate/Components/SoVoid.vue";
import SoiTable from "@/views/repair/stockOperate/Components/SoiTable.vue";
import SoIndex from "@/views/repair/stockOperate/Components/SoIndex.vue";
export default {
name: "BackStock",
components: {SoIndex, SoiTable, SoVoid},
data(){
return{
activeTab: 'receive',
soByType: false,
isBack: true
}
},
}
</script>
<style scoped lang="scss">
</style>

View File

@ -2,7 +2,7 @@
<div>
<!-- 搜索 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item :label="soByType ? '采购时间' : '领料时间'" prop="searchTimeArray">
<el-form-item :label="soByType ? '采购时间' : !isBack ? '领料时间' : '退料时间'" prop="searchTimeArray">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="queryParams.searchTimeArray"
@ -29,10 +29,10 @@
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item v-if="!soByType" label="领料人" prop="userId">
<el-form-item v-if="!soByType" :label="!isBack ? '领料人' : '退料人'" prop="userId">
<StaffChoose v-model="queryParams.user" @selected="getStaff"/>
</el-form-item>
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<el-form-item v-if="!isBack" :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<CorpChoose v-model="queryParams.corp" @selected="getCompany"/>
</el-form-item>
<el-form-item>
@ -88,15 +88,15 @@
<el-table-column label="单号" align="center" prop="soNo" width="200"/>
<el-table-column label="数量" align="center" prop="itemCount" width="150"/>
<el-table-column label="金额" align="center" prop="totalPrice" width="150"/>
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150"/>
<el-table-column :label="soByType ? '采购员' : !isBack ? '领料人' : '退料人'" align="center" prop="userName" width="150"/>
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="200"/>
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150"/>
<el-table-column :label="soByType ? '入库时间' : !isBack ? '领料时间' : '退料时间'" align="center" prop="soTime" width="150"/>
<el-table-column label="登记时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
</template>
</el-table-column>
<el-table-column label="门店" align="center" prop="corpName" width="180"/>
<el-table-column v-if="!isBack" label="门店" align="center" prop="corpName" width="180"/>
<el-table-column v-if="soByType" label="状态" align="center" prop="soStatus" width="150">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.REPAIR_SO_STATUS" :value="scope.row.soStatus"/>
@ -122,7 +122,7 @@
:limit.sync="queryParams.pageSize"
/>
<SoShow :so-by-type="soByType" ref="soShow" />
<SoShow :so-by-type="soByType" :is-back="isBack" ref="soShow" />
</div>
</template>
@ -159,6 +159,9 @@ export default {
type: Boolean,
defaultValue: false,
required: false
},
isBack:{
type: Boolean
}
},
watch: {
@ -209,17 +212,22 @@ export default {
methods: {
//
async pageSo() {
this.queryParams.soType = null
this.queryParams.purchaseType = null
if (this.soByType && this.goodsYes){
this.queryParams.soType = "03"
this.queryParams.purchaseType = "02"
}
if (this.soByType && !this.goodsYes){
this.queryParams.soType = "01"
else if (this.soByType && !this.goodsYes){
this.queryParams.soType = "01"
this.queryParams.purchaseType = "01"
}
if (!this.soByType){
else if (!this.soByType && !this.isBack){
this.queryParams.soType = "02"
}
else if (this.isBack){
this.queryParams.soType = '04'
}
try {
this.loading = true
const res = await getRepairSoPage(this.queryParams)

View File

@ -30,7 +30,7 @@
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{soByType ? '采购员' : '领料人'}}
{{soByType ? '采购员' : !isBack ? '领料人':'退料人'}}
</template>
{{info.userName}}
</el-descriptions-item>
@ -48,7 +48,7 @@
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
{{soByType ? '入库时间' : '领料时间'}}
{{soByType ? '入库时间' : !isBack ? '领料时间' : '退料时间'}}
</template>
{{parseTime(info.soTime, '{y}-{m}-{d}')}}
</el-descriptions-item>
@ -113,7 +113,7 @@
</template>
</el-table-column>
<el-table-column label="所属门店" align="center" prop="corpName" width="180" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150">
<el-table-column :label="soByType ? '入库时间' : !isBack ? '领料时间' : '退料时间'" align="center" prop="soTime" width="150">
<template slot-scope="scope">
{{parseTime(info.soTime, '{y}-{m}-{d}')}}
</template>
@ -142,6 +142,9 @@ export default {
soByType:{
type: Boolean,
default: true,
},
isBack:{
type: Boolean
}
},
data() {

View File

@ -18,10 +18,10 @@
<el-form-item label="单据号" prop="soNo">
<el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
</el-form-item>
<el-form-item v-if="!soByType" label="领料人" prop="userId">
<el-form-item v-if="!soByType" :label="!isBack ? '领料人' : '退料人'" prop="userId">
<StaffChoose v-model="queryParams.user" @selected="getStaff"/>
</el-form-item>
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<el-form-item v-if="!isBack" :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<CorpChoose v-model="queryParams.corp" />
</el-form-item>
<el-form-item>
@ -42,9 +42,9 @@
<el-table-column label="单号" align="center" prop="soNo" width="200" />
<el-table-column label="数量" align="center" width="150" prop="itemCount" />
<el-table-column label="金额" align="center" prop="totalPrice" width="150" />
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="userName" width="150" />
<el-table-column :label="soByType ? '采购员' : !isBack ? '领料人' : '退料人'" align="center" prop="userName" width="150" />
<el-table-column v-if="soByType" label="供应商" align="center" prop="supplierName" width="150" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="soTime" width="150" />
<el-table-column :label="soByType ? '入库时间' : !isBack ? '领料时间' : '退料时间'" align="center" prop="soTime" width="150" />
<el-table-column label="登记时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
@ -70,7 +70,7 @@
<pagination @pagination="pageSo" style="margin-bottom: 3rem" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
/>
<SoShow :so-by-type="soByType" ref="soShow" />
<SoShow :so-by-type="soByType" :is-back="isBack" ref="soShow" />
</div>
</template>
@ -90,6 +90,9 @@ export default {
defaultValue: true,
required: true
},
isBack:{
type: Boolean
}
},
watch:{
'queryParams.supplier'(val){
@ -133,6 +136,9 @@ export default {
methods: {
async pageSo(){
try {
if (this.isBack){
this.queryParams.soType = "04"
}
this.loading = true
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records

View File

@ -2,7 +2,7 @@
<div>
<!-- 搜索 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item :label="soByType ? '采购时间' : '领料时间'" prop="searchTimeArray">
<el-form-item :label="soByType ? '采购时间' : !isBack ? '领料时间' : '退料时间'" prop="searchTimeArray">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="queryParams.searchTimeArray"
@ -15,7 +15,7 @@
<el-form-item label="关键字" prop="query">
<el-input v-model="queryParams.query" style="width: 18rem" placeholder="请输入单号、商品名称、编码或规格"/>
</el-form-item>
<el-form-item :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<el-form-item v-if="!isBack" :label="soByType ? '采购门店' : '领料门店'" prop="corpId">
<CorpChoose v-model="queryParams.corp" />
</el-form-item>
<el-form-item v-if="soByType" label="所属库位" prop="wareId">
@ -28,11 +28,11 @@
</el-form>
<!-- 操作 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-download" size="mini"
>导出
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" plain icon="el-icon-download" size="mini"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row>
<!-- 表格 -->
@ -44,7 +44,7 @@
</el-table-column>
<el-table-column label="单号" align="center" prop="so.soNo" width="200" />
<el-table-column label="商品名称" align="center" prop="repairWares.name" width="180" />
<el-table-column :label="soByType ? '采购员' : '领料人'" align="center" prop="so.userName" width="180" />
<el-table-column :label="soByType ? '采购员' : !isBack ? '领料人' : '退料人'" align="center" prop="so.userName" width="180" />
<el-table-column label="商品编码" align="center" prop="repairWares.code" width="180" />
<el-table-column v-if="soByType" label="条形码" align="center" prop="repairWares.barCode" width="180" />
<el-table-column label="规格" align="center" prop="repairWares.model" width="180" />
@ -62,7 +62,7 @@
</template>
</el-table-column>
<el-table-column label="所属门店" align="center" prop="so.corpId" width="180" />
<el-table-column :label="soByType ? '入库时间' : '领料时间'" align="center" prop="so.createTime" width="150">
<el-table-column :label="soByType ? '入库时间' : !isBack ? '领料时间' : '退料时间'" align="center" prop="so.createTime" width="150">
<template slot-scope="scope">
{{parseTime(scope.row.so.createTime, '{y}-{m}-{d}')}}
</template>
@ -90,6 +90,9 @@ export default {
defaultValue: true,
required: true
},
isBack:{
type: Boolean
}
},
watch:{
'queryParams.corp'(val){
@ -126,6 +129,9 @@ export default {
},
//
async pageSoi(){
if (this.isBack){
this.queryParams.soiType = "04"
}
try {
this.loading = true
const res = await getSoiPage(this.queryParams)

View File

@ -57,20 +57,31 @@
<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="waresCount" 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>
<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="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>
<span class="item__txt">{{ scope.row.waresCount }}</span>
</div>
</el-table-column>
<el-table-column label="库存数量" align="center" prop="wares.stock" width="180"/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handlePass" :disabled="selections.length === 0 || selections.filter(item => !item.isStock).length !== 0">
通知领
<el-button type="primary" v-if="type" @click="handlePass" :disabled="selections.length === 0 || selections.filter(item => !item.isStock).length !== 0">
通知领
</el-button>
<el-button type="primary" @click="handleCreate" :disabled="selections.length === 0">
<el-button type="primary" v-else @click="handlePass" :disabled="selections.length === 0 || selections.filter(item => !item.isStock).length !== 0">
通知退料
</el-button>
<el-button v-if="type" type="primary" @click="handleCreate" :disabled="selections.length === 0">
采购
</el-button>
</div>
@ -179,7 +190,8 @@ export default {
pageNo: 1,
pageSize: 10,
query: null,
type: this.type ? "01" : "02"
type: "01",
isBack: this.type ? null : true
},
showSearch: true,
loading: false,
@ -207,29 +219,30 @@ export default {
methods:{
// truefalse
async handlePass(){
//
if (this.type){
// 退
this.formData.repairSo = {
soType: "02",
soNo: createUniqueCodeByHead("LL"),
soType: this.type ? "02" : "04",
soNo: createUniqueCodeByHead(this.type ? "LL" : "TL"),
userId: this.formData.repairId,
userName: this.formData.repairName,
soTime: parseTime(Date.now(), '{y}-{m}-{d}'),
soStatus: "04",
purchaseType: "01"
soStatus: this.type ? "04" : "07",
// purchaseType: "01"
}
this.formData.repairSois = [...this.selections.map(item => {
return {
soiType: '02',
soiType: this.type ? '02' : "04",
goodsId: item.waresId,
goodsCount: item.waresCount,
}
})]
this.formData.items = [...this.selections.map(item => {
return {
id: item.id,
}
})]
if (this.type){
this.formData.items = [...this.selections.map(item => {
return {
id: item.id,
}
})]
}
try {
await pass(this.formData)
this.$modal.msgSuccess("处理成功")
@ -237,23 +250,6 @@ export default {
}finally {
this.dialogVisible = false
}
}else {
// 退
this.formData = {}
this.formData.items = [...this.selections.map(item => {
return {
id: item.id,
waresStatus: "05"
}
})]
try {
await passBackTicketWares(this.formData)
this.$modal.msgSuccess("处理成功")
await this.getList()
}finally {
this.dialogVisible = false
}
}
},
// truefalse
async handleCreate(flag){
@ -310,19 +306,12 @@ export default {
const data = {twId: row.id}
const res = await listTwItem(data)
this.items = res.data
//
this.items.forEach(item => {
const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
item.waresCount = count
item.isStock = count <= item.wares.stock
})
//
if (this.type){
this.items = this.items.filter(item => item.waresStatus === '02')
}else {
//
this.items = this.items.filter(item => item.waresStatus !== '02')
}
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)
}finally {
this.dialogLoading = false
}
@ -404,7 +393,11 @@ export default {
/** 保存数据 */
save(row) {
//
row.isStock = row.waresCount <= row.wares.stock
row.isStock = this.type ? row.waresCount <= row.wares.stock : row.waresCount <= row.waresAlreadyCount
if (!this.type && !row.isStock){
this.$modal.msgWarning("退料数量不能超过领取数量")
row.waresCount = row.waresAlreadyCount
}
row.totalPrice = row.count * row.newPrice
const id = row.id
// cell
@ -412,6 +405,7 @@ export default {
this.cancelEditable(cell)
})
this.clickCellMap[id] = []
this.selections = []
this.tableKey++
},
changeWare(row) {

View File

@ -5,11 +5,12 @@
<el-form-item label="关键字" prop="query">
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话" v-model="queryParams.query"/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status">
<el-option v-for="item in this.getDictDatas(DICT_TYPE.TICKET_WARES_STATUS)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<!-- <el-form-item label="状态" prop="status">-->
<!-- <el-select v-model="queryParams.status">-->
<!-- <el-option v-for="item in this.getDictDatas(DICT_TYPE.TICKET_WARES_STATUS)" :key="item.value"-->
<!-- :label="item.label" :value="item.value"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
@ -25,30 +26,33 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单据号" align="center" prop="no" />
<el-table-column label="服务顾问" align="center" prop="adviserName" />
<el-table-column label="申请人" align="center" prop="repairName" />
<el-table-column label="单据号" align="center" prop="no"/>
<el-table-column label="服务顾问" align="center" prop="adviserName"/>
<el-table-column label="申请人" align="center" prop="repairName"/>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.TICKET_WARES_STATUS" v-model="scope.row.status" />
<dict-tag :type="DICT_TYPE.TICKET_WARES_STATUS" v-model="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.status !== '01' || userRole !== 'service_advisor'" type="text" size="mini" icon="el-icon-view" @click="handleShow(scope.row)">
<el-button v-if="scope.row.status !== '01' || userRole !== 'service_advisor'" type="text" size="mini"
icon="el-icon-view" @click="handleShow(scope.row)">
查看
</el-button>
<el-button v-if="(userRole === 'service_advisor' || userRole === 'general_inspection') && scope.row.status === '01'" @click="handleAudit(scope.row)" type="text" size="mini" icon="el-icon-s-check">
<el-button
v-if="(userRole === 'service_advisor' || userRole === 'general_inspection') && scope.row.status === '01'"
@click="handleAudit(scope.row)" type="text" size="mini" icon="el-icon-s-check">
审核
</el-button>
<!-- todo 待完成 -->
<el-button @click="handleGet(scope.row)" v-if="userRole === 'repair_staff' && scope.row.status !== '01' && scope.row.type === '01'" type="text" size="mini" icon="el-icon-finished">
领料确认
</el-button>
<el-button @click="handleGet(scope.row)" v-if="userRole === 'repair_staff' && scope.row.status !== '01' && scope.row.type === '02'" type="text" size="mini" icon="el-icon-finished">
退料确认
</el-button>
<!-- &lt;!&ndash; todo 待完成 &ndash;&gt;-->
<!-- <el-button @click="handleGet(scope.row)" v-if="userRole === 'repair_staff' && scope.row.status !== '01' && scope.row.type === '01'" type="text" size="mini" icon="el-icon-finished">-->
<!-- 领料确认-->
<!-- </el-button>-->
<!-- <el-button @click="handleGet(scope.row)" v-if="userRole === 'repair_staff' && scope.row.status !== '01' && scope.row.type === '02'" type="text" size="mini" icon="el-icon-finished">-->
<!-- 退料确认-->
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>
@ -59,18 +63,19 @@
<TicketWaresShow ref="ticketWaresShow" :user-role="userRole" @success="getList" :type="type"/>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-table el-table v-loading="dialogLoading" :data="items" :stripe="true" :show-overflow-tooltip="true" @selection-change="handleSelect">
<el-table-column type="selection" width="80" align="center" />
<el-table el-table v-loading="dialogLoading" :data="items" :stripe="true" :show-overflow-tooltip="true"
@selection-change="handleSelect">
<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="waresCount" width="180"/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleDoGet(false)" :disabled="selections.length === 0">
{{this.type ? '领料选择' : '退料选择'}}
{{ this.type ? '领料选择' : '退料选择' }}
</el-button>
<el-button type="primary" :disabled="items.length === 0" @click="handleDoGet(true)">
{{this.type ? '领料全部' : '退料全部'}}
{{ this.type ? '领料全部' : '退料全部' }}
</el-button>
</div>
</el-dialog>
@ -85,18 +90,18 @@ import {listTwItem} from "@/api/repair/tickets/TWItem";
export default {
name: "TicketWares",
components: {TicketWaresShow},
props:{
props: {
type: Boolean,
userRole: String,
},
data(){
return{
queryParams:{
data() {
return {
queryParams: {
pageNo: 1,
pageSize: 10,
query: null,
type: this.type ? "01" : "02",
status: null
status: "01"
},
showSearch: true,
loading: false,
@ -106,41 +111,41 @@ export default {
dialogLoading: false,
items: [],
selections: [],
formData:{},
formData: {},
dialogTitle: ""
}
},
mounted() {
this.getList()
},
methods:{
async getList(){
methods: {
async getList() {
try {
this.loading = true
const res = await getPage(this.queryParams)
if (res.data){
if (res.data) {
this.list = res.data.records
this.total = res.data.total
}
}finally {
} finally {
this.loading = false
}
},
handleQuery(){
handleQuery() {
this.queryParams.pageNo = 1
this.getList()
},
resetQuery(){
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
handleShow(row){
handleShow(row) {
this.$refs.ticketWaresShow.open(row)
},
handleAudit(row){
handleAudit(row) {
this.handleShow(row)
},
async handleGet(row){
async handleGet(row) {
this.formData = {
id: row.id,
}
@ -152,29 +157,29 @@ export default {
const res = await listTwItem(data)
this.items = res.data
//
if (this.type){
if (this.type) {
this.items = this.items.filter(item => item.waresStatus === '04')
}else {
} else {
// 退
this.items = this.items.filter(item => item.waresStatus === '05')
}
}finally {
} finally {
this.dialogLoading = false
}
},
handleSelect(val){
handleSelect(val) {
this.selections = val
},
async handleDoGet(flag){
async handleDoGet(flag) {
this.formData.type = this.type ? "01" : "02"
if (flag){
if (flag) {
this.formData.items = [...this.items.map(item => {
return {
id: item.id,
waresStatus: this.type ? "01" : "03"
}
})]
}else {
} else {
this.formData.items = [...this.selections.map(item => {
return {
id: item.id,
@ -187,7 +192,8 @@ export default {
this.dialogVisible = false
this.$modal.msgSuccess(this.type ? "领料成功" : "退料成功")
await this.getList()
}catch{}
} catch {
}
}
}
}

View File

@ -7,9 +7,15 @@
<el-tab-pane label="已完成工单" name="finish">
<TicketManagerItem :is-finish="true" :user-role="userRole"/>
</el-tab-pane>
<el-tab-pane :label="userRole !== 'repair_staff' ? '配件申请单' : '领退料确认'" name="getApply">
<el-tab-pane label="配件申请单" name="getApply" v-if="userRole !== 'repair_staff'">
<TicketWares :type="true" :user-role="userRole"/>
</el-tab-pane>
<el-tab-pane name="finishGetWares" label="领料确认" v-if="userRole === 'repair_staff'">
<GetAndBackWares :type="true" />
</el-tab-pane>
<el-tab-pane label="退料确认" name="finishBackWares" v-if="userRole === 'repair_staff'">
<GetAndBackWares :type="false" />
</el-tab-pane>
<!-- <el-tab-pane label="退料申请单" name="backApply">-->
<!-- <TicketWares :type="false" :user-role="userRole"/>-->
<!-- </el-tab-pane>-->
@ -21,10 +27,11 @@
import TicketManagerItem from "@/views/repair/tickets/Components/TicketManagerItem.vue";
import {getUserRole} from "@/api/repair/tickets/Tickets";
import TicketWares from "@/views/repair/tickets/Components/TicketWares.vue";
import GetAndBackWares from "@/views/repair/tickets/form/GetAndBackWares.vue";
export default {
name: "TicketManager",
components: {TicketWares, TicketManagerItem},
components: {GetAndBackWares, TicketWares, TicketManagerItem},
data() {
return {
activeTab: 'unFinish',

View File

@ -0,0 +1,165 @@
<template>
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="关键字" prop="soNo">
<el-input style="width: 20rem" type="text" placeholder="工单号、车牌号、联系电话" v-model="queryParams.soNo"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作 -->
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" align="center" width="80">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="单号" align="center" prop="soNo"/>
<el-table-column label="数量" align="center" prop="itemCount"/>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" size="mini"
icon="el-icon-view"
@click="showItem(scope.row)"
>
查看
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog :title="type ? '领料确认' : '退料确认'" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
<el-table v-loading="dialogLoading" :data="items" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" align="center" width="80">
<template scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="商品名称" align="center" prop="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="goodsCount" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="handleConfirm">
确认
</el-button>
<el-button type="info" size="small" @click="handleVoid">
作废
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getRepairSoPage, voidSo, confirmGet, confirmBack} from "@/api/repair/stockOperate/stockOperate";
import {getUserProfile} from "@/api/system/user";
import {getRepairSoiBySoId} from "@/api/repair/stockOperate/stockOperateItem";
export default {
name: "GetAndBackWares",
props: {
type: Boolean,
},
data(){
return{
queryParams: {
pageNo: 1,
pageSize: 10,
soType: this.type ? "02" : "04",
soStatus: this.type ? "04" : "07",
soNo: null,
},
showSearch: true,
loading: false,
list: [],
total: 0,
userId: null,
dialogVisible: false,
items: [],
dialogLoading: false,
formData:{}
}
},
mounted() {
this.getList()
},
methods:{
async getList(){
try {
this.loading = true
if (!this.userId){
const res = await getUserProfile()
this.userId = res.data.id
}
this.queryParams['userId'] = this.userId
const res = await getRepairSoPage(this.queryParams)
this.list = res.data.records
this.total = res.data.total
}finally {
this.loading = false
}
},
handleQuery(){
this.queryParams.pageNo = 1
this.getList()
},
resetQuery(){
this.resetForm('queryForm')
this.handleQuery()
},
async showItem(row){
this.formData['id'] = row.id
try{
this.items = []
this.dialogVisible = true
this.dialogLoading = true
const res = await getRepairSoiBySoId(row.id)
this.items = res.data
}finally {
this.dialogLoading = false
}
},
async handleConfirm(){
if (this.type){
try {
await confirmGet(this.formData.id)
this.dialogVisible = false
this.$modal.msgSuccess("操作成功")
await this.getList()
}catch{}
}else {
await confirmBack(this.formData.id)
this.dialogVisible = false
this.$modal.msgSuccess("操作成功")
await this.getList()
}
},
//
async handleVoid(){
try {
await this.$modal.confirm("确认作废该单据?")
this.formData['soStatus'] = '06'
await voidSo(this.formData)
this.dialogVisible = false
this.$modal.msgSuccess("操作成功")
await this.getList()
}catch {}
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: 'rescueBigScreen'
}
</script>
<style scoped>
</style>