|
|
@ -14,21 +14,21 @@ |
|
|
|
<!--Start 新增修改部分--> |
|
|
|
<div class="listconadd"> |
|
|
|
<div class="wlInfo"><span>盘库操作</span></div> |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|
|
|
<el-form ref="form_obj" :model="listQuery" :rules="rules" class="formaddcopy02"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="span-sty spanOneWidth"><span>存放地点:</span></div> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="formobj.warehouse" placeholder="请选择" filterable clearable class="addinputwOne"> |
|
|
|
<el-option v-for="item in warehouse_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option> |
|
|
|
<el-select v-model="listQuery.params.locationSid" placeholder="请选择" filterable clearable @change="changeLocation" class="addinputwOne"> |
|
|
|
<el-option v-for="item in warehouse_list" :key="item.sid" :label="item.warehouseName" :value="item.sid"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="span-sty spanOneWidth"><span>盘库人员:</span></div> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="formobj.staff" placeholder="请选择" filterable clearable class="addinputwOne"> |
|
|
|
<el-option v-for="item in staff_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option> |
|
|
|
<el-select v-model="listQuery.params.inventoryName" placeholder="请选择" filterable @change="changeInventoryName" clearable class="addinputwOne"> |
|
|
|
<el-option v-for="item in staff_list" :key="item.sid" :label="item.name" :value="item.name"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -37,13 +37,13 @@ |
|
|
|
<el-col :span="12" style="border-bottom: 0px !important;"> |
|
|
|
<div class="span-sty spanOneWidth"><span>车架号:</span></div> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="formobj.vinNo" placeholder="" clearable style="width: 30%" class="addinputwOne"/> |
|
|
|
<el-input v-model="listQuery.params.mainSid" placeholder="" clearable style="width: 30%" class="addinputwOne"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" style="border-bottom: 0px !important;"> |
|
|
|
<div class="span-sty spanOneWidth"></div> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" style="margin-left: 270px" size="small">查询</el-button> |
|
|
|
<el-button type="primary" style="margin-left: 270px" size="small" @click="handleSelect">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -53,44 +53,48 @@ |
|
|
|
</div> |
|
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;"> |
|
|
|
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="操作" width="150px" align="center"> |
|
|
|
<el-table-column label="操作" width="100px" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" size="mini" @click="toEdit(scope.row)">确认</el-button> |
|
|
|
<el-button type="primary" size="mini" @click="handleAffirm(scope.row)">确认</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车架号" width="140px" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleVersion }}</span> |
|
|
|
<span>{{ scope.row.mainSid }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="合格证" width="140px" align="center"> |
|
|
|
<el-table-column label="合格证" width="150" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleVersion }}</span> |
|
|
|
<el-select v-model="scope.row.certificate" placeholder="请选择" style="width: 80%" @change="changeCertificateType(scope.row,this)" clearable> |
|
|
|
<el-option v-for="item in certificateType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="所在仓库" align="center" width="150px"> |
|
|
|
<el-table-column label="存放地点" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.engineTypeValue }}</span> |
|
|
|
<span>{{ scope.row.location }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="上次盘库日期" align="center" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleTypeCode }}</span> |
|
|
|
<span>{{ scope.row.lastDate }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="上次盘库人员" align="center"> |
|
|
|
<el-table-column label="上次盘库人员" align="center" width="150px"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleTypeCode }}</span> |
|
|
|
<span>{{ scope.row.lastName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="状态" align="center" width="130px"> |
|
|
|
<el-table-column label="状态" width="150" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleTypeCode }}</span> |
|
|
|
<el-select v-model="scope.row.InventoryState" placeholder="请选择" style="width: 80%" @change="changeStateType(scope.row,this)" clearable> |
|
|
|
<el-option v-for="item in stateType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="备注" align="center" width="130px"> |
|
|
|
<el-table-column label="备注" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vehicleTypeCode }}</span> |
|
|
|
<el-input v-model="scope.row.remarks" placeholder="" clearable></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -101,7 +105,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import req from '@/api/kucunguanli/panku' |
|
|
|
import { typeValues } from '@/api/cheliang/dictcommons' |
|
|
|
import { getUserByOrgSid, typeValues, fetchByUseOrgSid } from '@/api/cheliang/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'pankuAdd', |
|
|
@ -115,14 +119,33 @@ export default { |
|
|
|
list: [], |
|
|
|
warehouse_list: [], |
|
|
|
staff_list: [], |
|
|
|
certificateType_list: [], |
|
|
|
stateType_list: [ |
|
|
|
{ |
|
|
|
dictKey: 1, |
|
|
|
dictValue: '通过' |
|
|
|
}, |
|
|
|
{ |
|
|
|
dictKey: 2, |
|
|
|
dictValue: '不通过' |
|
|
|
} |
|
|
|
], |
|
|
|
// 表单数据 |
|
|
|
formobj: { |
|
|
|
sid: '', // 一条数据的sid |
|
|
|
applicationName: window.sessionStorage.getItem('name'), |
|
|
|
createTime: '', |
|
|
|
reason: '', |
|
|
|
userSid: window.sessionStorage.getItem('userSid'), |
|
|
|
detailsList: [] |
|
|
|
sid: '', |
|
|
|
mainSid: '', |
|
|
|
location: '', |
|
|
|
lastData: '', |
|
|
|
lastName: '', |
|
|
|
inventoryName: '', |
|
|
|
inventorySid: '', |
|
|
|
certificate: '', |
|
|
|
certificateKey: '', |
|
|
|
InventoryState: '', |
|
|
|
InventoryStateKey: '', |
|
|
|
remarks: '', |
|
|
|
loginName: window.sessionStorage.getItem('name'), |
|
|
|
loginSid: window.sessionStorage.getItem('userSid') |
|
|
|
}, |
|
|
|
listQuery: { |
|
|
|
params: { |
|
|
@ -140,11 +163,22 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init() { |
|
|
|
typeValues({ type: 'warehouse' }).then((res) => { |
|
|
|
getUserByOrgSid({ orgSid: this.listQuery.params.createOrgSid, userSid: window.sessionStorage.getItem('userSid') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.staff_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
fetchByUseOrgSid({ sid: this.listQuery.params.createOrgSid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.warehouse_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ type: 'whether' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.certificateType_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
// 序号 |
|
|
|
indexMethod(index) { |
|
|
@ -156,15 +190,76 @@ export default { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.formobj.createOrgSid = createOrgSid |
|
|
|
this.formobj.useOrgSid = createOrgSid |
|
|
|
this.listQuery.params.createOrgSid = createOrgSid |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
getList() { |
|
|
|
req.pagelist(this.listQuery).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.list = res.data.records |
|
|
|
} else { |
|
|
|
this.list = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
save() { |
|
|
|
handleSelect() { |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
changeLocation(value) { |
|
|
|
this.listQuery.params.locationSid = value |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
changeStateType(row) { |
|
|
|
let bb = null |
|
|
|
this.stateType_list.forEach((e) => { |
|
|
|
if (e.dictValue === row.InventoryState) { |
|
|
|
bb = { |
|
|
|
key: e.dictKey, |
|
|
|
value: e.dictValue |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
row.InventoryStateKey = bb.key |
|
|
|
}, |
|
|
|
changeCertificateType(row) { |
|
|
|
let bb = null |
|
|
|
this.certificateType_list.forEach((e) => { |
|
|
|
if (e.dictValue === row.certificate) { |
|
|
|
bb = { |
|
|
|
key: e.dictKey, |
|
|
|
value: e.dictValue |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
row.certificateKey = bb.key |
|
|
|
}, |
|
|
|
changeInventoryName(value) { |
|
|
|
let bb = null |
|
|
|
this.staff_list.forEach((e) => { |
|
|
|
if (e.name === value) { |
|
|
|
bb = { |
|
|
|
name: e.name, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.formobj.inventoryName = bb.name |
|
|
|
this.formobj.inventorySid = bb.sid |
|
|
|
}, |
|
|
|
handleAffirm(row) { |
|
|
|
this.formobj.sid = row.sid |
|
|
|
this.formobj.mainSid = row.mainSid |
|
|
|
this.formobj.location = row.location |
|
|
|
this.formobj.certificate = row.certificate |
|
|
|
this.formobj.certificateKey = row.certificateKey |
|
|
|
this.formobj.InventoryState = row.InventoryState |
|
|
|
this.formobj.InventoryStateKey = row.InventoryStateKey |
|
|
|
this.formobj.remarks = row.remarks |
|
|
|
console.log(this.formobj) |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
req.saveOrUpdate(this.formobj).then((resp) => { |
|
|
|
req.saveInventory(this.formobj).then((resp) => { |
|
|
|
this.submitdisabled = false |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ |
|
|
@ -172,7 +267,8 @@ export default { |
|
|
|
type: 'success', |
|
|
|
message: resp.msg |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
this.getList() |
|
|
|
// this.handleReturn('true') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
@ -186,20 +282,8 @@ export default { |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
// 表单数据 |
|
|
|
this.formobj = { |
|
|
|
sid: '', // 一条数据的sid |
|
|
|
applicationName: window.sessionStorage.getItem('name'), |
|
|
|
createTime: '', |
|
|
|
reason: '', |
|
|
|
userSid: window.sessionStorage.getItem('userSid'), |
|
|
|
detailsList: [] |
|
|
|
} |
|
|
|
this.$refs['form_obj'].resetFields() |
|
|
|
this.$refs['divVehicle'].getList() |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
closePage() { |
|
|
|
this.viewState = 1 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|