|
@@ -49,9 +49,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="入库时间" prop="wareHouseDare" :rules="[{required: true, message:'请选择入库时间', trigger:'blur'}]">
|
|
|
+ <el-form-item label="入库时间" prop="wareHouseDate" :rules="[{required: true, message:'请选择入库时间', trigger:'blur'}]">
|
|
|
<el-date-picker
|
|
|
- v-model="inputForm.wareHouseDare"
|
|
|
+ v-model="inputForm.wareHouseDate"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
style="width: 100%"
|
|
@@ -261,6 +261,7 @@
|
|
|
import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
|
|
|
import MaterialTypePullForm from '../info/MaterialTypePullForm'
|
|
|
import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
|
|
|
+ import WareHouseService from '@/api/materialManagement/WareHouseService'
|
|
|
import UpLoadComponent from '@/views/common/UpLoadComponent'
|
|
|
import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
|
|
|
import PurchaseChooseForm from './PurchaseChooseForm'
|
|
@@ -278,11 +279,12 @@
|
|
|
fileInfoLost: [],
|
|
|
purchaseNo: '',
|
|
|
handledBy: '',
|
|
|
+ handledById: '',
|
|
|
handledByOffice: '',
|
|
|
wareHouseName: '',
|
|
|
wareHouseNumber: '', // 入库编号
|
|
|
userId: '',
|
|
|
- wareHouseDare: '',
|
|
|
+ wareHouseDate: '',
|
|
|
remarks: '',
|
|
|
detailInfos: [],
|
|
|
wareHouse: [],
|
|
@@ -292,8 +294,10 @@
|
|
|
}
|
|
|
},
|
|
|
MaterialManagementService: null,
|
|
|
+ WareHouseService: null,
|
|
|
created () {
|
|
|
this.materialManagementService = new MaterialManagementService()
|
|
|
+ this.wareHouseService = new WareHouseService()
|
|
|
},
|
|
|
components: {
|
|
|
SelectTree,
|
|
@@ -321,11 +325,12 @@
|
|
|
fileInfoLost: [],
|
|
|
purchaseNo: '',
|
|
|
handledBy: JSON.parse(localStorage.getItem('user')).name,
|
|
|
- handledByOffice: '',
|
|
|
+ handledById: JSON.parse(localStorage.getItem('user')).id,
|
|
|
+ handledByOffice: JSON.parse(localStorage.getItem('user')).officeDTO.id,
|
|
|
wareHouseName: '',
|
|
|
wareHouseNumber: '', // 入库编号
|
|
|
userId: JSON.parse(localStorage.getItem('user')).id,
|
|
|
- wareHouseDare: new Date(),
|
|
|
+ wareHouseDate: new Date(),
|
|
|
remarks: '',
|
|
|
detailInfos: [],
|
|
|
wareHouse: [],
|
|
@@ -333,16 +338,13 @@
|
|
|
files: [] // 附件信息
|
|
|
}
|
|
|
if (method === 'add') {
|
|
|
- this.title = `新建采购类型`
|
|
|
+ this.title = `新建入库信息`
|
|
|
} else if (method === 'edit') {
|
|
|
this.inputForm.id = id
|
|
|
- this.title = '修改采购类型'
|
|
|
+ this.title = '修改入库信息'
|
|
|
} else if (method === 'view') {
|
|
|
this.inputForm.id = id
|
|
|
- this.title = '查看采购类型'
|
|
|
- } else if (method === 'addChild') {
|
|
|
- this.title = '添加下级结构'
|
|
|
- this.inputForm.parentId = id
|
|
|
+ this.title = '查看入库信息'
|
|
|
}
|
|
|
this.visible = true
|
|
|
this.loading = false
|
|
@@ -350,7 +352,7 @@
|
|
|
if (method === 'edit' || method === 'view') { // 修改或者查看
|
|
|
this.loading = true
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
- this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ this.wareHouseService.findById(this.inputForm.id).then(({data}) => {
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
|
|
|
this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
|
|
@@ -363,6 +365,14 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ let k = this.inputForm.wareHouse.length
|
|
|
+ for (let j = 0; j < k; j++) {
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradePrice)) {
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradeNumber)) {
|
|
|
+ this.inputForm.wareHouse[j].priceSum = this.inputForm.wareHouse[j].tradePrice * this.inputForm.wareHouse[j].tradeNumber
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
|
|
|
this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
|
|
|
this.loading = false
|
|
@@ -589,12 +599,12 @@
|
|
|
let i = this.inputForm.wareHouse.length
|
|
|
for (let j = 0; j < i; j++) {
|
|
|
let k = j + 1
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].purchaser)) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseMan)) {
|
|
|
this.$message.error('入库详情第' + k + '行请选择入库人')
|
|
|
this.loading = false
|
|
|
return
|
|
|
}
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].procurementType)) {
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseType)) {
|
|
|
this.$message.error('入库详情第' + k + '行请选择入库类型')
|
|
|
this.loading = false
|
|
|
return
|
|
@@ -607,14 +617,17 @@
|
|
|
}
|
|
|
}
|
|
|
this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
|
- this.materialManagementService.save(this.inputForm).then(({data}) => {
|
|
|
+ this.wareHouseService.save(this.inputForm).then(({data}) => {
|
|
|
// eslint-disable-next-line no-undef
|
|
|
- callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.$refs.inputForm.resetFields()
|
|
|
+ // callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ // this.$refs.inputForm.resetFields()
|
|
|
+ this.$emit('refreshList')
|
|
|
this.loading = false
|
|
|
+ this.close()
|
|
|
}).catch(() => {
|
|
|
- this.$refs.inputForm.resetFields()
|
|
|
+ // this.$refs.inputForm.resetFields()
|
|
|
this.loading = false
|
|
|
+ // this.close()
|
|
|
})
|
|
|
}
|
|
|
})
|