Merge branch 'repair'

This commit is contained in:
Vinjor 2024-11-27 16:00:53 +08:00
commit 8d3f5c5cef
2 changed files with 70 additions and 21 deletions

View File

@ -504,7 +504,7 @@ export default {
const res = await getMapBySoIdAndQuery(this.soId, this.inItemsQuery) const res = await getMapBySoIdAndQuery(this.soId, this.inItemsQuery)
this.inItems = Object.entries(res.data) this.inItems = Object.entries(res.data)
this.inItems = this.inItems.map(([key, value]) => { this.inItems = this.inItems.map(([key, value]) => {
return [key, value.filter(item => (!item.inCount && item.inCount !== item.goodsCount))] return [key, value.filter(item => item.inCount < item.goodsCount)]
}) })
this.inItems = this.inItems.filter(([key, value]) => value.length > 0) this.inItems = this.inItems.filter(([key, value]) => value.length > 0)
this.inItems.forEach(([key, value]) => { this.inItems.forEach(([key, value]) => {

View File

@ -94,11 +94,11 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="type" @click="handlePass" <el-button type="primary" v-if="type" @click="handlePassBefore"
:disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0"> :disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0">
通知领料 通知领料
</el-button> </el-button>
<el-button type="primary" v-else @click="handlePass" <el-button type="primary" v-else @click="handlePassBefore"
:disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0"> :disabled="allSelectRows.length === 0 || allSelectRows.filter(item => !item.isStock).length !== 0">
通知退料 通知退料
</el-button> </el-button>
@ -156,7 +156,8 @@
</el-table-column> </el-table-column>
<el-table-column label="分类" align="center" width="180" prop="wares.type"> <el-table-column label="分类" align="center" width="180" prop="wares.type">
<div class="item" slot-scope="scope"> <div class="item" slot-scope="scope">
<el-select class="item__input" clearable ref="selectTree" v-model="scope.row.wares.type" @change="save(scope.row)"> <el-select class="item__input" clearable ref="selectTree" v-model="scope.row.wares.type"
@change="save(scope.row)">
<el-option v-for="server in optionData(serverList)" <el-option v-for="server in optionData(serverList)"
:key="server.value" :key="server.value"
:label="server.label" :label="server.label"
@ -244,6 +245,23 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :title="type ? '通知领料' : '通知退料'" :visible.sync="inPhoto" width="40%" v-dialogDrag append-to-body>
<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-select>
</el-form-item>
<el-form-item label="图片上传">
<ImageUpload v-model="images"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handlePass">确定</el-button>
<el-button type="primary" @click="inPhoto = false">取消</el-button>
</div>
</el-dialog>
<TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/> <TicketWaresShow ref="ticketWaresShow" :user-role="'repair_warehouse'" @success="getList" :type="false"/>
</div> </div>
</template> </template>
@ -262,6 +280,7 @@ import {getCusAndCarById} from "@/api/repair/tickets/Tickets";
import {getCarBrand} from "@/api/base/carbrand"; import {getCarBrand} from "@/api/base/carbrand";
import {listGoods} from "@/views/partner/api/workOrder"; import {listGoods} from "@/views/partner/api/workOrder";
import {getBaseTypeList} from "@/api/base/type"; import {getBaseTypeList} from "@/api/base/type";
import {listByTicketId} from "@/api/repair/repairworker";
export default { export default {
name: "WaresItem", name: "WaresItem",
@ -308,7 +327,11 @@ export default {
}, },
typeMap: null, typeMap: null,
allSelectRows: [], allSelectRows: [],
isRefresh: false isRefresh: false,
inPhoto: false,
images: null,
chooseStaff: [],
staffs: [],
} }
}, },
mounted() { mounted() {
@ -376,8 +399,30 @@ export default {
getDictDatasToType(type) { getDictDatasToType(type) {
return this.getDictDatas(type) return this.getDictDatas(type)
}, },
handlePassBefore() {
this.chooseStaff = []
this.staffs = []
this.getTicketStaff()
this.images = null
this.inPhoto = true
},
async getTicketStaff(){
const res = await listByTicketId(this.ticketId)
this.staffs = res.data
this.chooseStaff.push(this.formData.repairId)
},
// truefalse // truefalse
async handlePass() { async handlePass() {
if (this.images) {
this.formData.images = this.images.split(",").map(item => {
return item.replace(process.env.VUE_APP_FILE_API, "")
}).join(",")
}
if ((!this.chooseStaff || this.chooseStaff.length === 0)){
this.$modal.msgError(`请选择${this.type ? '领' : '退'}料人!`)
return
}
// 退 // 退
this.formData.repairSo = { this.formData.repairSo = {
soType: this.type ? "02" : "04", soType: this.type ? "02" : "04",
@ -386,6 +431,7 @@ export default {
userName: this.formData.repairName, userName: this.formData.repairName,
soTime: parseTime(Date.now(), '{y}-{m}-{d}'), soTime: parseTime(Date.now(), '{y}-{m}-{d}'),
soStatus: this.type ? "04" : "07", soStatus: this.type ? "04" : "07",
userIds: this.chooseStaff.join(",")
// purchaseType: "01" // purchaseType: "01"
} }
this.formData.repairSois = [...this.allSelectRows.map(item => { this.formData.repairSois = [...this.allSelectRows.map(item => {
@ -408,6 +454,7 @@ export default {
await this.getList() await this.getList()
} finally { } finally {
this.dialogVisible = false this.dialogVisible = false
this.inPhoto = false
} }
}, },
// truefalse // truefalse
@ -672,6 +719,8 @@ export default {
} }
return item.wares return item.wares
})] })]
this.formData.twId = this.twId
}, },
validateNull() { validateNull() {
const flag = this.partList.map(item => { const flag = this.partList.map(item => {