Commit 23f8ce54 authored by xioln's avatar xioln

入库问题修改

parent 931a86a7
......@@ -880,8 +880,6 @@ export default {
// }
},
created() {
console.log('this.basi', this.basicData)
console.log('this.basi', this)
// 初始化数据
this.form = this.jobResponseInTestData
if (this.form.jobTestCheckItems) {
......
......@@ -236,12 +236,10 @@ export default {
},
methods: {
handleOpen(type, basicData, row) {
console.log('basicData', this.parentId)
this.basicData = basicData
this.form = { 'reqAmount': 1 }
this.dialogVisible = true
this.operateType = type
this.getBasicData()
if (type === 'NEW') {
this.$set(this.form, 'operator', 'ADD')
} else if (type === 'ADD') {
......@@ -284,10 +282,11 @@ export default {
},
getBasicData() {
const v = this.basicData
this.header = v
if (
v.billType === 'AirEquipment' &&
(['标准件', '金属材料', '非金属材料'].includes(v.materialTypeName.label))) {
(['标准件', '金属材料', '非金属材料'].includes(v.materialTypeName.label)) &&
this.formFileds[0].data.find(item => item.title !== '所属设备')
) {
this.formFileds[0].data.unshift({
title: '所属设备',
key: 'subEquipment',
......@@ -308,6 +307,7 @@ export default {
},
// 重设表单
resetForm() {
this.header = this.basicData
if (!this.header) return
this.$set(this.form, 'supplier', this.header.supplierFullName.label || '')
this.$set(this.form, 'arrivalDate', this.header.arrivalDate)
......@@ -423,19 +423,18 @@ export default {
name: 'el-select',
placeholder: '请输入机型',
options: []
},
handler: {
change: (v) => this.changeSorties()
}
// handler: {
// change: (v) => this.changeSorties()
// }
},
{
title: '架次',
key: 'sorties',
component: {
clearable: true,
name: 'el-select',
placeholder: '请输入架次',
options: []
name: 'el-input',
placeholder: '请输入架次'
}
},
// { title: '采购数量/重量', key: 'purchaseAmount', component: { name: 'el-input-number', placeholder: '请输入采购数量/重量' }},
......@@ -741,20 +740,18 @@ export default {
name: 'el-select',
placeholder: '请输入机型',
options: []
},
handler: {
change: (v) => this.changeSorties()
}
// handler: {
// change: (v) => this.changeSorties()
// }
},
{
title: '架次',
key: 'sorties',
component: {
clearable: true,
disabled: childrenAddOrEdit,
name: 'el-select',
placeholder: '请输入架次',
options: []
name: 'el-input',
placeholder: '请输入架次'
}
},
{
......@@ -1122,20 +1119,18 @@ export default {
name: 'el-select',
placeholder: '请输入机型',
options: []
},
handler: {
change: (v) => this.changeSorties()
}
// handler: {
// change: (v) => this.changeSorties()
// }
},
{
title: '架次',
key: 'sorties',
component: {
clearable: true,
disabled: childrenAddOrEdit,
name: 'el-select',
placeholder: '请输入架次',
options: []
name: 'el-input',
placeholder: '请输入架次'
}
},
{
......@@ -1392,6 +1387,7 @@ export default {
},
)
}
this.getBasicData()
// 设置物料类型下拉
this.resetMaterial()
// 设置带出接收仓库
......@@ -1509,7 +1505,9 @@ export default {
)
.then((res) => {
this.material = res.items.content
this.formFileds[0].data[0].component.options = res.items.content.map(
this.formFileds[0].data.forEach(filed => {
if (filed.title === '物料关键词') {
filed.component.options = res.items.content.map(
(item) => {
// 新增或编辑子产品时和父产品物料类型不能一致
if (((this.operateType === 'MODIFY' && !this.form.isRoot) || this.operateType === 'ADD') && item.resCode === this.form.extMaterial.resCode) {
......@@ -1532,6 +1530,8 @@ export default {
}
}
)
}
})
})
.catch((err) => {
console.log(err)
......
......@@ -285,6 +285,7 @@ export default {
type: 'warning'
}).then(() => {
const id = row.id
if (row.id) {
del(`InStorageRequestItem/batch/${id}`).then(res => {
for (const item of this.tableData) {
// 父类修改
......@@ -307,6 +308,26 @@ export default {
}).catch((err) => {
console.log(err)
})
} else {
for (const item of this.tableData) {
// 父类修改
if (item.rowId === row.rowId) {
this.tableData.splice(this.tableData.indexOf(item), 1)
break
}
// 子类修改
for (const child of item.children) {
if (child.rowId === row.rowId) {
this.tableData[this.tableData.indexOf(item)].children.splice(item.children.indexOf(child), 1)
break
}
}
}
this.$message({
type: 'success',
message: '删除成功!'
})
}
}).catch(() => {
this.$message({
type: 'info',
......@@ -356,7 +377,7 @@ export default {
{ title: '到货日期', key: 'arrivalDate', headerAlign: 'center' },
{ title: '生产日期', key: 'producedTime', headerAlign: 'center' },
{
title: '随产品资料', key: 'withProductMaterial', headerAlign: 'center', formatter: (row, column, cellValue, index) => {
title: '随产品资料', key: 'withProductMaterial', width: '120', headerAlign: 'center', formatter: (row, column, cellValue, index) => {
return Array.isArray(row.withProductMaterial) ? row.withProductMaterial.join(';') : row.withProductMaterial
}
},
......
......@@ -33,8 +33,8 @@ export default {
type: Object,
default: () => null
},
backVal: {
type: String,
scope: {
type: Object,
default: () => null
}
},
......@@ -56,11 +56,19 @@ export default {
handler: function(val) {
this.storageZoneId = val.storageZoneId
}
},
'scope.row': {
immediate: true,
deep: true,
handler: function(val) {
if (val.inventoryJobResponses[0].extWorkUnit) {
this.selectVal = val.inventoryJobResponses[0].extWorkUnit.extcode
}
}
}
},
created() {
// 初始化数据
this.selectVal = this.backVal
},
methods: {
// 搜索库位
......@@ -116,7 +124,6 @@ export default {
},
save(v) {
if (!this.selectVal) this.$utils.showMessageWarning('请选择库位')
console.log('selectVal', v)
this.$emit('save', this.selectVal)
}
}
......
......@@ -14,7 +14,7 @@
</div>
</template>
<script>
import { post } from '@/utils/http'
import { post, get } from '@/utils/http'
import WarehouseSelect from './component/warehouseSelect.vue'
import PrintTag from './component/PrintTag.vue'
export default {
......@@ -30,7 +30,130 @@ export default {
data() {
return {
tableData: [],
columns: [
// columns: [
// { title: '序号', key: 'parentIndex', align: 'center', headerAlign: 'center' },
// { title: '单据编号', key: 'inventoryReq.reqNo', width: '120', align: 'center', headerAlign: 'center' },
// {
// title: '库位',
// key: 'storageZoneId',
// width: '150',
// component: {
// name: WarehouseSelect,
// show: true,
// props: {
// basicData: this.basicData
// },
// handler: {
// save: (extWorkUnitId) => {
// if (!extWorkUnitId.split('+')[0]) return this.$utils.showMessageWarning('请选择库位')
// const params = {
// id: this.inventoryJobResponsesId,
// operator: 'MODIFY',
// extWorkUnitId: extWorkUnitId.split('+')[0],
// extWorkUnitIdType: 'ExtDxProductWorkUnit'
// }
// this.$api.recursion('JobResponseInStorage', params).then(res => {
// this.$utils.showMessageSuccess('保存成功')
// this.extWorkUnitName = extWorkUnitId.split('+')[1]
// })
// }
// }
// }
// },
// { title: '所属设备', key: 'subEquipment', headerAlign: 'center', align: 'center' },
// {
// title: '物料类型', key: 'typeName', align: 'center', headerAlign: 'center', formatter: (row, column, cellValue, index) => {
// const value = row.extMaterial ? row.extMaterial.resType2.typeName : row.materialTypeName
// return value
// }
// },
// {
// title: '编码', key: 'typeCode', align: 'center', headerAlign: 'center', width: '100', formatter: (row, column, cellValue, index) => {
// const value = row.resCode ? row.resCode : row.extMaterial ? row.extMaterial.resCode : ''
// return value
// }
// },
// { title: '机型', key: 'airModel', align: 'center', headerAlign: 'center' },
// { title: '架次', key: 'sorties', align: 'center', headerAlign: 'center' },
// {
// title: '计量单位', key: 'unitName', align: 'center', headerAlign: 'center', formatter: (row, column, cellValue, index) => {
// const value = row.reqUnit ? row.reqUnit : row.extMaterial ? row.extMaterial.extUnit.unitName : ''
// return value
// }
// },
// { title: '入库数量', key: 'reqAmount', align: 'center', headerAlign: 'center' },
// {
// title: '供应商', key: 'supplierFullName', align: 'center', headerAlign: 'center', formatter: (row, column, cellValue, index) => {
// const value = row.extDxSipplier ? row.extDxSipplier.supplierFullName : row.supplier
// return value
// }
// },
// // { title: '是否合格供应商', key: 'extDxSipplier.isValid', headerAlign: 'center' },
// { title: '制造商', key: 'manufacturer', align: 'center', headerAlign: 'center' },
// {
// title: '到货日期', key: 'arrivalDate', align: 'center', headerAlign: 'center', width: '120', formatter: (row, column, cellValue, index) => {
// return row.arrivalDate.split(' ')[0]
// }
// },
// {
// title: '生产日期', key: 'producedTime', align: 'center', headerAlign: 'center', width: '120', formatter: (row, column, cellValue, index) => {
// return row.arrivalDate.split(' ')[0]
// }
// },
// {
// title: '随产品资料', key: 'withProductMaterial', align: 'center', headerAlign: 'center', width: '120', formatter: (row, column, cellValue, index) => {
// return Array.isArray(row.withProductMaterial) ? row.withProductMaterial.join(';') : row.withProductMaterial
// }
// },
// { title: '紧急程度', key: 'urgency', align: 'center', headerAlign: 'center' },
// { title: '入库单价', key: 'stockUnitPrice', align: 'center', headerAlign: 'center' },
// { title: '入库金额', key: 'stockPrice', align: 'center', headerAlign: 'center' },
// { title: '含税单价', key: 'taxUnitPrice', align: 'center', headerAlign: 'center' },
// { title: '含税金额', key: 'taxPrice', align: 'center', headerAlign: 'center' },
// { title: '税率', key: 'taxRate', align: 'center', headerAlign: 'center' },
// { title: '报检人', key: 'applyUserName', align: 'center', headerAlign: 'center' },
// {
// title: '接受仓库', key: 'extname', align: 'center', headerAlign: 'center', formatter: (row, column, cellValue, index) => {
// const value = row.storageZone ? row.storageZone.extname : row.storageZoneName
// return value
// }
// },
// { title: '合同号', key: 'contractNo', align: 'center', headerAlign: 'center' },
// { title: '备注', key: 'remark', align: 'center', headerAlign: 'center' },
// { title: '状态', key: 'state', align: 'center', headerAlign: 'center' },
// {
// title: '创建时间', key: 'createTime', align: 'center', headerAlign: 'center', width: '120', formatter: (row, column, cellValue, index) => {
// return row.arrivalDate.split(' ')[0]
// }
// }
// ],
optionsTree: {
rowKey: 'id',
'tree-props': { children: 'children' }
},
tools: [
{
name: '打印标签',
icon: '/icons/components/new/add.png',
handler: {
click: () => this.print()
}
}
],
inventoryJobResponsesId: null,
// 打印标签
printConfig: {
visible: false,
width: 300,
prints: []
},
selections: [],
extWorkUnitName: ''
}
},
computed: {
columns: function() {
return [
{ title: '序号', key: 'parentIndex', align: 'center', headerAlign: 'center' },
{ title: '单据编号', key: 'inventoryReq.reqNo', width: '120', align: 'center', headerAlign: 'center' },
{
......@@ -41,8 +164,7 @@ export default {
name: WarehouseSelect,
show: true,
props: {
basicData: this.basicData,
backVal: '回显'
basicData: this.basicData
},
handler: {
save: (extWorkUnitId) => {
......@@ -55,8 +177,7 @@ export default {
}
this.$api.recursion('JobResponseInStorage', params).then(res => {
this.$utils.showMessageSuccess('保存成功')
this.extWorkUnitName = extWorkUnitId.split('+')[1]
this.searchInStorageRequestItem(this.basicData.id)
// this.extWorkUnitName = extWorkUnitId.split('+')[1]
})
}
}
......@@ -128,33 +249,8 @@ export default {
return row.arrivalDate.split(' ')[0]
}
}
],
optionsTree: {
rowKey: 'id',
'tree-props': { children: 'children' }
},
tools: [
{
name: '打印标签',
icon: '/icons/components/new/add.png',
handler: {
click: () => this.print()
}
}
],
inventoryJobResponsesId: null,
// 打印标签
printConfig: {
visible: false,
width: 300,
prints: []
},
selections: [],
extWorkUnitName: ''
]
}
},
computed: {
},
watch: {
'basicData.id': {
......@@ -184,7 +280,7 @@ export default {
{
'fieldName': 'id',
'operator': 'EQ',
'value': 1626783143996
'value': id
},
{
'fieldName': 'parentId',
......@@ -221,16 +317,16 @@ export default {
'name': 'inventoryJobResponses',
'openProps': [
{ 'name': 'extWorkUnit' }
],
'searchItems': {
'items': [
{
'fieldName': 'subTypeName',
'operator': 'EQ',
'value': 'JobResponseInEntry'
}
]
// 'searchItems': {
// 'items': [
// {
// 'fieldName': 'subTypeName',
// 'operator': 'EQ',
// 'value': 'JobResponseInEntry'
// }
// ]
// },
}
}
],
'sortItem': [
......@@ -282,6 +378,14 @@ export default {
const data = res.items
this.treeTableNoArrange(data)
this.inventoryJobResponsesId = data[0].inventoryJobResponses[0].id || ''
if (res.items[0].inventoryJobResponses && res.items[0].inventoryJobResponses[0].extWorkUnitId) {
get(`ExtDxProductWorkUnit/${res.items[0].inventoryJobResponses[0].extWorkUnitId}`).then(res => {
this.$set(this.tableData[0].inventoryJobResponses[0], 'extWorkUnit', res.items)
this.extWorkUnitName = res.items.extcode
}).catch((err) => {
console.log(err)
})
}
}).catch((err) => {
console.log(err)
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment