仓库对配件申请单的操作

This commit is contained in:
xiaofajia 2024-12-05 16:29:40 +08:00
parent 9b49bf61a0
commit a795cc2120
2 changed files with 36 additions and 8 deletions

View File

@ -13,8 +13,10 @@
<!-- 操作 --> <!-- 操作 -->
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
>导出</el-button> :loading="exportLoading"
>导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch"></right-toolbar> <right-toolbar :showSearch.sync="showSearch"></right-toolbar>
</el-row> </el-row>
@ -65,6 +67,14 @@
<el-button icon="el-icon-refresh" @click=resetByQuery>重置</el-button> <el-button icon="el-icon-refresh" @click=resetByQuery>重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddWares"
>添加配件</el-button>
</el-col>
</el-row>
<el-table <el-table
@cell-mouse-enter="handleCellEnter" @cell-mouse-enter="handleCellEnter"
@cell-mouse-leave="handleCellLeave" @cell-mouse-leave="handleCellLeave"
@ -79,7 +89,7 @@
> >
<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="addUserName" 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"
@ -258,7 +268,7 @@
<el-form :inline="true" label-width="15rem"> <el-form :inline="true" label-width="15rem">
<el-form-item :label="type ? '领料人' : '退料人'"> <el-form-item :label="type ? '领料人' : '退料人'">
<el-select v-model="chooseStaff" multiple clearable filterable> <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-select>
</el-form-item> </el-form-item>
<el-form-item label="图片上传"> <el-form-item label="图片上传">
@ -272,6 +282,8 @@
</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"/>
<TWIAdd ref="twiAdd" @success="handleSuccess" :if-house-add="true"/>
</div> </div>
</template> </template>
@ -292,10 +304,11 @@ import {getBaseTypeList} from "@/api/base/type";
import {listByTicketId} from "@/api/repair/repairworker"; import {listByTicketId} from "@/api/repair/repairworker";
import StaffChoose from "@/views/repair/Components/StaffChoose.vue"; import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue"; import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import TWIAdd from "@/views/repair/tickets/Components/TWIAdd.vue";
export default { export default {
name: "WaresItem", name: "WaresItem",
components: {SupplierChoose, StaffChoose, TicketWaresShow, WarehouseChoose, SoTable}, components: {TWIAdd, SupplierChoose, StaffChoose, TicketWaresShow, WarehouseChoose, SoTable},
props: { props: {
type: Boolean, type: Boolean,
}, },
@ -352,6 +365,12 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
handleAddWares(){
this.$refs.twiAdd.open({id: this.twId})
},
handleSuccess(data){
this.getTwitemList({twId: this.twId})
},
getTypeById(id) { getTypeById(id) {
return this.typeMap.get(id) return this.typeMap.get(id)
}, },
@ -421,7 +440,7 @@ export default {
this.images = null this.images = null
this.inPhoto = true this.inPhoto = true
}, },
async getTicketStaff(){ async getTicketStaff() {
const res = await listByTicketId(this.ticketId) const res = await listByTicketId(this.ticketId)
this.staffs = res.data this.staffs = res.data
this.chooseStaff.push(this.formData.repairId) this.chooseStaff.push(this.formData.repairId)
@ -433,7 +452,7 @@ export default {
return item.replace(process.env.VUE_APP_FILE_API, "") return item.replace(process.env.VUE_APP_FILE_API, "")
}).join(",") }).join(",")
} }
if ((!this.chooseStaff || this.chooseStaff.length === 0)){ if ((!this.chooseStaff || this.chooseStaff.length === 0)) {
this.$modal.msgError(`请选择${this.type ? '领' : '退'}料人!`) this.$modal.msgError(`请选择${this.type ? '领' : '退'}料人!`)
return return
} }
@ -455,6 +474,7 @@ export default {
goodsCount: item.waresCount, goodsCount: item.waresCount,
} }
})] })]
this.formData.ids = this.allSelectRows.map(item => item.id)
if (this.type) { if (this.type) {
this.formData.items = [...this.allSelectRows.map(item => { this.formData.items = [...this.allSelectRows.map(item => {
return { return {
@ -717,7 +737,7 @@ export default {
soStatus: "02", soStatus: "02",
remark: this.remark, remark: this.remark,
} }
if (this.chooseSupplier){ if (this.chooseSupplier) {
this.formData.supplierId = this.chooseSupplier.id this.formData.supplierId = this.chooseSupplier.id
this.formData.supplierName = this.chooseSupplier.name this.formData.supplierName = this.chooseSupplier.name
} }

View File

@ -129,6 +129,13 @@ import {addTwi} from "@/api/repair/tickets/TWItem";
export default { export default {
name: "TWIAdd", name: "TWIAdd",
components: {TreeSelect}, components: {TreeSelect},
props:{
ifHouseAdd: {
type: Boolean,
default: false,
required: false
}
},
data(){ data(){
return{ return{
dialogVisible: false, dialogVisible: false,
@ -199,6 +206,7 @@ export default {
name: item.name name: item.name
} }
})] })]
this.formData.ifHouseAdd = this.ifHouseAdd
}, },
async open(row){ async open(row){
this.reset() this.reset()