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