退料
This commit is contained in:
parent
46e7b3d3bf
commit
4df130985e
@ -67,3 +67,11 @@ export function listByLeads(){
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查当前登录用户是否维修班组长
|
||||
export function getIfLeader(){
|
||||
return request({
|
||||
url: "/repair/worker/getIfLeader",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
@ -54,3 +54,12 @@ export function repairPassTicketWares(data){
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 仓库确认退料
|
||||
export function passBackTicketWares(data){
|
||||
return request({
|
||||
url: preUrl + '/passBack',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
@ -55,8 +55,8 @@
|
||||
<el-button type="success" @click="handlePass(true)"
|
||||
:disabled="this.items.filter(item => !item.isStock).length !== 0"
|
||||
:title="this.items.filter(item => !item.isStock).length !== 0 ? '有配件库存不足':''">通过全部</el-button>
|
||||
<el-button type="primary" @click="handleCreate(false)" :disabled="selections.length === 0">选择生成采购单</el-button>
|
||||
<el-button type="primary" @click="handleCreate(true)">全部生成采购单</el-button>
|
||||
<el-button v-if="type" type="primary" @click="handleCreate(false)" :disabled="selections.length === 0">选择生成采购单</el-button>
|
||||
<el-button v-if="type" type="primary" @click="handleCreate(true)">全部生成采购单</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@ -142,7 +142,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getPage, pass} from "@/api/repair/tickets/TicketWares";
|
||||
import {getPage, pass, passBackTicketWares} from "@/api/repair/tickets/TicketWares";
|
||||
import {listTwItem} from "@/api/repair/tickets/TWItem";
|
||||
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
|
||||
import {parseTime} from "@/utils/ruoyi";
|
||||
@ -191,6 +191,7 @@ export default {
|
||||
// 通过 true是全部、false是选择
|
||||
async handlePass(flag){
|
||||
// 生成领料单
|
||||
if (this.type){
|
||||
this.formData.repairSo = {
|
||||
soType: "02",
|
||||
soNo: createUniqueCodeByHead("LL"),
|
||||
@ -236,6 +237,32 @@ export default {
|
||||
}finally {
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}else {
|
||||
// 退料方法
|
||||
this.formData = {}
|
||||
if (flag){
|
||||
this.formData.items = [...this.items.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
waresStatus: "05"
|
||||
}
|
||||
})]
|
||||
}else {
|
||||
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
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生成采购 true是全部、false是选择
|
||||
async handleCreate(flag){
|
||||
@ -289,7 +316,8 @@ export default {
|
||||
this.dialogVisible = true
|
||||
try {
|
||||
this.dialogLoading = true
|
||||
const res = await listTwItem({twId: row.twId})
|
||||
const data = {twId: row.id}
|
||||
const res = await listTwItem(data)
|
||||
this.items = res.data
|
||||
// 库存判断
|
||||
this.items.forEach(item => {
|
||||
|
@ -153,7 +153,7 @@ export default {
|
||||
this.info = row
|
||||
const id = row.id
|
||||
const res = await getSt(id)
|
||||
console.log(res.data)
|
||||
// console.log(res.data)
|
||||
this.info.items = res.data.items
|
||||
const response = await getBaseWarehouseList()
|
||||
this.warehouseList = response.data
|
||||
|
@ -338,7 +338,7 @@ export default {
|
||||
this.list.splice(index, 1)
|
||||
}
|
||||
},
|
||||
// TODO 新增
|
||||
// 新增
|
||||
handleCreateItem() {
|
||||
switch (this.itemType) {
|
||||
case "project":
|
||||
|
@ -44,22 +44,25 @@
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||
>查看
|
||||
</el-button>
|
||||
<el-button v-if="scope.row.ticketsWorkStatus === '01' && (userRole === 3 || userRole === 4)" size="mini" type="text" icon="el-icon-check" @click="handleTake(scope.row)">
|
||||
<el-button v-if="scope.row.ticketsWorkStatus === '01' && userRole === 'repair_staff'" size="mini" type="text" icon="el-icon-check" @click="handleTake(scope.row)">
|
||||
接单
|
||||
</el-button>
|
||||
<el-button v-if="userRole === 2 && scope.row.ticketsWorkStatus === '01'" size="mini" type="text" icon="el-icon-check" @click="handleNotify(scope.row)">
|
||||
<el-button v-if="userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '01'" size="mini" type="text" icon="el-icon-check" @click="handleNotify(scope.row)">
|
||||
通知施工
|
||||
</el-button>
|
||||
<el-dropdown @command="(command) => handleCommand(command, scope.$index, scope.row)">
|
||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-if="!isFinish && scope.row.ticketsWorkStatus === '02' && (userRole === 3 || userRole === 4)" command="handleGet" size="mini" type="text" icon="el-icon-document-add"
|
||||
<el-dropdown-item v-if="!isFinish && scope.row.ticketsWorkStatus === '02' && userRole === 'repair_staff'" command="handleGet" size="mini" type="text" icon="el-icon-document-add"
|
||||
>申请领料
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="scope.row.ticketsWorkStatus === '02' && (userRole === 3 || userRole === 4)" command="handleBack" size="mini" type="text" icon="el-icon-document-delete"
|
||||
<el-dropdown-item v-if="scope.row.ticketsWorkStatus === '02' && userRole === 'repair_staff'" command="handleBack" size="mini" type="text" icon="el-icon-document-delete"
|
||||
>申请退料
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="userRole !== 4" command="handleReTake" size="mini" type="text" icon="el-icon-refresh"
|
||||
<!-- 还要判断是不是员工 -->
|
||||
<el-dropdown-item
|
||||
v-if="userRole === 'repair_staff' ? leader : true"
|
||||
command="handleReTake" size="mini" type="text" icon="el-icon-refresh"
|
||||
>重新指派
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -105,7 +108,7 @@
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="doBack(false)" type="primary" :disabled="selections.length === 0">退料选择</el-button>
|
||||
<el-button @click="doBack(true)" type="success">退料全部</el-button>
|
||||
<el-button @click="doBack(true)" type="success" :disabled="partList.length === 0">退料全部</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -119,6 +122,7 @@ import TWOperate from "@/views/repair/tickets/form/TWOperate.vue";
|
||||
import {listTwItem} from "@/api/repair/tickets/TWItem";
|
||||
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
|
||||
import {updateTicketWares} from "@/api/repair/tickets/TicketWares";
|
||||
import {getIfLeader} from "@/api/repair/repairworker";
|
||||
|
||||
export default {
|
||||
name: "TicketManagerItem",
|
||||
@ -128,8 +132,8 @@ export default {
|
||||
type: Boolean,
|
||||
},
|
||||
userRole: {
|
||||
type: Number,
|
||||
default: -1,
|
||||
type: String,
|
||||
default: '',
|
||||
required: true
|
||||
}
|
||||
},
|
||||
@ -155,13 +159,19 @@ export default {
|
||||
editProp: ['remark', 'waresCount'],
|
||||
selections: [],
|
||||
formData: {},
|
||||
remark: null
|
||||
remark: null,
|
||||
leader: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.listTickets()
|
||||
this.isLeader()
|
||||
},
|
||||
methods: {
|
||||
async isLeader(){
|
||||
const res = await getIfLeader()
|
||||
this.leader = res.data
|
||||
},
|
||||
async listTickets() {
|
||||
try {
|
||||
this.loading = true
|
||||
@ -216,7 +226,10 @@ export default {
|
||||
this.backVisible = true
|
||||
try {
|
||||
this.backLoading = true
|
||||
const res = await listTwItem({twId: row.twId})
|
||||
const data = {
|
||||
twId: row.twId
|
||||
}
|
||||
const res = await listTwItem(data)
|
||||
this.partList = res.data
|
||||
// 未领料的不要
|
||||
this.partList = this.partList.filter(item => item.waresStatus === '01')
|
||||
@ -228,7 +241,8 @@ export default {
|
||||
handleReTake(row){
|
||||
row = {
|
||||
...row,
|
||||
isLeads: this.userRole === 3
|
||||
// 还要判断是不是班组长
|
||||
isLeads: this.userRole === 'repair_staff'
|
||||
}
|
||||
this.$refs.updateRepair.open(row)
|
||||
},
|
||||
|
@ -36,15 +36,18 @@
|
||||
<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 === 3 || userRole === 4" 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 === 1 || userRole === 2 && 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>
|
||||
<el-button @click="handleGet(scope.row)" v-if="userRole === 3 || userRole === 4 && scope.row.status !== '01'" type="text" size="mini" icon="el-icon-finished">
|
||||
<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>
|
||||
@ -54,7 +57,7 @@
|
||||
/>
|
||||
<TicketWaresShow ref="ticketWaresShow" :user-role="userRole" @success="getList" :type="type"/>
|
||||
|
||||
<el-dialog title="领料确认" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||
<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-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
||||
@ -62,8 +65,12 @@
|
||||
<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">领料选择</el-button>
|
||||
<el-button type="primary" @click="handleDoGet(true)">领料全部</el-button>
|
||||
<el-button type="primary" @click="handleDoGet(false)" :disabled="selections.length === 0">
|
||||
{{this.type ? '领料选择' : '退料选择'}}
|
||||
</el-button>
|
||||
<el-button type="primary" :disabled="items.length === 0" @click="handleDoGet(true)">
|
||||
{{this.type ? '领料全部' : '退料全部'}}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -79,7 +86,7 @@ export default {
|
||||
components: {TicketWaresShow},
|
||||
props:{
|
||||
type: Boolean,
|
||||
userRole: Number,
|
||||
userRole: String,
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
@ -99,6 +106,7 @@ export default {
|
||||
items: [],
|
||||
selections: [],
|
||||
formData:{},
|
||||
dialogTitle: ""
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -136,16 +144,18 @@ export default {
|
||||
id: row.id,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
this.dialogTitle = this.type ? "领料确认" : "退料确认"
|
||||
try {
|
||||
this.dialogLoading = true
|
||||
const res = await listTwItem({twId: row.twId})
|
||||
const data = {twId: row.id}
|
||||
const res = await listTwItem(data)
|
||||
this.items = res.data
|
||||
// 只要可领料的
|
||||
if (this.type){
|
||||
this.items = this.items.filter(item => item.waresStatus === '04')
|
||||
}else {
|
||||
// 只要已领料
|
||||
this.items = this.items.filter(item => item.waresStatus === '01')
|
||||
// 只要可退料的
|
||||
this.items = this.items.filter(item => item.waresStatus === '05')
|
||||
}
|
||||
}finally {
|
||||
this.dialogLoading = false
|
||||
@ -155,25 +165,26 @@ export default {
|
||||
this.selections = val
|
||||
},
|
||||
async handleDoGet(flag){
|
||||
this.formData.type = this.type ? "01" : "02"
|
||||
if (flag){
|
||||
this.formData.items = [...this.items.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
waresStatus: "01"
|
||||
waresStatus: this.type ? "01" : "03"
|
||||
}
|
||||
})]
|
||||
}else {
|
||||
this.formData.items = [...this.selections.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
waresStatus: "01"
|
||||
waresStatus: this.type ? "01" : "03"
|
||||
}
|
||||
})]
|
||||
}
|
||||
try {
|
||||
await repairPassTicketWares(this.formData)
|
||||
this.dialogVisible = false
|
||||
this.$modal.msgSuccess("领料成功")
|
||||
this.$modal.msgSuccess(this.type ? "领料成功" : "退料成功")
|
||||
await this.getList()
|
||||
}catch{}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 2 && type" width="180">
|
||||
<el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 'service_advisor' && type" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isShow"
|
||||
@ -167,7 +167,7 @@
|
||||
<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 v-if="userRole === 2" label="折扣" align="center" prop="itemDiscount" width="180">
|
||||
<el-table-column v-if="userRole === 'service_advisor' && type" label="折扣" align="center" prop="itemDiscount" width="180">
|
||||
<div v-if="formData.status === '01'" class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>
|
||||
<span class="item__txt">{{ scope.row.itemDiscount }}</span>
|
||||
@ -185,7 +185,7 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<div slot="footer" class="dialog-footer" v-if="info.status === '01' && (userRole === 1 || userRole === 2)">
|
||||
<div slot="footer" class="dialog-footer" v-if="info.status === '01' && (userRole === 'service_advisor' || userRole === 'general_inspection')">
|
||||
<el-button type="primary" @click="handleAudit(true)">通 过</el-button>
|
||||
<el-button @click="handleAudit(false)">驳 回</el-button>
|
||||
</div>
|
||||
@ -201,7 +201,7 @@ import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
||||
export default {
|
||||
name: "TicketWaresShow",
|
||||
props:{
|
||||
userRole: Number,
|
||||
userRole: String,
|
||||
type: Boolean
|
||||
},
|
||||
data(){
|
||||
@ -285,6 +285,7 @@ export default {
|
||||
remark: item.remark
|
||||
}
|
||||
})]
|
||||
console.log(this.formData)
|
||||
await auditTicketWares(this.formData)
|
||||
this.dialogVisible = false
|
||||
this.$modal.msgSuccess("审核成功")
|
||||
|
@ -28,7 +28,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
activeTab: 'unFinish',
|
||||
userRole: -1,
|
||||
userRole: "",
|
||||
exportRole:[3, 4]
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user