|
|
@ -106,21 +106,6 @@ |
|
|
|
@alertoldSkipCountDetails="alertoldSkipCountDetails" |
|
|
|
:buttonOperationList_left="operationButtonsDetail" |
|
|
|
></curren-Drawer> |
|
|
|
<!-- <curren-Drawer |
|
|
|
:title="apiColumns_DesTions" |
|
|
|
:tableColumns="apiColumns_DetailsTable" |
|
|
|
:tabsDesTions="apiColumns_DesTions" |
|
|
|
:DrawerLoading="Loading.DrawerLoading" |
|
|
|
:drawer="displayDialog.detailsDialog" |
|
|
|
:dropdownData="dropdownData" |
|
|
|
:propsData="propsData" |
|
|
|
:tableLoading="tableLoading" |
|
|
|
@drawerShut="(val) => (displayDialog.detailsDialog = val)" |
|
|
|
@drawerbutton="drawerbutton" |
|
|
|
@handleCommand="drawerHandle" |
|
|
|
@close-value="closeValue" |
|
|
|
:firstTabs="firstTabs" |
|
|
|
></curren-Drawer> --> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
@ -133,7 +118,10 @@ import { mixins } from "@/mixins/mixins" |
|
|
|
import { filterSelectMixins } from '@/mixins/filter-Select' |
|
|
|
import { initFromApiColumnsLable,firstWordSizeChange } from '@/utils/index' |
|
|
|
import { getPageList } from '@/api/wms-api' |
|
|
|
|
|
|
|
import { |
|
|
|
postCreate, |
|
|
|
postUpdate, |
|
|
|
} from "@/api/wms-api" |
|
|
|
// import { getExportConfigList } from '@/api/wms-interface' |
|
|
|
|
|
|
|
export default { |
|
|
@ -149,20 +137,21 @@ export default { |
|
|
|
], |
|
|
|
computed: { |
|
|
|
editDialog: { |
|
|
|
get: function () { |
|
|
|
// 转义导出列 |
|
|
|
if(this.formReveal){ |
|
|
|
if(this.CreateFormData.exportColumnName)this.CreateFormData.exportColumnNameArr = this.CreateFormData.exportColumnName.split(" ") |
|
|
|
}else{ |
|
|
|
if(this.editFormData.exportColumnName)this.editFormData.exportColumnNameArr = this.editFormData.exportColumnName.split(" ") |
|
|
|
if(this.editFormData.exportTableName){this.getColumList()} |
|
|
|
} |
|
|
|
get: function (val) { |
|
|
|
return this.displayDialog.newDialog || this.displayDialog.editDialog; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
'displayDialog.editDialog'(n){ |
|
|
|
if(n){ |
|
|
|
this.editFormData.exportColumnNameArr = this.editFormData.exportColumnName_old.split(" ") |
|
|
|
this.getColumList() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
data () { |
|
|
|
const userInfo=this.$store.getters.currentUserInfo |
|
|
|
const userInfo=this.$store.getters.currentUserInfo |
|
|
|
return { |
|
|
|
tableLoading:false, |
|
|
|
//常用按钮数据 |
|
|
@ -177,9 +166,10 @@ export default { |
|
|
|
customUserSetting: null, |
|
|
|
exportUserName: userInfo.name, |
|
|
|
exportUserId: userInfo.id, |
|
|
|
exportColumnNameArr:null, |
|
|
|
exportColumnName: null, |
|
|
|
exportTableName: null, |
|
|
|
exportColumnNameArr:null, |
|
|
|
exportTableName_old:null, |
|
|
|
}, |
|
|
|
//编辑 |
|
|
|
editFormData: { |
|
|
@ -187,9 +177,11 @@ export default { |
|
|
|
customUserSetting: null, |
|
|
|
exportUserName: userInfo.name, |
|
|
|
exportUserId: userInfo.id, |
|
|
|
exportColumnNameArr:null, |
|
|
|
exportColumnName: null, |
|
|
|
exportTableName: null, |
|
|
|
exportColumnNameArr:null, |
|
|
|
exportTableName_old:null, |
|
|
|
exportColumnName_old:null |
|
|
|
}, |
|
|
|
editOptions: {}, |
|
|
|
CreateForm: [ |
|
|
@ -197,24 +189,24 @@ export default { |
|
|
|
// { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 }, |
|
|
|
// { type: "input", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 }, |
|
|
|
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", options: "whetherOrNotForNum", colSpan: 12 }, |
|
|
|
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", userOptions: this.initTablesName(), colSpan: 12 }, |
|
|
|
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName_old", userOptions: this.initTablesName(), colSpan: 12 }, |
|
|
|
{ type: "select", disabled:true, multiple:true, label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnNameArr", userOptions:null, colSpan: 12 }, |
|
|
|
], |
|
|
|
editForm: [ |
|
|
|
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", options: "whetherOrNotForNum", colSpan: 12 }, |
|
|
|
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", userOptions: this.initTablesName(), colSpan: 12 }, |
|
|
|
{ type: "select", label: initFromApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName_old", userOptions: this.initTablesName(), colSpan: 12 }, |
|
|
|
{ type: "select", multiple:true, label: initFromApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnNameArr", userOptions:null, colSpan: 12 }, |
|
|
|
], |
|
|
|
editRules: { |
|
|
|
cerateRule: { |
|
|
|
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
exportColumnNameArr: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
exportTableName_old: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
}, |
|
|
|
editRule: { |
|
|
|
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
exportColumnNameArr: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
exportTableName_old: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
} |
|
|
|
}, |
|
|
|
columsList:[], |
|
|
@ -224,14 +216,28 @@ export default { |
|
|
|
this.paging(); |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
pagingCallback(){ |
|
|
|
this.Loading.tableLoading = false |
|
|
|
this.tableData.forEach(item=>{ |
|
|
|
item.exportTableName_old = item.exportTableName |
|
|
|
item.exportColumnName_old = item.exportColumnName |
|
|
|
item.exportTableName = initFromApiColumnsLable(item.exportTableName) |
|
|
|
let _arr = item.exportColumnName.split(" ") |
|
|
|
let _zhArr = [] |
|
|
|
_arr.forEach(item2=>{ |
|
|
|
let _item2 = initFromApiColumnsLable(item.exportTableName_old+firstWordSizeChange(item2,'Upper')) || item2 |
|
|
|
_zhArr.push(_item2) |
|
|
|
}) |
|
|
|
item.exportColumnName = _zhArr.join(',') |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 新增/编辑的导出表下拉 |
|
|
|
initTablesName(){ |
|
|
|
let _names = this.$store.getters.tablesName |
|
|
|
let tablesList = [] |
|
|
|
_names.forEach(item=>{ |
|
|
|
let _item = { |
|
|
|
// label:initFromApiColumnsLable(item), |
|
|
|
label:item, |
|
|
|
label:initFromApiColumnsLable(item), |
|
|
|
value:item |
|
|
|
} |
|
|
|
tablesList.push(_item) |
|
|
@ -240,36 +246,28 @@ export default { |
|
|
|
}, |
|
|
|
changeSelect(prop,val){ |
|
|
|
// 获取对应表的表头 |
|
|
|
if(prop=='exportTableName'){ |
|
|
|
if(prop=='exportTableName_old'){ |
|
|
|
if(this.formReveal){ |
|
|
|
this.CreateForm[2].disabled = false |
|
|
|
// this.CreateFormData.exportTableName = this.CreateFormData.exportTableName_old |
|
|
|
this.CreateFormData.exportColumnNameArr = [] |
|
|
|
}else{ |
|
|
|
this.editForm[2].disabled = false |
|
|
|
// this.editFormData.exportTableName = this.editFormData.exportTableName_old |
|
|
|
this.editFormData.exportColumnNameArr = [] |
|
|
|
} |
|
|
|
this.getColumList() |
|
|
|
} |
|
|
|
// 转义导出列值 |
|
|
|
if(prop == 'exportColumnNameArr'){ |
|
|
|
let _val = val.join(' ') |
|
|
|
if(this.formReveal){ |
|
|
|
this.CreateFormData.exportColumnName = _val |
|
|
|
}else{ |
|
|
|
this.editFormData.exportColumnName = _val |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
getColumList(){ |
|
|
|
let val = this.formReveal ? this.CreateFormData.exportTableName : this.editFormData.exportTableName |
|
|
|
let val = this.formReveal ? this.CreateFormData.exportTableName_old : this.editFormData.exportTableName_old |
|
|
|
getPageList(this.PageListParams, val+'/base').then(res=>{ |
|
|
|
let _column = res.items[0] |
|
|
|
this.columsList = [] |
|
|
|
for(let item in _column){ |
|
|
|
if(item != 'detail' || item != 'details'){ |
|
|
|
let _item = { |
|
|
|
// label:initFromApiColumnsLable(val+firstWordSizeChange(item,'Upper')), |
|
|
|
label:item, |
|
|
|
label:initFromApiColumnsLable(val+firstWordSizeChange(item,'Upper')), |
|
|
|
value:item |
|
|
|
} |
|
|
|
this.columsList.push(_item) |
|
|
@ -281,7 +279,43 @@ export default { |
|
|
|
this.editForm[2].userOptions = this.columsList |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
//提交表单 |
|
|
|
FormSubmit(val) { |
|
|
|
this.ref = val |
|
|
|
this.Loading.newAndEdiLoading = true |
|
|
|
let _updata = this.formReveal ? this.URLOption_add : this.URLOption_edit |
|
|
|
let _url = this.URLOption_updata ? this.URLOption_updata : (_updata ? _updata : this.URLOption_base) |
|
|
|
switch (this.formReveal) { |
|
|
|
case true: |
|
|
|
this.CreateFormData.exportColumnName = this.CreateFormData.exportColumnNameArr.join(" ") |
|
|
|
this.CreateFormData.exportTableName = this.CreateFormData.exportTableName_old |
|
|
|
if(!_updata && !this.URLOption_updata){_url = _url + '/create'} |
|
|
|
postCreate(this.CreateFormData, _url).then(res => { |
|
|
|
this.oldSkipCount = 1; |
|
|
|
this.Loading.newAndEdiLoading = false |
|
|
|
this.paging() |
|
|
|
this.FormResult("success") |
|
|
|
}).catch(err => { |
|
|
|
this.Loading.newAndEdiLoading = false |
|
|
|
this.FormResult("error") |
|
|
|
}) |
|
|
|
break; |
|
|
|
case false: |
|
|
|
if(!_updata && !this.URLOption_updata){_url = _url + '/update-by-id'} |
|
|
|
this.editFormData.exportColumnName = this.editFormData.exportColumnNameArr.join(" ") |
|
|
|
this.editFormData.exportTableName = this.editFormData.exportTableName_old |
|
|
|
postUpdate(this.editFormData, this.editFormData.id, _url).then(res => { |
|
|
|
this.propsData = res |
|
|
|
this.Loading.newAndEdiLoading = false |
|
|
|
this.paging() |
|
|
|
this.FormResult("success") |
|
|
|
}).catch(err => { |
|
|
|
this.Loading.newAndEdiLoading = false |
|
|
|
this.FormResult("error") |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|