Commit d5acf231 authored by xioln's avatar xioln

采购入库抽屉、工厂日历抽屉、库位选择修改

parent b705226a
export default {
props: {},
layoutConfigData: [
{
title: '高级组件配置',
data: [
{
key: 'linkageAttr',
title: '联动属性',
component: {
defaultValue: 'extWorkCenterId',
name: 'el-input'
}
}
]
}
],
data() {
return {
}
},
created() {
},
computed: {
},
methods: {
}
}
...@@ -23,9 +23,11 @@ ...@@ -23,9 +23,11 @@
</div> </div>
</template> </template>
<script> <script>
import config from './config'
import _get from 'lodash.get'
export default { export default {
componentName: '移库入库库位选择', componentName: '库位选择',
name: 'InStorageMoveWarehouseSelect', // name写在组件的最前方,自定义组件为必填 name: 'InStorageMoveWarehouseSelect',
components: {}, components: {},
// 自定义指令(和method同级) // 自定义指令(和method同级)
directives: { directives: {
...@@ -50,7 +52,8 @@ export default { ...@@ -50,7 +52,8 @@ export default {
}) })
} }
} }
}, }, // name写在组件的最前方,自定义组件为必填
mixins: [config],
props: { props: {
itemObj: { itemObj: {
type: Object, type: Object,
...@@ -80,17 +83,25 @@ export default { ...@@ -80,17 +83,25 @@ export default {
pageNumber: 1, pageNumber: 1,
pageSize: 10 pageSize: 10
}, },
loading: false loading: false,
linkageValue: ''
} }
}, },
computed: {}, computed: {},
watch: { watch: {
'form.extWorkCenterId': { form: {
immediate: true, immediate: true,
deep: true, deep: true,
handler(val) { handler(val) {
if (val) { if (val) {
// this.getdata() if (!this.itemObj.linkageAttr) {
return
}
const _val = _get(this.form, this.itemObj.linkageAttr)
if (_val !== this.linkageValue) {
this.linkageValue = _val
}
} }
} }
} }
...@@ -105,12 +116,12 @@ export default { ...@@ -105,12 +116,12 @@ export default {
loadmore() { loadmore() {
if (!this.stopLoading) { if (!this.stopLoading) {
const querys = { const querys = {
pageFrom: this.pageData.pageNumber++, pageFrom: ++this.pageData.pageNumber,
pageSize: 10, pageSize: 10,
searchItems: { searchItems: {
items: [ items: [
{ 'fieldName': 'extname', operator: 'LIKE', value: this.querys }, { 'fieldName': 'extname', operator: 'LIKE', value: this.querys },
{ 'fieldName': 'extCenterId', operator: 'EQ', value: this.form.extWorkCenterId } { 'fieldName': 'extCenterId', operator: 'EQ', value: this.linkageValue }
], ],
operator: 'AND' operator: 'AND'
} }
...@@ -121,32 +132,20 @@ export default { ...@@ -121,32 +132,20 @@ export default {
// 远程搜索物料类别 // 远程搜索物料类别
remoteMethod(query) { remoteMethod(query) {
this.querys = query// 保存搜索内容 this.querys = query// 保存搜索内容
let querys = {} const querys = {
pageFrom: 1,
pageSize: 10,
searchItems: {
items: [
{ 'fieldName': 'extCenterId', operator: 'EQ', value: this.linkageValue }
],
operator: 'AND'
}
}
// 有内容则搜索 // 有内容则搜索
if (query !== '') { if (query !== '') {
querys = { querys.searchItems.items.push({ 'fieldName': 'extname', operator: 'LIKE', value: query })
pageFrom: 1,
pageSize: 10,
searchItems: {
items: [
{ 'fieldName': 'extname', operator: 'LIKE', value: query },
{ 'fieldName': 'extCenterId', operator: 'EQ', value: this.form.extWorkCenterId }
],
operator: 'AND'
}
}
} else { } else {
// 没有内容搜10
querys = {
pageFrom: 1,
pageSize: 10,
searchItems: {
items: [
{ 'fieldName': 'extCenterId', operator: 'EQ', value: this.form.extWorkCenterId }
],
operator: 'AND'
}
}
// 重置懒加载 // 重置懒加载
this.stopLoading = false this.stopLoading = false
this.pageData = {// 懒加载相关参数,这里代表从第一条数据开始加载,一次加载二十项 this.pageData = {// 懒加载相关参数,这里代表从第一条数据开始加载,一次加载二十项
...@@ -178,6 +177,7 @@ export default { ...@@ -178,6 +177,7 @@ export default {
this.selectLoading = true this.selectLoading = true
this.$api.searchApi('ExtDxProductWorkUnit', querys).then(res => { this.$api.searchApi('ExtDxProductWorkUnit', querys).then(res => {
const arr = res.items.content const arr = res.items.content
let options = []
// 如果某次返回值是[],表示已经加载完了,不必再加载 // 如果某次返回值是[],表示已经加载完了,不必再加载
if (arr.length === 0) { if (arr.length === 0) {
this.stopLoading = true this.stopLoading = true
...@@ -185,20 +185,21 @@ export default { ...@@ -185,20 +185,21 @@ export default {
} }
// 保存数据 // 保存数据
if (querys.pageNumber === 1) { if (querys.pageNumber === 1) {
this.options = arr.map(row => { options = arr.map(row => {
return { return {
value: row.id, value: row.id,
label: row.extname label: row.extname
} }
}) })
} else { } else {
this.options = [...this.options, ...arr.map(row => { options = [...this.options, ...arr.map(row => {
return { return {
value: row.id, value: row.id,
label: row.extname label: row.extname
} }
})] })]
} }
this.options = options
}).finally(() => { }).finally(() => {
this.selectLoading = false this.selectLoading = false
}) })
......
...@@ -43,15 +43,15 @@ export default { ...@@ -43,15 +43,15 @@ export default {
name: 'PurchasingWarehousingNewOrEdit', // name写在组件的最前方,自定义组件为必填 name: 'PurchasingWarehousingNewOrEdit', // name写在组件的最前方,自定义组件为必填
components: { StorageDetails, ImportFile }, components: { StorageDetails, ImportFile },
props: { props: {
// basicData: { basicData: {
// type: Object, type: Object,
// default: () => null default: () => null
// } }
}, },
data() { data() {
const that = this const that = this
return { return {
basicData: null, currBasicData: null,
form: {}, form: {},
formData: [{ formData: [{
title: '基本信息', title: '基本信息',
...@@ -226,6 +226,24 @@ export default { ...@@ -226,6 +226,24 @@ export default {
} }
} }
} }
// {
// name: '模版下载',
// icon: '/icons/c-down.png',
// handler: {
// click: () => {
// this.$utils.downLoadFileUrl('/download/template/器材导入模板.xlsx', '器材导入模板.xlsx')
// this.$refs.form.validate((isok) => {
// if (isok) {
// // 校验通过
// // this.$utils.downLoadFileUrl('/download/template/器材导入模板.xlsx', '器材导入模板.xlsx')
// } else {
// this.$utils.showMessageWarning('请填写基本信息!')
// }
// })
// }
// }
// }
], ],
topTools: [ topTools: [
{ {
...@@ -436,6 +454,13 @@ export default { ...@@ -436,6 +454,13 @@ export default {
} }
} }
}, },
watch: {
basicData: {
handler(val) {
},
deep: true
}
},
created() { created() {
// 初始化数据 // 初始化数据
this.initData() this.initData()
...@@ -456,17 +481,17 @@ export default { ...@@ -456,17 +481,17 @@ export default {
this.getExtDxProductArea() this.getExtDxProductArea()
this.getExtDxSipplier() this.getExtDxSipplier()
}, },
editInit(basicData) { editInit(currBasicData) {
this.basicData = basicData this.currBasicData = currBasicData
this.form = basicData this.form = currBasicData
this.searchInStorageRequestItem() this.searchInStorageRequestItem()
this.operator = 'MODIFY' this.operator = 'MODIFY'
this.form.operator = 'MODIFY' this.form.operator = 'MODIFY'
this.getExtDxProcessResourceType(basicData.billType) this.getExtDxProcessResourceType(currBasicData.billType)
}, },
// 获取验收单数据InventoryRequest/search // 获取验收单数据InventoryRequest/search
getInventoryRequest() { getInventoryRequest() {
if (!this.$route.query.hasOwnProperty('id')) return if (!this.basicData.hasOwnProperty('id')) return
const param = { const param = {
'pageFrom': 1, 'pageFrom': 1,
'pageSize': 9999, 'pageSize': 9999,
...@@ -488,7 +513,8 @@ export default { ...@@ -488,7 +513,8 @@ export default {
{ {
'fieldName': 'id', 'fieldName': 'id',
'operator': 'EQ', 'operator': 'EQ',
'value': this.$route.query.id // 'value': this.$route.query.id
'value': this.basicData.id
} }
], ],
'operator': 'AND' 'operator': 'AND'
...@@ -523,7 +549,7 @@ export default { ...@@ -523,7 +549,7 @@ export default {
] ]
} }
post('InventoryRequest/search', param).then(res => { post('InventoryRequest/search', param).then(res => {
this.basicData = res.items.content[0] this.currBasicData = res.items.content[0]
this.editInit(res.items.content[0]) this.editInit(res.items.content[0])
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
...@@ -587,7 +613,7 @@ export default { ...@@ -587,7 +613,7 @@ export default {
{ {
'fieldName': 'inventoryReq.id', 'fieldName': 'inventoryReq.id',
'operator': 'EQ', 'operator': 'EQ',
'value': this.basicData.id 'value': this.currBasicData.id
}, },
{ {
'fieldName': 'isRoot', 'fieldName': 'isRoot',
......
...@@ -62,7 +62,7 @@ export default { ...@@ -62,7 +62,7 @@ export default {
} }
} }
}, },
'form.extProductAreaId': { form: {
immediate: true, immediate: true,
deep: true, deep: true,
handler() { handler() {
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
default: () => null default: () => null
}, },
year: { year: {
type: String, type: Number,
default: () => null default: () => null
}, },
unitNo: { unitNo: {
......
<template> <template>
<!-- 弹出框 --> <!-- 弹出框 -->
<dee-dialog <dee-drawer
:title="title" :title="title"
:dialog-visible.sync="visible" :dialog-visible.sync="visible"
width="50%" width="50%"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<!-- <div v-show="loading" class="loading"> <!-- <div v-show="loading" class="loading">
<img src="/icons/loading.gif" alt=""> <img src="/icons/loading.gif" alt="">
</div> --> </div> -->
</dee-dialog> </dee-drawer>
</template> </template>
<script> <script>
import Form from './form' import Form from './form'
......
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
default: () => [] default: () => []
}, },
year: { year: {
type: String, type: Number,
default: () => null default: () => null
} }
}, },
......
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