|
|
@ -101,7 +101,7 @@ |
|
|
|
</el-row> |
|
|
|
<div class="title">服务项目</div> |
|
|
|
<el-table v-loading="listLoading" :data="formobj.sitemVoList" border> |
|
|
|
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="序号" type="index" width="80" :index="index + 1" align="center"/> |
|
|
|
<el-table-column label="服务项目" prop="serviceItem" align="center"/> |
|
|
|
<el-table-column label="工种" prop="serviceType" align="center"/> |
|
|
|
<el-table-column label="维修技师" prop="repairerName" align="center"/> |
|
|
@ -119,7 +119,7 @@ |
|
|
|
<el-button type="primary" size="mini" class="btntopblueline" @click="returnAll()">全退</el-button> |
|
|
|
</div> |
|
|
|
<el-table v-loading="listLoading" :data="formobj.detailList" border> |
|
|
|
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="序号" type="index" width="80" :index="index + 1" align="center"/> |
|
|
|
<el-table-column label="维修项目" prop="serviceItem" align="center"/> |
|
|
|
<el-table-column label="商品ID" prop="goodsID" width="120" align="center"/> |
|
|
|
<el-table-column label="商品名称" prop="goodsSpuName" align="center"/> |
|
|
@ -129,14 +129,28 @@ |
|
|
|
<el-table-column label="仓库" align="center" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.warehouseName" placeholder="请选择" clearable @change="selectWarehouseName(scope.row,$event)"> |
|
|
|
<el-option v-for="(item,i) in warehouseList" :key="i" :label="item.warehouseName" :value="item.sid"/> |
|
|
|
<el-option v-for="item in warehouseList" :key="item.sid" :label="item.warehouseName" :value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="区域" align="center" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.wareZoneName" placeholder="请选择" clearable @focus="getWarehouseZoneList(scope.row.warehouseSid)" @change="selectWareZoneName(scope.row,$event)"> |
|
|
|
<el-option v-for="item in warehouseZoneList" :key="item.sid" :label="item.zoneName" :value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="库区" align="center" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.wareAreaName" placeholder="请选择" clearable @focus="getWareAreaList(scope.row.wareZoneSid)" @change="selectWareAreaName(scope.row,$event)"> |
|
|
|
<el-option v-for="item in wareAreaList" :key="item.sid" :label="item.areaName" :value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="库位" align="center" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.warehouseRackCode" :disabled="scope.row.warehouseName==''" clearable placeholder="请选择" @focus="getWarehouseAreaList(scope.row.warehouseSid)" @change="selectWarehouseAreaCode(scope.row,$event)"> |
|
|
|
<el-option v-for="(item,i) in warehouseRackList" :key="i" :label="item.areaCode" :value="item.sid"/> |
|
|
|
<el-select v-model="scope.row.warehouseRackCode" clearable placeholder="请选择" @focus="getWarehouseRackList(scope.row.wareZoneSid)" @change="selectWarehouseAreaCode(scope.row,$event)"> |
|
|
|
<el-option v-for="item in warehouseRackList" :key="item.sid" :label="item.areaCode" :value="item.sid"/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -159,62 +173,50 @@ |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 选择维修单 --> |
|
|
|
<chooseproducts v-show="viewState == 2" ref="divSp" @backData="backData" @doback="resetState"/> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import req from '@/api/maintenanceReceive/maintenanceReceive.js' |
|
|
|
import req2 from '@/api/storage/allocation.js' |
|
|
|
import chooseproducts from './relation/chooseproducts' |
|
|
|
import { |
|
|
|
getOrgSidByPath, |
|
|
|
selAllByOrgSidPath |
|
|
|
} from '@/api/Common/dictcommons' |
|
|
|
import { |
|
|
|
getCurrentDate |
|
|
|
} from '@/utils/index.js' |
|
|
|
import { getOrgSidByPath, selAllByOrgSidPath, getAllWarehouse, getAllWarehousezoneBysid, getAllWarehouseareaByZoneSid, getAllRackByKQSid } from '@/api/Common/dictcommons' |
|
|
|
import { getCurrentDate } from '@/utils/index.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
chooseproducts |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
viewState: 1, |
|
|
|
index: 0, |
|
|
|
listLoading: false, |
|
|
|
submitdisabled: false, |
|
|
|
|
|
|
|
formobj: { |
|
|
|
'sid': '', |
|
|
|
'createBySid': window.sessionStorage.getItem('userSid'), |
|
|
|
'createByName': window.sessionStorage.getItem('name'), |
|
|
|
'sourceBillSid': '', |
|
|
|
'warehouseManagerSid': '', |
|
|
|
'warehouseManager': '', |
|
|
|
'useOrgSid': '', |
|
|
|
'createOrgSid': '', |
|
|
|
'deptSid': window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage |
|
|
|
.getItem('defaultOrgPath').lastIndexOf('/') + 1), |
|
|
|
'deptName': window.sessionStorage.getItem('defaultOrgPathName').substring(window |
|
|
|
.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1), |
|
|
|
'createTime': getCurrentDate(), |
|
|
|
'remarks': '', |
|
|
|
'sourceBillNo': '', |
|
|
|
'waitorName': '', |
|
|
|
'billDate': '', |
|
|
|
'billType': '', |
|
|
|
'subject': '', |
|
|
|
'customerName': '', |
|
|
|
'vehMark': '', |
|
|
|
'vinNo': '', |
|
|
|
'customerOrg': '', |
|
|
|
'sitemVoList': [], |
|
|
|
'detailList': [] |
|
|
|
sid: '', |
|
|
|
createBySid: '', |
|
|
|
createByName: '', |
|
|
|
sourceBillSid: '', |
|
|
|
warehouseManagerSid: '', |
|
|
|
warehouseManager: '', |
|
|
|
useOrgSid: '', |
|
|
|
createOrgSid: '', |
|
|
|
deptSid: '', |
|
|
|
deptName: '', |
|
|
|
createTime: '', |
|
|
|
remarks: '', |
|
|
|
sourceBillNo: '', |
|
|
|
waitorName: '', |
|
|
|
billDate: '', |
|
|
|
billType: '', |
|
|
|
subject: '', |
|
|
|
customerName: '', |
|
|
|
vehMark: '', |
|
|
|
vinNo: '', |
|
|
|
customerOrg: '', |
|
|
|
sitemVoList: [], |
|
|
|
detailList: [] |
|
|
|
}, |
|
|
|
receivePerList: [], |
|
|
|
warehouseList: [], |
|
|
|
warehouseZoneList: [], |
|
|
|
wareAreaList: [], |
|
|
|
warehouseRackList: [], |
|
|
|
rules: { |
|
|
|
warehouseManager: [{ required: true, message: '请选择退料人', trigger: 'change' }] |
|
|
@ -228,17 +230,18 @@ export default { |
|
|
|
this.receivePerList = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
getAllWarehouse({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.warehouseList = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
showAdd(sid) { |
|
|
|
this.getWarehouseList() |
|
|
|
this.initData() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
var params = { |
|
|
|
sid: sid |
|
|
|
} |
|
|
|
req.initBill(params).then(resp => { |
|
|
|
req.initBill({ sid: sid }).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1) |
|
|
@ -257,131 +260,93 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
backData(value) { |
|
|
|
this.viewState = 1 |
|
|
|
// 初始化 |
|
|
|
var params = { |
|
|
|
sid: value |
|
|
|
receivePerSelect(val) { |
|
|
|
const choose = this.receivePerList.filter((item) => item.sid === val) |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
|
this.formobj.warehouseManagerSid = choose[0].sid |
|
|
|
this.formobj.warehouseManager = choose[0].name |
|
|
|
} else { |
|
|
|
this.formobj.warehouseManagerSid = '' |
|
|
|
this.formobj.warehouseManager = '' |
|
|
|
} |
|
|
|
req.initBill(params).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
this.formobj.deptName = window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1) |
|
|
|
this.formobj.deptSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) |
|
|
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|
|
|
this.formobj.createByName = window.sessionStorage.getItem('name') |
|
|
|
this.formobj.createTime = getCurrentDate() |
|
|
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.formobj.createOrgSid = res.data |
|
|
|
this.formobj.useOrgSid = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 根据resp.code进行异常情况处理 |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.viewState = 1 |
|
|
|
returnAll() { |
|
|
|
for (var i = 0; i < this.formobj.detailList.length; i++) { |
|
|
|
var item = this.formobj.detailList[i] |
|
|
|
item.count = item.outboundCount |
|
|
|
} |
|
|
|
}, |
|
|
|
seleMaintenance() { |
|
|
|
this.viewState = 2 |
|
|
|
const aa = [] |
|
|
|
this.$refs['divSp'].showData(aa, this.formobj.createOrgSid) |
|
|
|
selectWarehouseName(row, val) { |
|
|
|
const choose = this.warehouseList.filter((item) => item.sid === val) |
|
|
|
if (choose !== null || choose.length > 0) { |
|
|
|
row.warehouseName = choose[0].warehouseName |
|
|
|
row.warehouseSid = choose[0].sid |
|
|
|
} else { |
|
|
|
row.warehouseName = '' |
|
|
|
row.warehouseSid = '' |
|
|
|
} |
|
|
|
row.WareZoneName = '' |
|
|
|
row.WareZoneSid = '' |
|
|
|
row.wareAreaName = '' |
|
|
|
row.wareAreaSid = '' |
|
|
|
row.warehouseRackCode = '' |
|
|
|
row.warehouseRackSid = '' |
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
req.saveQuitBill(this.formobj).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'success', |
|
|
|
message: resp.msg |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
// 根据resp.code进行异常情况处理 |
|
|
|
} |
|
|
|
}) |
|
|
|
getWarehouseZoneList(sid) { |
|
|
|
getAllWarehousezoneBysid({ ckSid: sid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.warehouseZoneList = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj = { |
|
|
|
'sid': '', |
|
|
|
'createBySid': window.sessionStorage.getItem('userSid'), |
|
|
|
'createByName': window.sessionStorage.getItem('name'), |
|
|
|
'sourceBillSid': '', |
|
|
|
'warehouseManagerSid': '', |
|
|
|
'warehouseManager': '', |
|
|
|
'useOrgSid': '', |
|
|
|
'createOrgSid': '', |
|
|
|
'deptSid': window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1), |
|
|
|
'deptName': window.sessionStorage.getItem('defaultOrgPathName').substring(window.sessionStorage.getItem('defaultOrgPathName').lastIndexOf('/') + 1), |
|
|
|
'createTime': getCurrentDate(), |
|
|
|
'remarks': '', |
|
|
|
'sourceBillNo': '', |
|
|
|
'waitorName': '', |
|
|
|
'billDate': '', |
|
|
|
'billType': '', |
|
|
|
'subject': '', |
|
|
|
'customerName': '', |
|
|
|
'vehMark': '', |
|
|
|
'vinNo': '', |
|
|
|
'customerOrg': '', |
|
|
|
'sitemVoList': [], |
|
|
|
'detailList': [] |
|
|
|
selectWareZoneName(row, val) { |
|
|
|
const choose = this.warehouseZoneList.filter((item) => item.sid === val) |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
|
row.WareZoneName = choose[0].zoneName |
|
|
|
row.WareZoneSid = choose[0].sid |
|
|
|
} else { |
|
|
|
row.WareZoneName = '' |
|
|
|
row.WareZoneSid = '' |
|
|
|
} |
|
|
|
this.submitdisabled = false |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
indexMethod(index) { |
|
|
|
return index + 1 |
|
|
|
}, |
|
|
|
receivePerSelect(val) { |
|
|
|
const choose = this.receivePerList.filter((item) => item.sid === val) |
|
|
|
this.formobj.warehouseManagerSid = choose[0].sid |
|
|
|
this.formobj.warehouseManager = choose[0].name |
|
|
|
row.wareAreaName = '' |
|
|
|
row.wareAreaSid = '' |
|
|
|
row.warehouseRackCode = '' |
|
|
|
row.warehouseRackSid = '' |
|
|
|
}, |
|
|
|
getWarehouseList() { |
|
|
|
var parpams = { |
|
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath') |
|
|
|
} |
|
|
|
req2.getWarehouses(parpams).then((res) => { |
|
|
|
getWareAreaList(sid) { |
|
|
|
getAllWarehouseareaByZoneSid({ qySid: sid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.warehouseList = res.data |
|
|
|
this.wareAreaList = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getWarehouseAreaList(sid) { |
|
|
|
var query = { |
|
|
|
ckSid: sid |
|
|
|
selectWareAreaName(row, val) { |
|
|
|
const choose = this.wareAreaList.filter((item) => item.sid === val) |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
|
row.wareAreaName = choose[0].areaName |
|
|
|
row.wareAreaSid = choose[0].sid |
|
|
|
} else { |
|
|
|
row.wareAreaName = '' |
|
|
|
row.wareAreaSid = '' |
|
|
|
} |
|
|
|
req2.getWarehouseareas(query).then((res) => { |
|
|
|
row.warehouseRackCode = '' |
|
|
|
row.warehouseRackSid = '' |
|
|
|
}, |
|
|
|
getWarehouseRackList(sid) { |
|
|
|
getAllRackByKQSid({ kqSid: sid }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.warehouseRackList = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
selectWarehouseName(row, val) { |
|
|
|
const choose = this.warehouseList.filter((item) => item.sid === val) |
|
|
|
row.warehouseName = choose[0].warehouseName |
|
|
|
row.warehouseSid = choose[0].sid |
|
|
|
row.warehouseRackCode = '' |
|
|
|
row.warehouseRackSid = '' |
|
|
|
}, |
|
|
|
selectWarehouseAreaCode(row, val) { |
|
|
|
const choose = this.warehouseRackList.filter((item) => item.sid === val) |
|
|
|
row.warehouseRackCode = choose[0].areaCode |
|
|
|
row.warehouseRackSid = choose[0].sid |
|
|
|
}, |
|
|
|
returnAll() { |
|
|
|
for (var i = 0; i < this.formobj.detailList.length; i++) { |
|
|
|
var item = this.formobj.detailList[i] |
|
|
|
item.count = item.outboundCount |
|
|
|
if (choose !== null && choose.length > 0) { |
|
|
|
row.warehouseRackCode = choose[0].areaCode |
|
|
|
row.warehouseRackSid = choose[0].sid |
|
|
|
} else { |
|
|
|
row.warehouseRackCode = '' |
|
|
|
row.warehouseRackSid = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
commodityComputeYHAndXSJE(row, val) { |
|
|
@ -389,6 +354,52 @@ export default { |
|
|
|
row.count = row.outboundCount |
|
|
|
} |
|
|
|
row.returnAmount = (Number(row.count) * Number(row.price)).toFixed(2) |
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
req.saveQuitBill(this.formobj).then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.submitdisabled = false |
|
|
|
// 根据resp.code进行异常情况处理 |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj = { |
|
|
|
sid: '', |
|
|
|
createBySid: '', |
|
|
|
createByName: '', |
|
|
|
sourceBillSid: '', |
|
|
|
warehouseManagerSid: '', |
|
|
|
warehouseManager: '', |
|
|
|
useOrgSid: '', |
|
|
|
createOrgSid: '', |
|
|
|
deptSid: '', |
|
|
|
deptName: '', |
|
|
|
createTime: '', |
|
|
|
remarks: '', |
|
|
|
sourceBillNo: '', |
|
|
|
waitorName: '', |
|
|
|
billDate: '', |
|
|
|
billType: '', |
|
|
|
subject: '', |
|
|
|
customerName: '', |
|
|
|
vehMark: '', |
|
|
|
vinNo: '', |
|
|
|
customerOrg: '', |
|
|
|
sitemVoList: [], |
|
|
|
detailList: [] |
|
|
|
} |
|
|
|
this.submitdisabled = false |
|
|
|
this.$emit('doback') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -426,10 +437,4 @@ export default { |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.el-radio /deep/ .el-radio__label { |
|
|
|
|
|
|
|
font-size: 14px !important; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|