仓库对配件申请单的操作

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

View File

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