75 changed files with 3518 additions and 6891 deletions
@ -1,35 +1,8 @@ |
|||
// dev_win
|
|||
window.SITE_CONFIG['base'] = 'http://dev.ccwin-in.com:60069' |
|||
window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-localization' |
|||
// window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-configuration'
|
|||
window.SITE_CONFIG['columnsApiNamesZh'] = 'Winin' |
|||
window.SITE_CONFIG['isAutoLogin'] = false |
|||
window.SITE_CONFIG['isAutoLogin'] = true |
|||
window.SITE_CONFIG['isSinglePage'] = false |
|||
window.SITE_CONFIG['userNameOrEmailAddress'] = 'admin' |
|||
window.SITE_CONFIG['client_secret'] = '1q2w3E*' |
|||
// window.SITE_CONFIG['user'] = 'http://dev.ccwin-in.com:60069/api'
|
|||
// // window.SITE_CONFIG['print'] = 'print'21384
|
|||
// window.SITE_CONFIG['print'] = 'http://dev.ccwin-in.com:60074'
|
|||
// window.SITE_CONFIG['largeScreen'] = 'http://dev.ccwin-in.com:60073'
|
|||
// window.SITE_CONFIG['warehouseCode'] = 'T8'
|
|||
// window.SITE_CONFIG['company'] = 'DongYang'
|
|||
// window.SITE_CONFIG['client_secret'] = '1q2w3E*'
|
|||
// window.SITE_CONFIG['reportsUrl'] = 'http://dev.ccwin-in.com:60074/#/reports/'
|
|||
// window.SITE_CONFIG['versionUrl'] = 'http://dev.ccwin-in.com:60070'
|
|||
// window.SITE_CONFIG['companyName'] = '长春一汽富维东阳汽车塑料零部件(安徽)有限公司'
|
|||
// 接口看板地址
|
|||
// window.SITE_CONFIG['interfaceBoardUrl'] = 'http://dev.ccwin-in.com:60090/'
|
|||
// window.SITE_CONFIG['interfaceBoardUrl'] = 'http://dev.ccwin-in.com:60069/'
|
|||
// 接口看板表头获取地址
|
|||
// window.SITE_CONFIG['interfaceBoardColumnsApi'] = 'api/abp/application-configuration'
|
|||
|
|||
// mock
|
|||
// window.SITE_CONFIG['apifoxToken'] = 'NXHNi5mp0dnUHGt0wkCrjvfcidsFKV33'
|
|||
// window.SITE_CONFIG['base'] = 'https://mock.apifox.cn/m1/1773588-0-default'
|
|||
// window.SITE_CONFIG['user'] = 'http://dev.ccwin-in.com:60099/api/auth'
|
|||
// window.SITE_CONFIG['print'] = 'print'
|
|||
// window.SITE_CONFIG['largeScreen'] = 'http://dev.ccwin-in.com:60073'
|
|||
// window.SITE_CONFIG['warehouseCode'] = 'T8'
|
|||
// window.SITE_CONFIG['company'] = 'DongYang'
|
|||
// window.SITE_CONFIG['client_secret'] = '1q2w3E*'
|
|||
// window.SITE_CONFIG['reportsUrl'] = 'http://10.164.0.227:59091/#/reports/'
|
|||
window.SITE_CONFIG['menuHiddenConfig'] = ['AsnDet','PoDet','ReceiptDet','ReturnDet','SodDet'] |
@ -1,56 +0,0 @@ |
|||
import request from '@/utils/request' |
|||
// let baseURL = localStorage.getItem('print') + '/api/'
|
|||
let baseURL = localStorage.getItem('base') + '/api/' |
|||
|
|||
// 根据箱码获取标签相关信息 | 补打标签
|
|||
export function getOneInventoryLabelByCode(code) { |
|||
return request({ |
|||
url: baseURL + 'label/inventory-label/by-code/' + code, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 批量获取箱标签信息 | 到货请求
|
|||
export function getInventoryLabelByCodes(data) { |
|||
return request({ |
|||
url: baseURL + 'label/inventory-label/by-codes', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
//生产、采购生成标签(批量)| 标签管理模块
|
|||
export function postInventoryLabelCode(data) { |
|||
return request({ |
|||
url: baseURL + 'label/Inventory-label/generate-and-create/many', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
//生产、采购生成标签(一次多个)| 标签管理模块
|
|||
export function postInventoryLabelCode_count(params,data) { |
|||
return request({ |
|||
url: baseURL + 'label/inventory-label/generate-and-create/many/'+params.count, |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 拆箱 | 标签管理-拆分箱标签
|
|||
export function postSplitPacking(data) { |
|||
return request({ |
|||
url: baseURL + 'wms/store/transfer-note/split-packing', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 拆箱记录列表
|
|||
export function splitPackingList(data) { |
|||
return request({ |
|||
url: baseURL + 'wms/store/transfer-note/get-split-packing-list', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
@ -1,142 +0,0 @@ |
|||
<template> |
|||
<div :style="{zIndex:zIndex,height:height,width:width}" class="pan-item"> |
|||
<div class="pan-info"> |
|||
<div class="pan-info-roles-container"> |
|||
<slot /> |
|||
</div> |
|||
</div> |
|||
<!-- eslint-disable-next-line --> |
|||
<div :style="{backgroundImage: `url(${image})`}" class="pan-thumb"></div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'PanThumb', |
|||
props: { |
|||
image: { |
|||
type: String, |
|||
required: true |
|||
}, |
|||
zIndex: { |
|||
type: Number, |
|||
default: 1 |
|||
}, |
|||
width: { |
|||
type: String, |
|||
default: '150px' |
|||
}, |
|||
height: { |
|||
type: String, |
|||
default: '150px' |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.pan-item { |
|||
width: 200px; |
|||
height: 200px; |
|||
border-radius: 50%; |
|||
display: inline-block; |
|||
position: relative; |
|||
cursor: default; |
|||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); |
|||
} |
|||
|
|||
.pan-info-roles-container { |
|||
padding: 20px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.pan-thumb { |
|||
width: 100%; |
|||
height: 100%; |
|||
background-position: center center; |
|||
background-size: cover; |
|||
border-radius: 50%; |
|||
overflow: hidden; |
|||
position: absolute; |
|||
transform-origin: 95% 40%; |
|||
transition: all 0.3s ease-in-out; |
|||
} |
|||
|
|||
/* .pan-thumb:after { |
|||
content: ''; |
|||
width: 8px; |
|||
height: 8px; |
|||
position: absolute; |
|||
border-radius: 50%; |
|||
top: 40%; |
|||
left: 95%; |
|||
margin: -4px 0 0 -4px; |
|||
background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%); |
|||
box-shadow: 0 0 1px rgba(255, 255, 255, 0.9); |
|||
} */ |
|||
|
|||
.pan-info { |
|||
position: absolute; |
|||
width: inherit; |
|||
height: inherit; |
|||
border-radius: 50%; |
|||
overflow: hidden; |
|||
box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.05); |
|||
} |
|||
|
|||
.pan-info h3 { |
|||
color: #fff; |
|||
text-transform: uppercase; |
|||
position: relative; |
|||
letter-spacing: 2px; |
|||
font-size: 18px; |
|||
margin: 0 60px; |
|||
padding: 22px 0 0 0; |
|||
height: 85px; |
|||
font-family: 'Open Sans', Arial, sans-serif; |
|||
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3); |
|||
} |
|||
|
|||
.pan-info p { |
|||
color: #fff; |
|||
padding: 10px 5px; |
|||
font-style: italic; |
|||
margin: 0 30px; |
|||
font-size: 12px; |
|||
border-top: 1px solid rgba(255, 255, 255, 0.5); |
|||
} |
|||
|
|||
.pan-info p a { |
|||
display: block; |
|||
color: #333; |
|||
width: 80px; |
|||
height: 80px; |
|||
background: rgba(255, 255, 255, 0.3); |
|||
border-radius: 50%; |
|||
color: #fff; |
|||
font-style: normal; |
|||
font-weight: 700; |
|||
text-transform: uppercase; |
|||
font-size: 9px; |
|||
letter-spacing: 1px; |
|||
padding-top: 24px; |
|||
margin: 7px auto 0; |
|||
font-family: 'Open Sans', Arial, sans-serif; |
|||
opacity: 0; |
|||
transition: transform 0.3s ease-in-out 0.2s, opacity 0.3s ease-in-out 0.2s, background 0.2s linear 0s; |
|||
transform: translateX(60px) rotate(90deg); |
|||
} |
|||
|
|||
.pan-info p a:hover { |
|||
background: rgba(255, 255, 255, 0.5); |
|||
} |
|||
|
|||
.pan-item:hover .pan-thumb { |
|||
transform: rotate(-110deg); |
|||
} |
|||
|
|||
.pan-item:hover .pan-info p a { |
|||
opacity: 1; |
|||
transform: translateX(0px) rotate(0deg); |
|||
} |
|||
</style> |
@ -1,654 +0,0 @@ |
|||
<template> |
|||
<el-dialog |
|||
:title="formTitle" |
|||
v-if="displayDialog.newDialog" |
|||
:visible="true" |
|||
:fullscreen="true" |
|||
:append-to-body="false" |
|||
:modal="false" |
|||
:modal-append-to-body="false" |
|||
:show-close="false" |
|||
> |
|||
<div id="stepsForm"> |
|||
<el-steps |
|||
:active="active" |
|||
process-status="finish" |
|||
finish-status="success" |
|||
:align-center="true" |
|||
> |
|||
<el-step |
|||
v-for="(item, index) in stepFilters" |
|||
:key="index" |
|||
:title="item" |
|||
></el-step> |
|||
</el-steps> |
|||
<!-- "总体信息" --> |
|||
<curren-Form |
|||
v-if="active == 0" |
|||
class="page1" |
|||
size="medium" |
|||
ref="page1" |
|||
:searchData="CreateFormData" |
|||
:searchForm="CreateForm" |
|||
:searchOptions="Options" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
:loading="loading" |
|||
@push="DataPush(arguments)" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
</curren-Form> |
|||
<!-- "物品参数" --> |
|||
<searchPage |
|||
ref="searchTable" |
|||
:tableLoading="tableLoading" |
|||
:advancedFilter="advancedFilter( |
|||
'basedata/item-basic', |
|||
pageListItemBasic, |
|||
'totalCountItemBasic', |
|||
'itemBasicData', |
|||
oldSkipCountItemBasic |
|||
)" |
|||
:filterPageListParams="[]" |
|||
:formTitle="''" |
|||
:displayDialog="active == 1" |
|||
:selectionTable="false" |
|||
:editHandle="editHandle" |
|||
:searchTableData="locationData" |
|||
:searchTableColumns="$isTableColumns.Location" |
|||
:searchTotalCount="totalCountLocation" |
|||
:supplierItemPage="pageListLocation" |
|||
@SizeChange="AddNewAlterResultCount( |
|||
$event, |
|||
'basedata/item-basic', |
|||
pageListItemBasic, |
|||
'totalCountItemBasic', |
|||
'itemBasicData', |
|||
oldSkipCountItemBasic |
|||
)" |
|||
@CurrentChange="AddNewAlertoldSkipCount( |
|||
$event, |
|||
'basedata/item-basic', |
|||
pageListItemBasic, |
|||
'totalCountItemBasic', |
|||
'itemBasicData', |
|||
oldSkipCountItemBasic |
|||
)" |
|||
@tableButtonClick="addFormData(arguments)" |
|||
></searchPage> |
|||
<!-- "库位参数" --> |
|||
<searchPage |
|||
ref="searchTable" |
|||
:tableLoading="tableLoading" |
|||
:advancedFilter="advancedFilter( |
|||
'basedata/location', |
|||
pageListLocation, |
|||
'totalCountLocation', |
|||
'locationData', |
|||
oldSkipCountLocation |
|||
)" |
|||
:filterPageListParams="[]" |
|||
:formTitle="''" |
|||
:displayDialog="active == 2" |
|||
:selectionTable="false" |
|||
:editHandle="editHandle" |
|||
:searchTableData="locationData" |
|||
:searchTableColumns="$isTableColumns.Location" |
|||
:searchTotalCount="totalCountLocation" |
|||
:supplierItemPage="pageListLocation" |
|||
@SizeChange="AddNewAlterResultCount( |
|||
$event, |
|||
'basedata/location', |
|||
pageListLocation, |
|||
'totalCountLocation', |
|||
'locationData', |
|||
oldSkipCountLocation |
|||
)" |
|||
@CurrentChange="AddNewAlertoldSkipCount( |
|||
$event, |
|||
'basedata/location', |
|||
pageListLocation, |
|||
'totalCountLocation', |
|||
'locationData', |
|||
oldSkipCountLocation |
|||
)" |
|||
@tableButtonClick="addFormData(arguments)" |
|||
></searchPage> |
|||
<!-- "其他参数" --> |
|||
<curren-Form |
|||
v-loading="loading" |
|||
v-if="active == 3" |
|||
class="page1" |
|||
size="medium" |
|||
ref="page1" |
|||
:searchData="other" |
|||
:searchForm="otherForm" |
|||
:searchOptions="Options" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
:loading="loading" |
|||
@push="DataPush(arguments)" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
</curren-Form> |
|||
<!-- <curren-Form |
|||
v-if="active === 4" |
|||
size="medium" |
|||
class="page3" |
|||
:searchData="previewFormData" |
|||
:searchForm="CreateForm | formData" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
:loading="loading" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
<template> |
|||
<el-form-item class="formTable-box" prop="details"> |
|||
<currenTable |
|||
:tableData="previewFormData.details" |
|||
:tableColumns="detailsTableColumns | formDataDetails" |
|||
:selectionTable="false" |
|||
> |
|||
</currenTable> |
|||
</el-form-item> |
|||
</template> |
|||
</curren-Form> --> |
|||
<!-- "结果" --> |
|||
<div |
|||
v-if="active === step.length - 1 && pageStatus === 'success'" |
|||
class="page4" |
|||
> |
|||
<el-result icon="success" title="成功提示" subTitle="新增成功"> |
|||
<template slot="extra"> |
|||
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint" |
|||
>打印托标签</el-button |
|||
> |
|||
<el-button type="primary" size="medium" @click="xbqFormPrint" |
|||
>打印箱标签</el-button |
|||
> --> |
|||
<el-button |
|||
v-for="item in successHandle" |
|||
:key="item.label" |
|||
:type="item.type" |
|||
size="medium" |
|||
@click="item.click()" |
|||
>{{ item.label }}</el-button |
|||
> |
|||
<el-button type="primary" size="medium" @click="close(1)" |
|||
>退出</el-button |
|||
> |
|||
</template> |
|||
</el-result> |
|||
</div> |
|||
<div |
|||
v-if="active === step.length - 1 && pageStatus === 'error'" |
|||
class="page4" |
|||
> |
|||
<el-result icon="error" title="错误提示" subTitle="新增失败"> |
|||
<template slot="extra"> |
|||
<el-button type="primary" size="medium" @click="close(1)" |
|||
>退出</el-button |
|||
> |
|||
</template> |
|||
</el-result> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</template> |
|||
<script> |
|||
import currenForm from "@/components/currenForm"; |
|||
import currenTable from "@/components/currenTable"; |
|||
import { |
|||
getPageList, |
|||
postCreateWithCondition, |
|||
postCreate, |
|||
} from "@/api/wms-api"; |
|||
export default { |
|||
name: "stepsForm", |
|||
components: { |
|||
currenForm, |
|||
currenTable, |
|||
}, |
|||
watch: { |
|||
active(val) { |
|||
if (val != 0) { |
|||
this.editHandle[0].label = "上一步"; |
|||
} else { |
|||
this.editHandle[0].label = "取消"; |
|||
} |
|||
}, |
|||
}, |
|||
filters: { |
|||
formData(val) { |
|||
let data = JSON.parse(JSON.stringify(val)); |
|||
val.forEach((key, index) => { |
|||
data[index].disabled = "true"; |
|||
delete data[index].focus; |
|||
if (key.type == "autocomplete" || key.type == "import") { |
|||
data[index].type = "input"; |
|||
} |
|||
}); |
|||
return data; |
|||
}, |
|||
formDataDetails(val) { |
|||
let data = JSON.parse(JSON.stringify(val)); |
|||
val.forEach((key, index) => { |
|||
data[index].disabled = "true"; |
|||
delete data[index].focus; |
|||
delete data[index].rules; |
|||
if (key.type == "autocomplete" || key.type == "import") { |
|||
data[index].type = "input"; |
|||
} else if (key.type == "objectAutocomplete") { |
|||
data[index].type = "objectInput"; |
|||
} else if (key.prop == "containerCode") data[index].disabled = "false"; |
|||
}); |
|||
return data; |
|||
}, |
|||
}, |
|||
props: { |
|||
//名称 |
|||
formTitle: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
//是否弹窗 |
|||
displayDialog: { |
|||
type: Object, |
|||
default: () => { |
|||
return { |
|||
newDialog: false, |
|||
}; |
|||
}, |
|||
}, |
|||
//主表提交数据 |
|||
CreateFormData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
//主表显示form |
|||
CreateForm: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
//预览数据 |
|||
// previewFormData: { |
|||
// type: Object, |
|||
// default: () => { |
|||
// return {} |
|||
// } |
|||
// }, |
|||
//检验 |
|||
Rules: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
//下拉选择 |
|||
Options: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
//子表table显示 |
|||
detailsTableColumns: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
//子表提交数据 |
|||
childTableData: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
//成功后的操作 |
|||
successHandle: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
computed: { |
|||
stepFilters() { |
|||
let stepFilters = []; |
|||
const routeName = this.$route.meta.title; |
|||
this.step.forEach((key) => { |
|||
stepFilters.push(routeName.concat(key)); |
|||
}); |
|||
return stepFilters; |
|||
}, |
|||
// autoAdvanced () { |
|||
// if (this.active == 1) { |
|||
// return this.advancedFilter( |
|||
// 'item-basic', |
|||
// this.pageListItemBasic, |
|||
// 'totalCountItemBasic', |
|||
// 'itemBasicData', |
|||
// this.oldSkipCountItemBasic |
|||
// ) |
|||
// } else if (this.active == 2) { |
|||
// return this.advancedFilter( |
|||
// 'location', |
|||
// this.pageListLocation, |
|||
// 'totalCountLocation', |
|||
// 'locationData', |
|||
// this.oldSkipCountLocation |
|||
// ) |
|||
// } |
|||
// }, |
|||
}, |
|||
data() { |
|||
return { |
|||
active: 0, |
|||
formReveal: 1, |
|||
pageStatus: "", |
|||
filterListParams: [], |
|||
itemBasicData: [], |
|||
isItemBasicData: [], |
|||
previewFormData: [], |
|||
totalCountItemBasic: 0, |
|||
oldSkipCountItemBasic: 1, |
|||
pageListItemBasic: { |
|||
condition: { |
|||
filters: [], |
|||
}, |
|||
Sorting: "", |
|||
SkipCount: 0, |
|||
MaxResultCount: 100, |
|||
}, |
|||
locationData: [], |
|||
isLocationData: [], |
|||
totalCountLocation: 0, |
|||
oldSkipCountLocation: 1, |
|||
pageListLocation: { |
|||
condition: { |
|||
filters: [], |
|||
}, |
|||
Sorting: "", |
|||
SkipCount: 0, |
|||
MaxResultCount: 100, |
|||
}, |
|||
other: { |
|||
otherParam: [], |
|||
}, |
|||
otherForm: [ |
|||
{ |
|||
label: "状态", |
|||
prop: "otherParam", |
|||
type: "checkbox", |
|||
indeterminate:"true", |
|||
checkboxs: "radios", |
|||
}, |
|||
], |
|||
otherFormData: { |
|||
countMethod: 0, |
|||
// type: 0,//盘点类型 |
|||
company: null, |
|||
description: null, |
|||
// beginTime: null, |
|||
// endTime: null, |
|||
planTime: null, |
|||
partCondition: {}, |
|||
locCondition: {}, |
|||
statusList: [], |
|||
worker: null, |
|||
warehouseCode: null, |
|||
remark: null, |
|||
}, |
|||
loading: false, |
|||
tableLoading: false, |
|||
session: null, |
|||
step: ["总体信息", "物品参数", "库位参数", "其他参数", "结果"], |
|||
editHandle: [ |
|||
{ label: "取消", name: "cancel" }, |
|||
{ label: "下一步", type: "primary", name: "determine" }, |
|||
], |
|||
}; |
|||
}, |
|||
mounted() { |
|||
this.session = JSON.parse(JSON.stringify(this.CreateFormData)); |
|||
}, |
|||
methods: { |
|||
//结束退出 |
|||
close(val) { |
|||
this.active = 0; |
|||
const filter ={ |
|||
condition: { |
|||
filters: [], |
|||
}, |
|||
Sorting: "", |
|||
SkipCount: 0, |
|||
MaxResultCount: 100, |
|||
} |
|||
this.pageListItemBasic = JSON.parse(JSON.stringify(filter)) |
|||
this.pageListLocation = JSON.parse(JSON.stringify(filter)) |
|||
const data = JSON.parse(JSON.stringify(this.session)); |
|||
this.itemBasicData = [] |
|||
this.locationData = [] |
|||
this.$emit("close", data, val); |
|||
}, |
|||
//autoComplete主表 |
|||
DataPush(val) { |
|||
this.$emit("DataPush", val); |
|||
}, |
|||
//autoComplete子表 |
|||
detailsDataPush(val) { |
|||
this.$emit("detailsDataPush", val); |
|||
}, |
|||
//确定筛选 |
|||
advancedFilter(url, list, TotalCount, data, oldSkipCount) { |
|||
return () => { |
|||
list.SkipCount = (oldSkipCount - 1) * list.MaxResultCount; |
|||
this.tableLoading = true; |
|||
getPageList(list, url) |
|||
.then((res) => { |
|||
this[data] = res.items; |
|||
this[TotalCount] = res.totalCount; |
|||
this.tableLoading = false; |
|||
}) |
|||
.catch(() => { |
|||
this.tableLoading = false; |
|||
}); |
|||
}; |
|||
}, |
|||
//选择子表(接收分页组件emit改变每页最大页数) |
|||
AddNewAlterResultCount(val, url, list, TotalCount, data, oldSkipCount) { |
|||
list.MaxResultCount = val; |
|||
const Function = this.advancedFilter( |
|||
url, |
|||
list, |
|||
TotalCount, |
|||
data, |
|||
oldSkipCount |
|||
); |
|||
Function(); |
|||
}, |
|||
//选择子表(接收分页组件emit改变当前页) |
|||
AddNewAlertoldSkipCount(val, url, list, TotalCount, data, oldSkipCount) { |
|||
oldSkipCount = val; |
|||
const Function = this.advancedFilter( |
|||
url, |
|||
list, |
|||
TotalCount, |
|||
data, |
|||
oldSkipCount |
|||
); |
|||
Function(); |
|||
}, |
|||
//打印托标签 |
|||
tuoFormPrint() { |
|||
this.$emit("tuoFormPrint"); |
|||
}, |
|||
//打印箱标签 |
|||
xbqFormPrint() { |
|||
this.$emit("xbqFormPrint"); |
|||
}, |
|||
// //添加封装 |
|||
// addNew (url, list, TotalCount, data, MaxResultItem) { |
|||
// list.SkipCount = 0 |
|||
// list.MaxResultCount = JSON.parse(TotalCount) |
|||
// getPageList(list, url).then((res) => { |
|||
// this[data] = res.items |
|||
// list.MaxResultCount = MaxResultItem |
|||
// }) |
|||
// }, |
|||
//添加明细 |
|||
addFormData(val) { |
|||
if (val[0] == "cancel") { |
|||
this.active--; |
|||
} else { |
|||
if (this.active == 1) { |
|||
const MaxResultItem = JSON.parse( |
|||
this.pageListItemBasic.MaxResultCount |
|||
); |
|||
// this.addNew('item-basic', this.pageListItemBasic, this.totalCountItemBasic, 'isItemBasicData', MaxResultItem) |
|||
// this.pageListItemBasic.MaxResultCount = MaxResultItem |
|||
const Function = this.advancedFilter( |
|||
"basedata/location", |
|||
this.pageListLocation, |
|||
"totalCountLocation", |
|||
"locationData", |
|||
this.oldSkipCountLocation |
|||
); |
|||
Function(); |
|||
this.$nextTick(()=>{ |
|||
this.active++; |
|||
}) |
|||
} else if (this.active == 2) { |
|||
const MaxResultLocation = JSON.parse( |
|||
this.pageListLocation.MaxResultCount |
|||
); |
|||
// this.addNew('location', this.pageListLocation, this.totalCountLocation, 'isLocationData', MaxResultLocation) |
|||
// this.pageListLocation.MaxResultCount = MaxResultLocation |
|||
this.active++; |
|||
} |
|||
} |
|||
}, |
|||
//拆分 |
|||
splitFormData(val) { |
|||
return new Promise((resolve, reject) => { |
|||
postCreateWithCondition(val, "wms/store/count-plan") |
|||
.then((res) => { |
|||
this.previewFormData = JSON.parse( |
|||
JSON.stringify(this.CreateFormData) |
|||
); |
|||
// delete this.previewFormData.details |
|||
this.$listAssign(this.previewFormData, res); |
|||
this.previewFormData.details = []; |
|||
res.details.forEach((item) => { |
|||
const details = JSON.parse( |
|||
JSON.stringify(...this.childTableData) |
|||
); |
|||
this.$listAssign(details, item); |
|||
this.previewFormData.details.push(details); |
|||
}); |
|||
resolve(); |
|||
}) |
|||
.catch((err) => { |
|||
reject(); |
|||
}); |
|||
}); |
|||
}, |
|||
editFormClick(val) { |
|||
// Moment(this.CreateFormData.arriveTime).format() |
|||
if (val[0] == 0) { |
|||
if (this.active == 0) { |
|||
this.close(0); |
|||
} else { |
|||
this.active--; |
|||
} |
|||
} else { |
|||
val[1].validate((valid) => { |
|||
if (valid) { |
|||
if (this.active == 0) { |
|||
const Function = this.advancedFilter( |
|||
"basedata/item-basic", |
|||
this.pageListItemBasic, |
|||
"totalCountItemBasic", |
|||
"itemBasicData", |
|||
this.oldSkipCountItemBasic |
|||
); |
|||
Function(); |
|||
this.active++; |
|||
} else if (this.active == 3) { |
|||
this.$listAssign(this.otherFormData, this.CreateFormData); |
|||
this.otherFormData.partCondition = |
|||
this.pageListItemBasic.condition; |
|||
this.otherFormData.locCondition = this.pageListLocation.condition; |
|||
this.otherFormData.statusList = []; |
|||
let checkboxArray = [] |
|||
this.other.otherParam.forEach(item => { |
|||
if (item == '待检') { |
|||
checkboxArray.push(1) |
|||
} else if (item == '合格') { |
|||
checkboxArray.push(2) |
|||
} else if (item == '不合格') { |
|||
checkboxArray.push(3) |
|||
} else if (item == '隔离') { |
|||
checkboxArray.push(4) |
|||
} else if (item == '破坏') { |
|||
checkboxArray.push(5) |
|||
} else if (item == '冻结') { |
|||
checkboxArray.push(6) |
|||
} |
|||
}) |
|||
// 待检', '合格', '不合格', '隔离', '破坏', '冻结' |
|||
this.otherFormData.statusList = checkboxArray; |
|||
this.otherFormData.vendCondition = { |
|||
filters:[] |
|||
} |
|||
this.loading = true; |
|||
this.otherFormData.requestType = 2 |
|||
this.splitFormData(this.otherFormData).then( |
|||
(resolve) => { |
|||
this.pageStatus = "success"; |
|||
this.active++; |
|||
this.loading = false; |
|||
}, |
|||
(reject) => { |
|||
this.pageStatus = "error"; |
|||
this.active++; |
|||
this.loading = false; |
|||
} |
|||
); |
|||
} |
|||
// else if (this.active == 4) { |
|||
// postCreate(this.previewFormData, 'count-plan').then(res => { |
|||
// this.pageStatus = 'success' |
|||
// this.active++ |
|||
// this.loading = false |
|||
// }).catch(err => { |
|||
// this.pageStatus = 'error' |
|||
// this.active++ |
|||
// this.loading = false |
|||
// }) |
|||
// } |
|||
else { |
|||
this.$errorMsg("请检查表单"); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "./style/index.scss"; |
|||
</style> |
|||
<style lang="scss"> |
|||
#stepsForm{ |
|||
.formButton{ |
|||
text-align: right; |
|||
} |
|||
} |
|||
</style> |
@ -1,723 +0,0 @@ |
|||
<template> |
|||
<el-dialog |
|||
:title="formTitle" |
|||
v-if="displayDialog.newDialog" |
|||
:visible="true" |
|||
:fullscreen="true" |
|||
:append-to-body="false" |
|||
:modal="false" |
|||
:modal-append-to-body="false" |
|||
:show-close="false" |
|||
> |
|||
<div id="stepsForm"> |
|||
<el-steps |
|||
:active="active" |
|||
process-status="finish" |
|||
finish-status="success" |
|||
:align-center="true" |
|||
> |
|||
<el-step |
|||
v-for="(item, index) in stepFilters" |
|||
:key="index" |
|||
:title="item" |
|||
></el-step> |
|||
</el-steps> |
|||
<!-- 总体信息 --> |
|||
<curren-Form |
|||
v-if="active == 0" |
|||
class="page1" |
|||
size="medium" |
|||
ref="page1" |
|||
:searchData="CreateFormData" |
|||
:searchForm="CreateForm" |
|||
:searchOptions="Options" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
:loading="loading" |
|||
@push="DataPush(arguments)" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
</curren-Form> |
|||
<!-- 库位参数 --> |
|||
<!-- 搜索按钮——窗体组件LocationForPADPlan --> |
|||
<searchPage |
|||
v-if="active == 1" |
|||
@sxBtnClickHandle="sxBtnClickHandle" |
|||
ref="searchTable" |
|||
:tableLoading="tableLoading" |
|||
:filterActionOptions="filterActionOptions" |
|||
:advancedFilter="advancedFilter( |
|||
'basedata/location', |
|||
pageListLocation, |
|||
'totalCountLocation', |
|||
'locationData', |
|||
oldSkipCountLocation |
|||
)" |
|||
:setUTableHeight="355" |
|||
:filterPageListParams="[]" |
|||
:formTitle="''" |
|||
:displayDialog="active == 1" |
|||
:selectionTable="false" |
|||
:editHandle="editHandle" |
|||
:buttonsAllIsRight="true" |
|||
:searchTableData="locationData" |
|||
:searchTableColumns="initSearchPageTableColums()" |
|||
:searchTotalCount="totalCountLocation" |
|||
:supplierItemPage="pageListLocation" |
|||
@SizeChange="AddNewAlterResultCount( |
|||
$event, |
|||
'basedata/location', |
|||
pageListLocation, |
|||
'totalCountLocation', |
|||
'locationData', |
|||
oldSkipCountLocation |
|||
)" |
|||
@CurrentChange="AddNewAlertoldSkipCount( |
|||
$event, |
|||
'basedata/location', |
|||
pageListLocation, |
|||
'totalCountLocation', |
|||
'locationData', |
|||
oldSkipCountLocation |
|||
)" |
|||
@tableButtonClick="addFormData(arguments)" |
|||
></searchPage> |
|||
<!-- @filterBtnClickHandle="filterBtnClickHandle" --> |
|||
<!-- 其他参数 --> |
|||
<curren-Form |
|||
v-loading="loading" |
|||
v-if="active == 2" |
|||
class="page1" |
|||
size="medium" |
|||
ref="page1" |
|||
:searchData="other" |
|||
:searchForm="otherForm" |
|||
:searchOptions="Options" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
:loading="loading" |
|||
@push="DataPush(arguments)" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
</curren-Form> |
|||
<!-- <curren-Form |
|||
v-if="active === 4" |
|||
size="medium" |
|||
class="page3" |
|||
:searchData="previewFormData" |
|||
:searchForm="CreateForm | formData" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
:loading="loading" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
<template> |
|||
<el-form-item class="formTable-box" prop="details"> |
|||
<currenTable |
|||
:tableData="previewFormData.details" |
|||
:tableColumns="detailsTableColumns | formDataDetails" |
|||
:selectionTable="false" |
|||
> |
|||
</currenTable> |
|||
</el-form-item> |
|||
</template> |
|||
</curren-Form> --> |
|||
<div |
|||
v-if="active === step.length - 1 && pageStatus === 'success'" |
|||
class="page4" |
|||
> |
|||
<el-result icon="success" title="成功提示" subTitle="新增成功"> |
|||
<template slot="extra"> |
|||
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint" |
|||
>打印托标签</el-button |
|||
> |
|||
<el-button type="primary" size="medium" @click="xbqFormPrint" |
|||
>打印箱标签</el-button |
|||
> --> |
|||
<el-button |
|||
v-for="item in successHandle" |
|||
:key="item.label" |
|||
:type="item.type" |
|||
size="medium" |
|||
@click="item.click()" |
|||
>{{ item.label }}</el-button |
|||
> |
|||
<el-button type="primary" size="medium" @click="close(1)" |
|||
>退出</el-button |
|||
> |
|||
</template> |
|||
</el-result> |
|||
</div> |
|||
<div |
|||
v-if="active === step.length - 1 && pageStatus === 'error'" |
|||
class="page4" |
|||
> |
|||
<el-result icon="error" title="错误提示" subTitle="新增失败"> |
|||
<template slot="extra"> |
|||
<el-button type="primary" size="medium" @click="close(1)" |
|||
>退出</el-button |
|||
> |
|||
</template> |
|||
</el-result> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</template> |
|||
<script> |
|||
import currenForm from "@/components/currenForm"; |
|||
import currenTable from "@/components/currenTable"; |
|||
import { |
|||
getPageList, |
|||
postCreateWithCondition, |
|||
postCreate, |
|||
} from "@/api/wms-api"; |
|||
export default { |
|||
name: "stepsForm", |
|||
components: { |
|||
currenForm, |
|||
currenTable, |
|||
}, |
|||
watch: { |
|||
active(val) { |
|||
if (val != 0) { |
|||
this.editHandle[0].label = "上一步"; |
|||
} else { |
|||
this.editHandle[0].label = "取消"; |
|||
} |
|||
}, |
|||
}, |
|||
filters: { |
|||
formData(val) { |
|||
let data = JSON.parse(JSON.stringify(val)); |
|||
val.forEach((key, index) => { |
|||
data[index].disabled = "true"; |
|||
delete data[index].focus; |
|||
if (key.type == "autocomplete" || key.type == "import") { |
|||
data[index].type = "input"; |
|||
} |
|||
}); |
|||
return data; |
|||
}, |
|||
formDataDetails(val) { |
|||
let data = JSON.parse(JSON.stringify(val)); |
|||
val.forEach((key, index) => { |
|||
data[index].disabled = "true"; |
|||
delete data[index].focus; |
|||
delete data[index].rules; |
|||
if (key.type == "autocomplete" || key.type == "import") { |
|||
data[index].type = "input"; |
|||
} else if (key.type == "objectAutocomplete") { |
|||
data[index].type = "objectInput"; |
|||
} else if (key.prop == "containerCode") data[index].disabled = "false"; |
|||
}); |
|||
return data; |
|||
}, |
|||
}, |
|||
props: { |
|||
//名称 |
|||
formTitle: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
//是否弹窗 |
|||
displayDialog: { |
|||
type: Object, |
|||
default: () => { |
|||
return { |
|||
newDialog: false, |
|||
}; |
|||
}, |
|||
}, |
|||
//主表提交数据 |
|||
CreateFormData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
//主表显示form |
|||
CreateForm: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
//预览数据 |
|||
// previewFormData: { |
|||
// type: Object, |
|||
// default: () => { |
|||
// return {} |
|||
// } |
|||
// }, |
|||
//检验 |
|||
Rules: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
//下拉选择 |
|||
Options: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
//子表table显示 |
|||
detailsTableColumns: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
//子表提交数据 |
|||
childTableData: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
//成功后的操作 |
|||
successHandle: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
}, |
|||
computed: { |
|||
stepFilters() { |
|||
let stepFilters = []; |
|||
const routeName = this.$route.meta.title; |
|||
this.step.forEach((key) => { |
|||
stepFilters.push(routeName.concat(key)); |
|||
}); |
|||
return stepFilters; |
|||
}, |
|||
// autoAdvanced () { |
|||
// if (this.active == 1) { |
|||
// return this.advancedFilter( |
|||
// 'item-basic', |
|||
// this.pageListItemBasic, |
|||
// 'totalCountItemBasic', |
|||
// 'itemBasicData', |
|||
// this.oldSkipCountItemBasic |
|||
// ) |
|||
// } else if (this.active == 2) { |
|||
// return this.advancedFilter( |
|||
// 'location', |
|||
// this.pageListLocation, |
|||
// 'totalCountLocation', |
|||
// 'locationData', |
|||
// this.oldSkipCountLocation |
|||
// ) |
|||
// } |
|||
// }, |
|||
}, |
|||
data() { |
|||
return { |
|||
active: 0, |
|||
formReveal: 1, |
|||
pageStatus: "", |
|||
filterListParams: [], |
|||
itemBasicData: [], |
|||
isItemBasicData: [], |
|||
previewFormData: [], |
|||
totalCountItemBasic: 0, |
|||
oldSkipCountItemBasic: 1, |
|||
pageListItemBasic: { |
|||
condition: { |
|||
filters: [], |
|||
}, |
|||
Sorting: "", |
|||
SkipCount: 0, |
|||
MaxResultCount: 100, |
|||
}, |
|||
locationData: [], |
|||
isLocationData: [], |
|||
totalCountLocation: 0, |
|||
oldSkipCountLocation: 1, |
|||
pageListLocation: { |
|||
condition: { |
|||
filters: [], |
|||
}, |
|||
Sorting: "", |
|||
SkipCount: 0, |
|||
MaxResultCount: 100, |
|||
}, |
|||
other: { |
|||
otherParam: [], |
|||
}, |
|||
otherForm: [ |
|||
{ |
|||
label: "状态", |
|||
prop: "otherParam", |
|||
type: "checkbox", |
|||
indeterminate:"true", |
|||
checkboxs: "radios", |
|||
}, |
|||
], |
|||
otherFormData: { |
|||
countMethod: 0, |
|||
// type: 0,//盘点类型 |
|||
company: null, |
|||
description: null, |
|||
// beginTime: null, |
|||
// endTime: null, |
|||
planTime: null, |
|||
partCondition: {}, |
|||
locCondition: {}, |
|||
statusList: [], |
|||
worker: null, |
|||
warehouseCode: null, |
|||
remark: null, |
|||
requestType: null, |
|||
}, |
|||
loading: false, |
|||
tableLoading: false, |
|||
session: null, |
|||
// step: ["总体信息", "物品参数", "库位参数", "其他参数", "结果"], |
|||
step: ["总体信息", "库位参数", "其他参数", "结果"], |
|||
editHandle: [ |
|||
{ label: "取消", name: "cancel" }, |
|||
{ label: "下一步", type: "primary", name: "determine" }, |
|||
], |
|||
filterActionOptions:[{ |
|||
value: '==', |
|||
label: '等于' |
|||
}, { |
|||
value: '!=', |
|||
label: '不等于' |
|||
}], |
|||
// 用户筛选暂存(如果筛选是code:value值为数组的格式) |
|||
filterOptionCopyForMutiple:[], |
|||
// 库位筛选,默认去掉的库位代码 |
|||
filterCodeExclude:'INSPECT,HOLD,TRANSFERONTHEWAY', |
|||
}; |
|||
}, |
|||
mounted() { |
|||
this.session = JSON.parse(JSON.stringify(this.CreateFormData)); |
|||
}, |
|||
methods: { |
|||
// 初始化库位筛选列表数据,目的:pda的库位类型不可以选择线边库位 |
|||
initSearchPageTableColums(){ |
|||
// let _list = JSON.parse(JSON.stringify(this.$isTableColumns.Location)); |
|||
let _list = JSON.parse(JSON.stringify(this.$isTableColumns.CountPlanByAddLocation)); |
|||
_list.forEach(item => { |
|||
// 如果是pda类型盘点,库位类型 则使用 locationTypeForPADPlan 枚举(区别为线边库位为不可选) |
|||
// 如果是Excel类型盘点,库位类型 则使用 locationTypeForExcelPlan 枚举(区别为原材料库位为不可选) |
|||
if(item.prop == 'type'){ |
|||
item.filters = this.CreateFormData.requestType == 2 ? 'locationTypeForPADPlan' : 'locationTypeForExcelPlan' |
|||
} |
|||
}); |
|||
return _list |
|||
}, |
|||
//结束退出 |
|||
close(val) { |
|||
this.active = 0; |
|||
const filter ={ |
|||
condition: { |
|||
filters: [], |
|||
}, |
|||
Sorting: "", |
|||
SkipCount: 0, |
|||
MaxResultCount: 100, |
|||
} |
|||
this.pageListItemBasic = JSON.parse(JSON.stringify(filter)) |
|||
this.pageListLocation = JSON.parse(JSON.stringify(filter)) |
|||
const data = JSON.parse(JSON.stringify(this.session)); |
|||
this.itemBasicData = [] |
|||
this.locationData = [] |
|||
this.$emit("close", data, val); |
|||
}, |
|||
//autoComplete主表 |
|||
DataPush(val) { |
|||
this.$emit("DataPush", val); |
|||
}, |
|||
//autoComplete子表 |
|||
detailsDataPush(val) { |
|||
this.$emit("detailsDataPush", val); |
|||
}, |
|||
// 点击筛选按钮 20230704 |
|||
sxBtnClickHandle(data){ |
|||
// 合并code多选,进行回显 20230705更新 |
|||
this.$refs.searchTable.setScreenDataFilters(this.filterOptionCopyForMutiple) |
|||
}, |
|||
//确定筛选 |
|||
advancedFilter(url, list, TotalCount, data, oldSkipCount) { |
|||
return () => { |
|||
list.SkipCount = (oldSkipCount - 1) * list.MaxResultCount; |
|||
this.tableLoading = true; |
|||
// 盘点库存 过滤线边仓数据 20230703更新 |
|||
// 如果是Excel盘点类型(this.CreateFormData.requestType == 1),过滤原材料2 |
|||
// 如果不是Excel盘点类型(this.CreateFormData.requestType != 1),过滤线边仓数据5 |
|||
let type_value = this.CreateFormData.requestType == 1 ? '2' : '5' |
|||
let _filter = { |
|||
action: "!=", |
|||
column: "type", |
|||
logic: "And", |
|||
value: type_value, |
|||
hide:true |
|||
} |
|||
// 库位筛选,默认去掉的库位代码 |
|||
let _filter_code = { |
|||
action: "!=", |
|||
column: "code", |
|||
logic: "And", |
|||
value: this.filterCodeExclude, |
|||
hide: true |
|||
} |
|||
if(this.pageListLocation.condition.filters.length <= 0){ |
|||
this.pageListLocation.condition.filters.push(_filter) |
|||
this.pageListLocation.condition.filters.push(_filter_code) |
|||
} |
|||
// code多选处理 20230705更新 |
|||
this.filterOptionCopyForMutiple = JSON.parse(JSON.stringify(list.condition.filters)) |
|||
let _filters = [] |
|||
// 拆分code多选,回传给接口 |
|||
this.filterOptionCopyForMutiple.forEach((option)=>{ |
|||
if(option.column == 'code'){ |
|||
option.value.split(',').forEach((val,val_index)=>{ |
|||
// 如果是第一位 则是用户选择的条件 否则判断是否为!= (And) 还是 == (Or) |
|||
let _logic = val_index == 0 ? option.logic : (option.action == '!=' ? 'And' : 'Or') |
|||
if((val || val == 0) && val.length > 0){ |
|||
let _item = { |
|||
action: option.action, |
|||
column: option.column, |
|||
logic: _logic, |
|||
value: val, |
|||
} |
|||
_filters.push(_item) |
|||
} |
|||
}) |
|||
}else{ |
|||
_filters.push(option) |
|||
} |
|||
}) |
|||
list.condition.filters = _filters |
|||
getPageList(list, url) |
|||
.then((res) => { |
|||
this[data] = res.items; |
|||
this[TotalCount] = res.totalCount; |
|||
this.tableLoading = false; |
|||
}) |
|||
.catch(() => { |
|||
this.tableLoading = false; |
|||
}); |
|||
}; |
|||
}, |
|||
//选择子表(接收分页组件emit改变每页最大页数) |
|||
AddNewAlterResultCount(val, url, list, TotalCount, data, oldSkipCount) { |
|||
list.MaxResultCount = val; |
|||
const Function = this.advancedFilter( |
|||
url, |
|||
list, |
|||
TotalCount, |
|||
data, |
|||
oldSkipCount |
|||
); |
|||
Function(); |
|||
}, |
|||
//选择子表(接收分页组件emit改变当前页) |
|||
AddNewAlertoldSkipCount(val, url, list, TotalCount, data, oldSkipCount) { |
|||
oldSkipCount = val; |
|||
const Function = this.advancedFilter( |
|||
url, |
|||
list, |
|||
TotalCount, |
|||
data, |
|||
oldSkipCount |
|||
); |
|||
Function(); |
|||
}, |
|||
//打印托标签 |
|||
tuoFormPrint() { |
|||
this.$emit("tuoFormPrint"); |
|||
}, |
|||
//打印箱标签 |
|||
xbqFormPrint() { |
|||
this.$emit("xbqFormPrint"); |
|||
}, |
|||
// //添加封装 |
|||
// addNew (url, list, TotalCount, data, MaxResultItem) { |
|||
// list.SkipCount = 0 |
|||
// list.MaxResultCount = JSON.parse(TotalCount) |
|||
// getPageList(list, url).then((res) => { |
|||
// this[data] = res.items |
|||
// list.MaxResultCount = MaxResultItem |
|||
// }) |
|||
// }, |
|||
//添加明细(上一步) |
|||
addFormData(val) { |
|||
if (val[0] == "cancel") { |
|||
this.active--; |
|||
} else { |
|||
// 物品参数 |
|||
// if (this.active == 1) { |
|||
// const MaxResultItem = JSON.parse( |
|||
// this.pageListItemBasic.MaxResultCount |
|||
// ); |
|||
// // this.addNew('item-basic', this.pageListItemBasic, this.totalCountItemBasic, 'isItemBasicData', MaxResultItem) |
|||
// // this.pageListItemBasic.MaxResultCount = MaxResultItem |
|||
// const Function = this.advancedFilter( |
|||
// "basedata/location", |
|||
// this.pageListLocation, |
|||
// "totalCountLocation", |
|||
// "locationData", |
|||
// this.oldSkipCountLocation |
|||
// ); |
|||
// Function(); |
|||
// this.$nextTick(()=>{ |
|||
// this.active++; |
|||
// }) |
|||
// } |
|||
// 库位参数 |
|||
if (this.active == 1) { |
|||
const MaxResultLocation = JSON.parse( |
|||
this.pageListLocation.MaxResultCount |
|||
); |
|||
// this.addNew('location', this.pageListLocation, this.totalCountLocation, 'isLocationData', MaxResultLocation) |
|||
// this.pageListLocation.MaxResultCount = MaxResultLocation |
|||
this.active++; |
|||
} |
|||
} |
|||
}, |
|||
//拆分 |
|||
splitFormData(val) { |
|||
return new Promise((resolve, reject) => { |
|||
postCreateWithCondition(val, "wms/store/count-plan") |
|||
.then((res) => { |
|||
this.previewFormData = JSON.parse( |
|||
JSON.stringify(this.CreateFormData) |
|||
); |
|||
// delete this.previewFormData.details |
|||
this.$listAssign(this.previewFormData, res); |
|||
this.previewFormData.details = []; |
|||
res.details.forEach((item) => { |
|||
const details = JSON.parse( |
|||
JSON.stringify(...this.childTableData) |
|||
); |
|||
this.$listAssign(details, item); |
|||
this.previewFormData.details.push(details); |
|||
}); |
|||
resolve(); |
|||
}) |
|||
.catch((err) => { |
|||
reject(); |
|||
}); |
|||
}); |
|||
}, |
|||
// 下一步 |
|||
editFormClick(val) { |
|||
// Moment(this.CreateFormData.arriveTime).format() |
|||
if (val[0] == 0) { |
|||
if (this.active == 0) { |
|||
this.close(0); |
|||
} else { |
|||
this.active--; |
|||
} |
|||
} else { |
|||
val[1].validate((valid) => { |
|||
if (valid) { |
|||
// 总体信息 |
|||
if (this.active == 0) { |
|||
this.pageListLocation.condition.filters = [] |
|||
const Function = this.advancedFilter( |
|||
// "basedata/item-basic", |
|||
// this.pageListItemBasic, |
|||
// "totalCountItemBasic", |
|||
// "itemBasicData", |
|||
// this.oldSkipCountItemBasic |
|||
'basedata/location', |
|||
this.pageListLocation, |
|||
'totalCountLocation', |
|||
'locationData', |
|||
this.oldSkipCountLocation |
|||
); |
|||
Function(); |
|||
this.active++; |
|||
} |
|||
// 其他参数 |
|||
else if (this.active == 2) { |
|||
this.$listAssign(this.otherFormData, this.CreateFormData); |
|||
this.otherFormData.partCondition = |
|||
this.pageListItemBasic.condition; |
|||
this.otherFormData.locCondition = this.pageListLocation.condition; |
|||
this.otherFormData.statusList = []; |
|||
let checkboxArray = [] |
|||
this.other.otherParam.forEach(item => { |
|||
if (item == '待检') { |
|||
checkboxArray.push(1) |
|||
} else if (item == '合格') { |
|||
checkboxArray.push(2) |
|||
} else if (item == '不合格') { |
|||
checkboxArray.push(3) |
|||
} else if (item == '隔离') { |
|||
checkboxArray.push(4) |
|||
} else if (item == '破坏') { |
|||
checkboxArray.push(5) |
|||
} else if (item == '冻结') { |
|||
checkboxArray.push(6) |
|||
} |
|||
}) |
|||
// 待检', '合格', '不合格', '隔离', '破坏', '冻结' |
|||
this.otherFormData.statusList = checkboxArray; |
|||
this.otherFormData.vendCondition = { |
|||
filters:[] |
|||
} |
|||
if(this.otherFormData.statusList.length <= 0){ |
|||
this.$warningMsg("请选择状态"); |
|||
return |
|||
} |
|||
this.loading = true; |
|||
// this.otherFormData.requestType = 2 |
|||
this.splitFormData(this.otherFormData).then( |
|||
(resolve) => { |
|||
this.pageStatus = "success"; |
|||
this.active++; |
|||
this.loading = false; |
|||
}, |
|||
(reject) => { |
|||
this.pageStatus = "error"; |
|||
this.active++; |
|||
this.loading = false; |
|||
} |
|||
); |
|||
} |
|||
// else if (this.active == 4) { |
|||
// postCreate(this.previewFormData, 'count-plan').then(res => { |
|||
// this.pageStatus = 'success' |
|||
// this.active++ |
|||
// this.loading = false |
|||
// }).catch(err => { |
|||
// this.pageStatus = 'error' |
|||
// this.active++ |
|||
// this.loading = false |
|||
// }) |
|||
// } |
|||
else { |
|||
this.$errorMsg("请检查表单"); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "./style/index.scss"; |
|||
</style> |
|||
<style lang="scss"> |
|||
#stepsForm{ |
|||
.formButton{ |
|||
text-align: right; |
|||
} |
|||
.searchPageComponents{ |
|||
top: 130px !important; |
|||
} |
|||
.el-dialog__wrapper{ |
|||
height: unset; |
|||
} |
|||
} |
|||
</style> |
@ -1,86 +0,0 @@ |
|||
#stepsForm { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
::v-deep .el-steps { |
|||
padding-bottom: 15px; |
|||
|
|||
.el-step__main { |
|||
.el-step__title { |
|||
line-height: 24px; |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.page1 { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
.page2 { |
|||
flex: 1; |
|||
overflow: hidden; |
|||
position: relative; |
|||
|
|||
::v-deep & >.el-dialog { |
|||
width: 100%; |
|||
height: 100%; |
|||
|
|||
& >.el-dialog__header { |
|||
padding: 0 !important; |
|||
} |
|||
|
|||
& > .el-dialog__body { |
|||
padding-top: 0; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.page3 { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: space-between; |
|||
padding-bottom: 54px; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
|
|||
::v-deep .el-form { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.el-row { |
|||
flex: 1; |
|||
flex-wrap: wrap; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
} |
|||
|
|||
.formTable-box { |
|||
flex: 1; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
|
|||
.el-form-item__content { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
margin: 0 !important; |
|||
} |
|||
} |
|||
} |
|||
::v-deep .formButton { |
|||
position: absolute; |
|||
bottom: 0; |
|||
right: 0; |
|||
z-index: 3; |
|||
} |
|||
} |
|||
} |
@ -1,459 +0,0 @@ |
|||
<template> |
|||
<el-dialog |
|||
:title="formTitle" |
|||
v-loading="loading" |
|||
v-if="displayDialog.newDialog" |
|||
:visible="true" |
|||
:fullscreen="true" |
|||
:append-to-body="false" |
|||
:modal="false" |
|||
:modal-append-to-body="false" |
|||
:show-close="false" |
|||
> |
|||
<div id="stepsForm"> |
|||
<el-steps |
|||
:active="active" |
|||
process-status="finish" |
|||
finish-status="success" |
|||
:align-center="true" |
|||
> |
|||
<el-step |
|||
v-for="(item, index) in stepFilters" |
|||
:key="index" |
|||
:title="item" |
|||
></el-step> |
|||
</el-steps> |
|||
<curren-Form |
|||
v-if="active == 0" |
|||
class="page1" |
|||
size="medium" |
|||
ref="page1" |
|||
:searchData="CreateFormData" |
|||
:searchForm="CreateForm" |
|||
:searchOptions="Options" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
@changeInput="changeInput" |
|||
@changeSelect="changeSelect" |
|||
@push="DataPush(arguments)" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
</curren-Form> |
|||
<curren-Form |
|||
v-if="active === 1" |
|||
class="page2" |
|||
size="medium" |
|||
:searchData="CreateFormData" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
<template> |
|||
<el-form-item class="formTable-box" prop="details" v-if="active == 1"> |
|||
<div class="heder" v-if="addClick"> |
|||
<span @click="openAddNew">添加一行</span> |
|||
</div> |
|||
<currenTable |
|||
:tableData="CreateFormData.details" |
|||
:searchOptions="Options" |
|||
:tableColumns="detailsTableColumns" |
|||
:selectionTable="false" |
|||
@push="detailsDataPush(arguments)" |
|||
> |
|||
<template v-if="showDeleteButton"> |
|||
<el-table-column |
|||
label="操作" |
|||
align="center" |
|||
fixed="right" |
|||
width="100px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div class="childTable" @click="childTable($event, scope)"> |
|||
<span>删除</span> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</template> |
|||
</currenTable> |
|||
</el-form-item> |
|||
</template> |
|||
</curren-Form> |
|||
<curren-Form |
|||
v-if="active === 2" |
|||
size="medium" |
|||
class="page3" |
|||
:searchData="previewFormData" |
|||
:searchForm="CreateForm | formData" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
<template> |
|||
<el-form-item class="formTable-box" prop="details"> |
|||
<currenTable |
|||
:tableData="previewFormData.details" |
|||
:tableColumns="detailsTableColumns | formDataDetails" |
|||
:selectionTable="false" |
|||
> |
|||
</currenTable> |
|||
</el-form-item> |
|||
</template> |
|||
</curren-Form> |
|||
<div |
|||
v-if="active === step.length - 1 && pageStatus === 'success'" |
|||
class="page4" |
|||
> |
|||
<el-result |
|||
icon="success" |
|||
title="成功提示" |
|||
:subTitle="formTitle + '成功'" |
|||
> |
|||
<template slot="extra"> |
|||
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint" |
|||
>打印托标签</el-button |
|||
> |
|||
<el-button type="primary" size="medium" @click="xbqFormPrint" |
|||
>打印箱标签</el-button |
|||
> --> |
|||
<el-button |
|||
v-for="item in successHandle" |
|||
:key="item.label" |
|||
:type="item.type" |
|||
size="medium" |
|||
@click="successClick(item.click())" |
|||
>{{ item.label }}</el-button |
|||
> |
|||
<el-button type="primary" size="medium" @click="close(1)" |
|||
>退出</el-button |
|||
> |
|||
</template> |
|||
</el-result> |
|||
</div> |
|||
<div |
|||
v-if="active === step.length - 1 && pageStatus === 'error'" |
|||
class="page4" |
|||
> |
|||
<el-result icon="error" title="错误提示" :subTitle="formTitle + '失败'"> |
|||
<template slot="extra"> |
|||
<el-button type="primary" size="medium" @click="close(1)" |
|||
>退出</el-button |
|||
> |
|||
</template> |
|||
</el-result> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</template> |
|||
<script> |
|||
import currenForm from "@/components/currenForm" |
|||
import currenTable from "@/components/currenTable" |
|||
export default { |
|||
name: 'stepsForm', |
|||
components: { |
|||
currenForm, |
|||
currenTable |
|||
}, |
|||
watch: { |
|||
active (val) { |
|||
if (val != 0) { |
|||
this.editHandle[0].label = '上一步' |
|||
} else { |
|||
this.editHandle[0].label = '取消' |
|||
} |
|||
}, |
|||
stepArray(newVal, oldVal){ |
|||
this.step = newVal |
|||
} |
|||
}, |
|||
filters: { |
|||
formData (val) { |
|||
let data = JSON.parse(JSON.stringify(val)) |
|||
val.forEach((key, index) => { |
|||
data[index].disabled = "true" |
|||
delete data[index].focus |
|||
if (key.type == "autocomplete" || key.type == "import") { |
|||
data[index].type = "input" |
|||
} |
|||
}); |
|||
return data |
|||
}, |
|||
formDataDetails (val) { |
|||
let data = JSON.parse(JSON.stringify(val)) |
|||
val.forEach((key, index) => { |
|||
data[index].disabled = true |
|||
delete data[index].focus |
|||
delete data[index].rules |
|||
if (key.type == "autocomplete" || key.type == "import") { |
|||
delete data[index].type |
|||
} else if (key.type == "objectAutocomplete") { |
|||
data[index].type = "object" |
|||
} else if (key.prop == "containerCode" && key.type == "input") { |
|||
data[index].disabled = false |
|||
} else if (key.isChange) { |
|||
// 针对第三步预览特殊情况处理 |
|||
data[index].disabled = false |
|||
} |
|||
}); |
|||
return data |
|||
} |
|||
}, |
|||
props: { |
|||
//名称 |
|||
formTitle: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
//是否弹窗 |
|||
displayDialog: { |
|||
type: Object, |
|||
default: () => { |
|||
return { |
|||
newDialog: false |
|||
} |
|||
} |
|||
}, |
|||
//主表提交数据 |
|||
CreateFormData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//主表显示form |
|||
CreateForm: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//预览数据 |
|||
previewFormData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//检验 |
|||
Rules: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//下拉选择 |
|||
Options: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//子表table显示 |
|||
detailsTableColumns: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//子表提交数据 |
|||
childTableData: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//成功后的操作 |
|||
successHandle: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//步骤标题 |
|||
stepArray: { |
|||
type: Array, |
|||
default: () => { |
|||
return ["总体信息", "明细", "预览", "结果"] |
|||
} |
|||
}, |
|||
//添加一行 |
|||
addClickButton: { |
|||
type: Boolean, |
|||
default: () => { |
|||
return true |
|||
} |
|||
}, |
|||
//删除行记录 |
|||
isShowDeleteButton: { |
|||
type: Boolean, |
|||
default: () => { |
|||
return true |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
stepFilters () { |
|||
let stepFilters = [] |
|||
const routeName = this.$route.meta.title |
|||
this.step.forEach(key => { |
|||
stepFilters.push(routeName.concat(key)) |
|||
}) |
|||
return stepFilters |
|||
}, |
|||
}, |
|||
data () { |
|||
return { |
|||
active: 0, |
|||
formReveal: 1, |
|||
activeStep: 1, |
|||
pageStatus: '', |
|||
addClick: this.addClickButton, |
|||
showDeleteButton: this.isShowDeleteButton, |
|||
loading: false, |
|||
session: null, |
|||
step: this.stepArray, |
|||
editHandle: [ |
|||
{ label: "取消", name: "cancel" }, |
|||
{ label: "下一步", type: "primary", name: "determine" }, |
|||
], |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.session = JSON.parse(JSON.stringify(this.CreateFormData)) |
|||
}, |
|||
methods: { |
|||
//结束退出 |
|||
close (val) { |
|||
this.active = 0 |
|||
// const pageRef = this.Refs[1] |
|||
const data = JSON.parse(JSON.stringify(this.session)) |
|||
this.$emit('close', data, val) |
|||
}, |
|||
//autoComplete主表 |
|||
DataPush (val) { |
|||
this.$emit("DataPush", val) |
|||
}, |
|||
//autoComplete子表 |
|||
detailsDataPush (val) { |
|||
this.$emit("detailsDataPush", val) |
|||
}, |
|||
// //打印托标签 |
|||
// tuoFormPrint () { |
|||
// this.$emit('tuoFormPrint') |
|||
// }, |
|||
// //打印箱标签 |
|||
// xbqFormPrint () { |
|||
// this.$emit('xbqFormPrint') |
|||
// }, |
|||
successClick (val) { |
|||
this.loading = true |
|||
val.then(res => { |
|||
this.loading = false |
|||
}, reason => { |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
editFormClick (val) { |
|||
// Moment(this.CreateFormData.arriveTime).format() |
|||
if (val[0] == 0) { |
|||
if (this.active == 0) { |
|||
// debugger |
|||
// this.active = '' |
|||
this.close(0) |
|||
} else { |
|||
if (this.active == 2) { |
|||
this.active = this.active - this.activeStep |
|||
} else { |
|||
this.active-- |
|||
} |
|||
} |
|||
} else { |
|||
val[1].validate((valid) => { |
|||
if (valid) { |
|||
const parent = this.$parent |
|||
if (this.active < this.step.length - 1) { |
|||
this.loading = true |
|||
if (this.active == this.step.length - 2) { |
|||
parent.stepsSubmit().then(res => { |
|||
if (res == '质检校验返回') { |
|||
this.loading = false |
|||
} else { |
|||
this.pageStatus = 'success' |
|||
this.active++ |
|||
this.loading = false |
|||
} |
|||
}, reason => { |
|||
this.pageStatus = 'error' |
|||
this.active++ |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
} else if (this.active == this.step.length - 3) { |
|||
parent.PalletlFunction().then(res => { |
|||
// 针对特殊环境 跳过步骤 直接到最后完成 |
|||
if (res == '质检任务跳过详情') { |
|||
parent.stepsSubmit().then(res => { |
|||
this.pageStatus = 'success' |
|||
this.active = this.active + 2 |
|||
this.loading = false |
|||
}, reason => { |
|||
this.pageStatus = 'error' |
|||
this.active = this.active + 2 |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
} else { |
|||
this.active++ |
|||
} |
|||
this.loading = false |
|||
}, reason => { |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
} else { |
|||
parent.stepsHandelOne().then(res => { |
|||
if (res) { |
|||
this.addClick = res.open |
|||
this.active = this.active + res.index |
|||
this.activeStep = res.index |
|||
} else { |
|||
this.activeStep = 1 |
|||
this.active++ |
|||
} |
|||
this.loading = false |
|||
}, reason => { |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
} |
|||
} |
|||
} else { |
|||
this.$errorMsg('请检查表单') |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
//添加子表 |
|||
openAddNew () { |
|||
const parent = this.$parent |
|||
parent.openAddNew() |
|||
}, |
|||
childTable (e, val) { |
|||
const parent = this.$parent |
|||
parent.childTable(e, val) |
|||
}, |
|||
changeInput(prop,val){ |
|||
this.$emit("changeInput", prop, val) |
|||
}, |
|||
changeSelect(prop,val){ |
|||
this.$emit("changeSelect", prop, val) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "./style/index.scss"; |
|||
</style> |
@ -1,551 +0,0 @@ |
|||
<template> |
|||
<el-dialog |
|||
:title="formTitle" |
|||
v-loading="loading" |
|||
v-if="displayDialog.newDialog" |
|||
:visible="true" |
|||
:fullscreen="true" |
|||
:append-to-body="false" |
|||
:modal="false" |
|||
:modal-append-to-body="false" |
|||
:show-close="false" |
|||
> |
|||
<div id="stepsForm"> |
|||
<el-steps |
|||
:active="active" |
|||
process-status="finish" |
|||
finish-status="success" |
|||
:align-center="true" |
|||
> |
|||
<el-step |
|||
v-for="(item, index) in stepFilters" |
|||
:key="index" |
|||
:title="item" |
|||
></el-step> |
|||
</el-steps> |
|||
<curren-Form |
|||
v-if="active == 0" |
|||
class="page1" |
|||
size="medium" |
|||
ref="page1" |
|||
:searchData="CreateFormData" |
|||
:searchForm="CreateForm" |
|||
:searchOptions="Options" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
@changeInput="changeInput" |
|||
@changeSelect="changeSelect" |
|||
@push="DataPush(arguments)" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
</curren-Form> |
|||
<curren-Form |
|||
v-if="active === 1" |
|||
class="page2" |
|||
size="medium" |
|||
:searchData="CreateFormData" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
<template> |
|||
<el-form-item class="formTable-box" prop="details" v-if="active == 1"> |
|||
<div class="heder"> |
|||
<el-button |
|||
v-if="addClick" |
|||
type="primary" |
|||
@click="openAddNew" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
>添加一行</el-button> |
|||
|
|||
<el-button |
|||
v-if="importFormButton" |
|||
type="success" |
|||
icon="el-icon-download" |
|||
@click="openImportForm" |
|||
size="mini" |
|||
>导入</el-button> |
|||
</div> |
|||
<currenTable |
|||
:tableData="CreateFormData.details" |
|||
:searchOptions="Options" |
|||
:tableColumns="detailsTableColumns" |
|||
:selectionTable="false" |
|||
@push="detailsDataPush(arguments)" |
|||
> |
|||
<template v-if="showDeleteButton"> |
|||
<el-table-column |
|||
label="操作" |
|||
align="center" |
|||
fixed="right" |
|||
width="100px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div class="childTable" @click="childTable($event, scope)"> |
|||
<span>删除</span> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</template> |
|||
</currenTable> |
|||
</el-form-item> |
|||
</template> |
|||
</curren-Form> |
|||
<curren-Form |
|||
v-if="active === 2" |
|||
size="medium" |
|||
class="page3" |
|||
:searchData="previewFormData" |
|||
:searchForm="CreateForm | formData" |
|||
:searchHandle="editHandle" |
|||
:rules="Rules" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
<template> |
|||
<el-form-item class="formTable-box" prop="details"> |
|||
<currenTable |
|||
:tableData="previewFormData.details" |
|||
:tableColumns="detailsTableColumns | formDataDetails" |
|||
:selectionTable="false" |
|||
> |
|||
<template v-if="showPreviewFormDeleteButton"> |
|||
<el-table-column |
|||
label="操作" |
|||
align="center" |
|||
fixed="right" |
|||
width="100px" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<div @click="previewChildRemove($event, scope)"> |
|||
<span style="color:red">删除</span> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</template> |
|||
</currenTable> |
|||
</el-form-item> |
|||
</template> |
|||
</curren-Form> |
|||
<div |
|||
v-if="active === step.length - 1 && pageStatus === 'success'" |
|||
class="page4" |
|||
> |
|||
<el-result |
|||
icon="success" |
|||
title="成功提示" |
|||
:subTitle="formTitle + '成功'" |
|||
> |
|||
<template slot="extra"> |
|||
<!-- <el-button type="primary" size="medium" @click="tuoFormPrint" |
|||
>打印托标签</el-button |
|||
> |
|||
<el-button type="primary" size="medium" @click="xbqFormPrint" |
|||
>打印箱标签</el-button |
|||
> --> |
|||
<el-button |
|||
v-for="item in successHandle" |
|||
:key="item.label" |
|||
:type="item.type" |
|||
size="medium" |
|||
@click="successClick(item.click())" |
|||
>{{ item.label }}</el-button |
|||
> |
|||
<el-button type="primary" size="medium" @click="close(1)" |
|||
>退出</el-button |
|||
> |
|||
</template> |
|||
</el-result> |
|||
</div> |
|||
<div |
|||
v-if="active === step.length - 1 && pageStatus === 'error'" |
|||
class="page4" |
|||
> |
|||
<el-result icon="error" title="错误提示" :subTitle="formTitle + '失败'"> |
|||
<template slot="extra"> |
|||
<el-button type="primary" size="medium" @click="close(1)" |
|||
>退出</el-button |
|||
> |
|||
</template> |
|||
</el-result> |
|||
</div> |
|||
</div> |
|||
</el-dialog> |
|||
</template> |
|||
<script> |
|||
import currenForm from "@/components/currenForm" |
|||
import currenTable from "@/components/currenTable" |
|||
export default { |
|||
name: 'stepsForm', |
|||
components: { |
|||
currenForm, |
|||
currenTable |
|||
}, |
|||
watch: { |
|||
active (val) { |
|||
if (val != 0) { |
|||
this.editHandle=[ |
|||
{ label: "上一步", name: "cancel" }, |
|||
{ label: "下一步", type: "primary", name: "determine" }, |
|||
]; |
|||
} else { |
|||
if(this.hideFirstActiveCancel){ |
|||
this.editHandle=[ |
|||
{ label: "下一步", type: "primary", name: "determine" }, |
|||
]; |
|||
}else{ |
|||
this.editHandle=[ |
|||
{ label: "取消", name: "cancel" }, |
|||
{ label: "下一步", type: "primary", name: "determine" }, |
|||
]; |
|||
} |
|||
} |
|||
}, |
|||
stepArray(newVal, oldVal){ |
|||
this.step = newVal |
|||
} |
|||
}, |
|||
filters: { |
|||
formData (val) { |
|||
let data = JSON.parse(JSON.stringify(val)) |
|||
val.forEach((key, index) => { |
|||
data[index].disabled = "true" |
|||
delete data[index].focus |
|||
if (key.type == "autocomplete" || key.type == "import") { |
|||
data[index].type = "input" |
|||
} |
|||
}); |
|||
return data |
|||
}, |
|||
formDataDetails (val) { |
|||
let data = JSON.parse(JSON.stringify(val)) |
|||
val.forEach((key, index) => { |
|||
data[index].disabled = true |
|||
delete data[index].focus |
|||
delete data[index].rules |
|||
if (key.type == "autocomplete" || key.type == "import") { |
|||
delete data[index].type |
|||
} else if (key.type == "objectAutocomplete") { |
|||
data[index].type = "object" |
|||
} else if (key.prop == "containerCode" && key.type == "input") { |
|||
data[index].disabled = false |
|||
} else if (key.isChange) { |
|||
// 针对第三步预览特殊情况处理 |
|||
data[index].disabled = false |
|||
} |
|||
}); |
|||
return data |
|||
} |
|||
}, |
|||
props: { |
|||
//名称 |
|||
formTitle: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
//是否弹窗 |
|||
displayDialog: { |
|||
type: Object, |
|||
default: () => { |
|||
return { |
|||
newDialog: false |
|||
} |
|||
} |
|||
}, |
|||
//主表提交数据 |
|||
CreateFormData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//主表显示form |
|||
CreateForm: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//预览数据 |
|||
previewFormData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//检验 |
|||
Rules: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//下拉选择 |
|||
Options: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//子表table显示 |
|||
detailsTableColumns: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//子表提交数据 |
|||
childTableData: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//成功后的操作 |
|||
successHandle: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//步骤标题 |
|||
stepArray: { |
|||
type: Array, |
|||
default: () => { |
|||
return ["总体信息", "明细", "预览", "结果"] |
|||
} |
|||
}, |
|||
//添加一行 |
|||
addClickButton: { |
|||
type: Boolean, |
|||
default: () => { |
|||
return true |
|||
} |
|||
}, |
|||
//导入按钮 |
|||
importFormButton: { |
|||
type: Boolean, |
|||
default: () => { |
|||
return false |
|||
} |
|||
}, |
|||
//删除行记录 |
|||
isShowDeleteButton: { |
|||
type: Boolean, |
|||
default: () => { |
|||
return true |
|||
} |
|||
}, |
|||
// 隐藏第一步骤的取消按钮 |
|||
isHideFirstActiveCancel:{ |
|||
type: Boolean, |
|||
default: () => { |
|||
return false |
|||
} |
|||
}, |
|||
// 预览视图显示删除按钮 |
|||
showPreviewFormDeleteButton:{ |
|||
type: Boolean, |
|||
default: () => { |
|||
return false |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
stepFilters () { |
|||
let stepFilters = [] |
|||
const routeName = this.$route.meta.title |
|||
this.step.forEach(key => { |
|||
stepFilters.push(routeName.concat(key)) |
|||
}) |
|||
return stepFilters |
|||
}, |
|||
}, |
|||
data () { |
|||
return { |
|||
active: 0, |
|||
formReveal: 1, |
|||
activeStep: 1, |
|||
pageStatus: '', |
|||
addClick: this.addClickButton,//添加一行按钮 |
|||
importForm:this.importFormButton,//导入按钮 |
|||
showDeleteButton: this.isShowDeleteButton,//操作-删除按钮 |
|||
hideFirstActiveCancel:this.isHideFirstActiveCancel,// 隐藏第一步骤的取消按钮 |
|||
loading: false, |
|||
session: null, |
|||
step: this.stepArray, |
|||
editHandle: [ |
|||
{ label: "取消", name: "cancel" }, |
|||
{ label: "下一步", type: "primary", name: "determine" }, |
|||
], |
|||
} |
|||
}, |
|||
mounted () { |
|||
this.session = JSON.parse(JSON.stringify(this.CreateFormData)) |
|||
if(this.hideFirstActiveCancel){ |
|||
this.editHandle=[ |
|||
{ label: "下一步", type: "primary", name: "determine" }, |
|||
]; |
|||
} |
|||
}, |
|||
methods: { |
|||
//结束退出 |
|||
close (val) { |
|||
this.active = 0 |
|||
// const pageRef = this.Refs[1] |
|||
const data = JSON.parse(JSON.stringify(this.session)) |
|||
this.$emit('close', data, val) |
|||
}, |
|||
//autoComplete主表 |
|||
DataPush (val) { |
|||
this.$emit("DataPush", val) |
|||
}, |
|||
//autoComplete子表 |
|||
detailsDataPush (val) { |
|||
this.$emit("detailsDataPush", val) |
|||
}, |
|||
// //打印托标签 |
|||
// tuoFormPrint () { |
|||
// this.$emit('tuoFormPrint') |
|||
// }, |
|||
// //打印箱标签 |
|||
// xbqFormPrint () { |
|||
// this.$emit('xbqFormPrint') |
|||
// }, |
|||
successClick (val) { |
|||
this.loading = true |
|||
val.then(res => { |
|||
this.loading = false |
|||
}, reason => { |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
}, |
|||
editFormClick (val) { |
|||
// Moment(this.CreateFormData.arriveTime).format() |
|||
// if (val[0] == 0) { |
|||
if (val[2].name == "cancel") { |
|||
if (this.active == 0) { |
|||
// debugger |
|||
// this.active = '' |
|||
this.close(0) |
|||
} else { |
|||
if (this.active == 2) { |
|||
this.active = this.active - this.activeStep |
|||
} else { |
|||
this.active-- |
|||
} |
|||
} |
|||
} else { |
|||
val[1].validate((valid) => { |
|||
if (valid) { |
|||
const parent = this.$parent |
|||
if (this.active < this.step.length - 1) { |
|||
this.loading = true |
|||
if (this.active == this.step.length - 2) { |
|||
parent.stepsSubmit().then(res => { |
|||
if (res == '质检校验返回') { |
|||
this.loading = false |
|||
} else { |
|||
this.pageStatus = 'success' |
|||
this.active++ |
|||
this.loading = false |
|||
} |
|||
}, reason => { |
|||
this.loading = false |
|||
if(reason=="return")return |
|||
this.pageStatus = 'error' |
|||
this.active++ |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
} else if (this.active == this.step.length - 3) { |
|||
parent.PalletlFunction().then(res => { |
|||
// 针对特殊环境 跳过步骤 直接到最后完成 |
|||
if (res == '质检任务跳过详情') { |
|||
parent.stepsSubmit().then(res => { |
|||
this.pageStatus = 'success' |
|||
this.active = this.active + 2 |
|||
this.loading = false |
|||
}, reason => { |
|||
this.pageStatus = 'error' |
|||
this.active = this.active + 2 |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
} else { |
|||
this.active++ |
|||
} |
|||
this.loading = false |
|||
}, reason => { |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
} else { |
|||
parent.stepsHandelOne().then(res => { |
|||
if (res) { |
|||
this.addClick = res.open |
|||
this.active = this.active + res.index |
|||
this.activeStep = res.index |
|||
} else { |
|||
this.activeStep = 1 |
|||
this.active++ |
|||
} |
|||
this.loading = false |
|||
}, reason => { |
|||
this.loading = false |
|||
}).catch(err=>{ |
|||
this.loading = false |
|||
}) |
|||
} |
|||
} |
|||
} else { |
|||
this.$errorMsg('请检查表单') |
|||
} |
|||
}) |
|||
} |
|||
}, |
|||
//添加子表 |
|||
openAddNew () { |
|||
const parent = this.$parent |
|||
parent.openAddNew() |
|||
}, |
|||
// 导入 |
|||
openImportForm(){ |
|||
const parent = this.$parent |
|||
parent.openImportFormHandle() |
|||
// this.displayDialog.importDialog = true |
|||
}, |
|||
childTable (e, val) { |
|||
const parent = this.$parent |
|||
parent.childTable(e, val) |
|||
}, |
|||
changeInput(prop,val){ |
|||
this.$emit("changeInput", prop, val) |
|||
}, |
|||
changeSelect(prop,val){ |
|||
this.$emit("changeSelect", prop, val) |
|||
}, |
|||
//预览步骤删除操作(第三步) |
|||
previewChildRemove(e, val) { |
|||
this.$confirm('您确定删除吗, 是否继续?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.previewFormData.details.splice(val.$index, 1) |
|||
// this.$emit("removePreviewFormRow",this.previewFormData) |
|||
}).catch(() => { |
|||
|
|||
}); |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "./style/index.scss"; |
|||
</style> |
@ -1,134 +0,0 @@ |
|||
#stepsForm { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
::v-deep .el-steps { |
|||
padding-bottom: 15px; |
|||
|
|||
.el-step__main { |
|||
.el-step__title { |
|||
line-height: 24px; |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.page1 { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: space-between; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
} |
|||
|
|||
.page2 { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: space-between; |
|||
padding-bottom: 54px; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
|
|||
::v-deep .el-form { |
|||
flex: 1; |
|||
display: flex; |
|||
.el-row { |
|||
display: none; |
|||
} |
|||
|
|||
.formTable-box { |
|||
flex: 1; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
|
|||
.el-form-item__content { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
margin: 0 !important; |
|||
|
|||
.heder { |
|||
padding: 5px 0; |
|||
text-align: center; |
|||
font-size: 18px; |
|||
|
|||
button{ |
|||
margin: 0 10px; |
|||
} |
|||
} |
|||
|
|||
.el-table { |
|||
flex: 1; |
|||
|
|||
.childTable { |
|||
display: flex; |
|||
justify-content: space-around; |
|||
|
|||
span { |
|||
cursor: pointer; |
|||
|
|||
&:nth-child(1) { |
|||
color: red; |
|||
} |
|||
|
|||
&:nth-child(2) { |
|||
color: green; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
::v-deep .formButton { |
|||
position: absolute; |
|||
bottom: 0; |
|||
right: 0; |
|||
z-index: 3; |
|||
} |
|||
} |
|||
|
|||
.page3 { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
padding-bottom: 54px; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
|
|||
::v-deep .el-form { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.el-row { |
|||
flex: 1; |
|||
flex-wrap: wrap; |
|||
} |
|||
|
|||
.formTable-box { |
|||
flex: 1; |
|||
|
|||
.el-form-item__content { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
margin: 0 !important; |
|||
} |
|||
} |
|||
} |
|||
::v-deep .formButton { |
|||
position: absolute; |
|||
bottom: 0; |
|||
right: 0; |
|||
z-index: 3; |
|||
} |
|||
} |
|||
} |
@ -1,559 +0,0 @@ |
|||
<template> |
|||
<el-drawer |
|||
v-loading="DrawerLoading" |
|||
v-if="drawer" |
|||
:visible="true" |
|||
:close-on-press-escape="false" |
|||
:wrapperClosable="false" |
|||
:with-header="false" |
|||
:modal="false" |
|||
size="100%" |
|||
> |
|||
<div class="drawer-heder"> |
|||
<div class="heder-left"> |
|||
<!-- <div class="heder-img"> |
|||
<img |
|||
src="@/assets/img/drawerHeader.png" |
|||
alt="" |
|||
style="width: 100%; height: 100%" |
|||
/> |
|||
</div> --> |
|||
<div class="header-text"> |
|||
<span>{{ propsData[title[0].prop] }}</span> |
|||
<span>{{ title[0].label }}</span> |
|||
</div> |
|||
</div> |
|||
<div class="heder-right"> |
|||
<curren-Button |
|||
:Butttondata="Butttondata" |
|||
@tableButtonClick="tableButtonClick" |
|||
> |
|||
<template> |
|||
<el-dropdown |
|||
trigger="click" |
|||
@command="handleCommand" |
|||
v-if="JSON.stringify(dropdownData) != '{}'" |
|||
> |
|||
<el-button size="mini" icon="el-icon-more"></el-button> |
|||
<el-dropdown-menu slot="dropdown"> |
|||
<el-dropdown-item |
|||
v-for="(item, index) in dropdownData" |
|||
:key="index" |
|||
:command="item.command" |
|||
>{{ item.label }}</el-dropdown-item |
|||
> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
</template> |
|||
</curren-Button> |
|||
</div> |
|||
</div> |
|||
<div class="drawer-main"> |
|||
<curren-tabs |
|||
:tabsData="dropdownTabs" |
|||
:activeName="firstTabs" |
|||
type="border-card" |
|||
@handleClick="handleClick" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<curren-descriptions |
|||
border |
|||
v-if="scope.value == 'xq'" |
|||
:column="column" |
|||
:direction="direction" |
|||
:colon="false" |
|||
:tabsDesTions="tabsDesTions" |
|||
:propsData="propsData" |
|||
> |
|||
</curren-descriptions> |
|||
<!-- currenTableDetails 组件 明细中带分页功能 --> |
|||
<umyTable |
|||
v-if="scope.value == 'mx'" |
|||
:tableBorder="true" |
|||
:tableData="propsData.details" |
|||
:propsData="propsData" |
|||
:tableColumns="tableColumns" |
|||
:selectionTable="selectionTable" |
|||
:requiredRules="false" |
|||
:setUTableHeight="260" |
|||
@sortChange="sortChange" |
|||
@handleSelectionChange="handleSelectionChange" |
|||
@inlineDialog="inlineDialog" |
|||
@buttonClick="buttonClick" |
|||
> |
|||
<template> |
|||
<slot></slot> |
|||
</template> |
|||
</umyTable> |
|||
<!-- 明细页码 --> |
|||
<pagination |
|||
v-if="scope.value == 'mx'" |
|||
:totalCount="totalCount" |
|||
:pagesizeProps="MaxResultCount" |
|||
@SizeChange="alterResultCountDetails" |
|||
@CurrentChange="alertoldSkipCountDetails" |
|||
:currentPageProps="currentPage" |
|||
></pagination> |
|||
<!-- 新增汇总 表头 区分明细表头使用 summaryTableColumns --> |
|||
<umyTable |
|||
v-if="scope.value == 'hz'" |
|||
:tableBorder="true" |
|||
:tableData="propsData.summaryDetails" |
|||
:tableColumns="summaryTableColumns.length == 0 ? tableColumns : summaryTableColumns" |
|||
:selectionTable="selectionTable" |
|||
:requiredRules="false" |
|||
@sortChange="sortChange" |
|||
@handleSelectionChange="handleSelectionChange" |
|||
@inlineDialog="inlineDialog" |
|||
@buttonClick="buttonClick" |
|||
:setUTableHeight="210" |
|||
> |
|||
<template> |
|||
<slot></slot> |
|||
</template> |
|||
</umyTable> |
|||
<!-- 自定义扩展 --> |
|||
<umyTable |
|||
v-if=" |
|||
scope.value == zdyValue && |
|||
scope.value != 'xq' && |
|||
scope.value != 'mx' && |
|||
scope.value != 'hz' && |
|||
scope.value != 'zwlcj' |
|||
" |
|||
:tableBorder="true" |
|||
:tableLoading="tableLoading" |
|||
:tableData="otherData" |
|||
:tableColumns="zdyTableColumns" |
|||
:selectionTable="selectionTable" |
|||
:requiredRules="false" |
|||
@sortChange="sortChange" |
|||
@handleSelectionChange="handleSelectionChange" |
|||
@inlineDialog="inlineDialog" |
|||
@buttonClick="buttonClick" |
|||
:setUTableHeight="210" |
|||
> |
|||
<template> |
|||
<slot></slot> |
|||
</template> |
|||
</umyTable> |
|||
<!-- 自定义扩展(tree)的形式 目前使用位置:物品清单信息-子物品层级 todo:待优化--> |
|||
<currenTable |
|||
v-if=" |
|||
scope.value == zdyValue && |
|||
scope.value == 'zwlcj' |
|||
" |
|||
:tableLoading="tableLoading" |
|||
:tableData="otherData" |
|||
:tableColumns="zdyTableColumns" |
|||
:selectionTable="selectionTable" |
|||
:requiredRules="false" |
|||
@sortChange="sortChange" |
|||
@handleSelectionChange="handleSelectionChange" |
|||
@inlineDialog="inlineDialog" |
|||
:treeProps="{children: 'children', hasChildren: 'hasChildren'}" |
|||
@buttonClick="buttonClick" |
|||
> |
|||
<template> |
|||
<slot></slot> |
|||
</template> |
|||
</currenTable> |
|||
</template> |
|||
</curren-tabs> |
|||
</div> |
|||
<div class="drawer-Shut" @click="drawerShut"> |
|||
<el-button type="danger" size="mini">关闭</el-button> |
|||
</div> |
|||
</el-drawer> |
|||
</template> |
|||
<script> |
|||
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode, |
|||
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect |
|||
} from "@/api/wms-api" |
|||
import currenButton from "@/components/currenButton" |
|||
import currenDescriptions from "@/components/currenDescriptions" |
|||
import currenTabs from "@/components/currenTabs" |
|||
import currenTable from "@/components/currenTable" |
|||
import pagination from "@/components/Pagination" |
|||
export default { |
|||
name: 'currenTabel-drawer', |
|||
components: { |
|||
pagination, |
|||
currenButton, |
|||
currenDescriptions, |
|||
currenTabs, |
|||
currenTable, |
|||
}, |
|||
props: { |
|||
title: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
DrawerLoading: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
drawer: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
dropdownData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
propsData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
tabsDesTions: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
dropdownTabsData: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
tableLoading: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
tableColumns: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
summaryTableColumns: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
Butttondata: { |
|||
type: Array, |
|||
default: () => { |
|||
return [{ |
|||
type: 'warning', |
|||
icon: 'el-icon-edit', |
|||
label: '编辑', |
|||
name: 'edit', |
|||
size: 'mini' |
|||
}] |
|||
} |
|||
}, |
|||
selectionTable: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
MaxResultCount: { |
|||
type: Number, |
|||
default: 0 |
|||
}, |
|||
totalCount: { |
|||
type: Number, |
|||
default: 0 |
|||
}, |
|||
currentPage: { |
|||
type: Number, |
|||
default: 0 |
|||
}, |
|||
// 详情展现列数,默认为2列展现 |
|||
column: { |
|||
type: Number, |
|||
default: 2 |
|||
}, |
|||
// 详情展示方式,默认水平分布 |
|||
direction: { |
|||
type: String, |
|||
default: 'horizontal' |
|||
}, |
|||
// 详情tabs排序默认 |
|||
firstTabs: { |
|||
type: String, |
|||
default: 'xq' |
|||
} |
|||
|
|||
}, |
|||
computed: { |
|||
dropdownTabs () { |
|||
// 带有特殊扩展tabs页的 |
|||
if (this.dropdownTabsData.length !== 0) { |
|||
return this.dropdownTabsData |
|||
} else { |
|||
// 正常普通 详情,明细,汇总 |
|||
if (Object.keys(this.propsData).length != 0) { |
|||
this.initDropdownTabsData = [{ |
|||
label: "详情", |
|||
name: 'xq' |
|||
}, |
|||
{ |
|||
label: "明细", |
|||
name: 'mx' |
|||
}, |
|||
{ |
|||
label: "汇总", |
|||
name: 'hz' |
|||
}] |
|||
if (this.propsData.details == undefined || !this.propsData.details.length) { |
|||
this.initDropdownTabsData = [{ |
|||
label: "详情", |
|||
name: 'xq' |
|||
}] |
|||
return this.initDropdownTabsData |
|||
} |
|||
if (this.propsData.summaryDetails == undefined || !this.propsData.summaryDetails.length ) { |
|||
this.initDropdownTabsData = [{ |
|||
label: "详情", |
|||
name: 'xq' |
|||
}, |
|||
{ |
|||
label: "明细", |
|||
name: 'mx' |
|||
}] |
|||
return this.initDropdownTabsData |
|||
} |
|||
} |
|||
return this.initDropdownTabsData |
|||
} |
|||
}, |
|||
}, |
|||
mounted () { |
|||
}, |
|||
data () { |
|||
return { |
|||
otherData:[], // 切换tabs页赋值 |
|||
zdyTableColumns:[], // 自定义表头 |
|||
zdyValue:'', // 自定义展现值 |
|||
// firstTabs:'xq', |
|||
initDropdownTabsData:[ |
|||
{ |
|||
label: "详情", |
|||
name: 'xq' |
|||
}, |
|||
{ |
|||
label: "明细", |
|||
name: 'mx' |
|||
}, |
|||
{ |
|||
label: "汇总", |
|||
name: 'hz' |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
handleCommand (command) { |
|||
this.$emit('handleCommand', command) |
|||
}, |
|||
drawerShut () { |
|||
this.$emit('drawerShut', false) |
|||
}, |
|||
tableButtonClick (val) { |
|||
this.$emit('drawerbutton', val) |
|||
}, |
|||
//排序 |
|||
sortChange (data) { |
|||
this.$emit('sortChange', data) |
|||
}, |
|||
//点击selection框 |
|||
handleSelectionChange (val) { |
|||
this.$emit("handleSelectionChange", val) |
|||
}, |
|||
//点击name提交emit打开编辑页面 |
|||
inlineDialog (row) { |
|||
this.$emit("inlineDialog", row) |
|||
}, |
|||
//接收分页组件emit改变每页最大页数 |
|||
alterResultCountDetails (val) { |
|||
this.$emit('alterResultCountDetails', val) |
|||
}, |
|||
//接收分页组件emit改变当前页 |
|||
alertoldSkipCountDetails (val) { |
|||
this.$emit('alertoldSkipCountDetails', val) |
|||
}, |
|||
buttonClick(row) { |
|||
this.$emit("buttonClick", row); |
|||
}, |
|||
// tabs 切换页 |
|||
handleClick (val) { |
|||
this.$emit("currenTabsChange", val);//父级获取当前的tab内容 |
|||
this.zdyValue = val.name |
|||
this.dropdownTabsData.forEach( item => { |
|||
if (item.name == val.name) { |
|||
let parent = this.$parent |
|||
parent.tableLoading = true |
|||
// 详情 明细 汇总 |
|||
parent.firstTabs = val.name |
|||
if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') { |
|||
this.zdyTableColumns = [] |
|||
this.otherData = [] |
|||
parent.tableLoading = false |
|||
} else { |
|||
this.zdyTableColumns = [] |
|||
this.otherData = [] |
|||
// this.firstTabs = val.name |
|||
// 其他自定义tab页 |
|||
if (item.functionName == 'getListByItemcode') { |
|||
let params = { |
|||
itemCode: this.propsData.code |
|||
} |
|||
getListByItemcode(params, item.url).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} else if (item.functionName == 'byItem') { |
|||
byItem(this.propsData.code, item.url).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} else if (item.functionName == 'byProduct') { |
|||
byProduct({product:this.propsData.product}, item.url).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} else if (item.functionName == 'byComponent') { |
|||
byComponent({component:this.propsData.component}, item.url).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} |
|||
// 基础数据管理-物品清单维护-物品清单信息-详情-子物品层级 |
|||
else if (item.functionName == 'byComponentCJ') { |
|||
this.otherData = [] |
|||
byComponentCJ({component:this.propsData.component}, item.url).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
this.recursion(this.otherData) |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} else if (item.functionName == 'bySupplierCode') { |
|||
bySupplierCode({supplierCode:this.propsData.code}, item.url).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} else if (item.functionName == 'byLocation') { |
|||
byLocation(this.propsData.code==null?this.propsData.locationCode:this.propsData.code, item.url).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
this.o |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} else if (item.functionName == 'byLocationCode') { |
|||
byLocationCode({locationCode: this.propsData.code}, item.url).then(res => { |
|||
let itemData = [] |
|||
itemData.push(res) |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = itemData |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} |
|||
// 基础数据管理-库位信息-详情-库位零件关系 |
|||
else if (item.functionName == 'relationByLocationCode') { |
|||
relationByLocationCode({locationCode: this.propsData.code}, item.url).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
parent.tableLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.tableLoading = false |
|||
}) |
|||
} |
|||
// 采购收货记录-合格品收货明细, 不合格品收货明细, 收货缺料明细 |
|||
else if(item.functionName == "purRecNoteCustomInfo"){ |
|||
parent.Loading.DrawerLoading = true |
|||
purRecNoteCustomInfo( item.url,this.propsData.id).then(res => { |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = res |
|||
parent.Loading.DrawerLoading = false |
|||
}).catch(err => { |
|||
console.log(err) |
|||
parent.Loading.DrawerLoading = false |
|||
}) |
|||
} |
|||
// 客户退拆记录-详情页TAB-回冲记录 |
|||
else if(item.functionName == "customerDismantleBackFlushNote"){ |
|||
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns])); |
|||
delete zdyTableColumnsJSON[0].type |
|||
this.zdyTableColumns = zdyTableColumnsJSON |
|||
this.otherData = this.propsData.noteAndBackFlushDetails |
|||
} |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
// 递归 物品子级层级 |
|||
recursion(val){ |
|||
val.forEach(item => { |
|||
if(item.componentDTOs) { |
|||
item.children = item.componentDTOs |
|||
this.recursion(item.componentDTOs) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
// el-drawer |
|||
@import "./style/index.scss"; |
|||
</style> |
@ -1,122 +0,0 @@ |
|||
.el-drawer__wrapper { |
|||
z-index: 10 !important; |
|||
position: absolute; |
|||
left: 32%; |
|||
overflow: visible; |
|||
// height:calc(100% - 28px); |
|||
// top: 14px; |
|||
// right:14px |
|||
|
|||
::v-deep .el-drawer { |
|||
height: 100%; |
|||
overflow: visible; |
|||
box-shadow: 0 8px 10px -5px rgb(0 0 0 / 15%), 0 16px 24px 2px rgb(0 0 0 / 9%), 0 6px 30px 5px rgb(0 0 0 / 7%); |
|||
|
|||
.el-drawer__body { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
|
|||
.drawer-heder { |
|||
display: flex; |
|||
padding: 15px 10px; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
|
|||
.heder-left { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
|
|||
.heder-img { |
|||
width: 40px; |
|||
height: 40px; |
|||
margin-right: 10px; |
|||
} |
|||
|
|||
.header-text { |
|||
padding:0 20px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: space-between; |
|||
|
|||
span:nth-child(1) { |
|||
color: #333; |
|||
font-size: 22px; |
|||
} |
|||
|
|||
span:nth-child(2) { |
|||
color: #999; |
|||
font-size: 16px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.Descriptions { |
|||
padding: 0 10px; |
|||
} |
|||
|
|||
.drawer-main { |
|||
// padding-top: 20px; |
|||
flex: 1; |
|||
overflow: hidden; |
|||
// background-color: #efefef; |
|||
padding: 10px 20px 20px 30px; |
|||
border-top: solid 5px #f6f6f6; |
|||
|
|||
.el-tabs { |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
.el-tabs__header{ |
|||
// padding-bottom: 5px ; |
|||
.el-tabs__nav{ |
|||
z-index: auto !important; |
|||
} |
|||
} |
|||
|
|||
.el-tabs__content { |
|||
flex: 1; |
|||
|
|||
.el-tab-pane { |
|||
width: 100%; |
|||
height: 100%; |
|||
overflow-y: auto; |
|||
} |
|||
|
|||
.el-descriptions-item__label { |
|||
padding-right: 40px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.drawer-Shut { |
|||
width: 35px; |
|||
height: 100px; |
|||
position: absolute; |
|||
top: 200px; |
|||
left: -35px; |
|||
|
|||
.el-button { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
|
|||
::v-deep span { |
|||
font-size: 12px; |
|||
letter-spacing: 10px; |
|||
writing-mode: tb-rl; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
::v-deep .el-tabs__nav-wrap::after{ |
|||
content: unset !important; |
|||
} |
@ -1,206 +0,0 @@ |
|||
<template> |
|||
<el-dialog |
|||
:title="formTitle" |
|||
v-loading="loading" |
|||
v-if="displayDialog" |
|||
:visible="true" |
|||
:fullscreen="true" |
|||
:modal="false" |
|||
:modal-append-to-body="false" |
|||
:show-close="false" |
|||
style="z-index:11111" |
|||
> |
|||
<curren-Form |
|||
class="handleForm" |
|||
size="medium" |
|||
:searchData="CreateFormData" |
|||
:searchForm="CreateForm" |
|||
:searchHandle="editHandle" |
|||
:searchOptions="Options" |
|||
:rules="Rules" |
|||
@submitForm="editFormClick(arguments)" |
|||
> |
|||
<template> |
|||
<el-form-item |
|||
class="formTable-box" |
|||
prop="details" |
|||
v-if="CreateFormData.details" |
|||
> |
|||
<currenTable |
|||
:tableData="CreateFormData.details" |
|||
:searchOptions="Options" |
|||
:tableColumns="detailsTableColumns" |
|||
:selectionTable="selectionTable" |
|||
:isShowIndex="isShowIndex" |
|||
@handleSelectionChange="handleSelectionChange" |
|||
@buttonClick="buttonClick" |
|||
> |
|||
<template> |
|||
<slot></slot> |
|||
</template> |
|||
</currenTable> |
|||
</el-form-item> |
|||
</template> |
|||
</curren-Form> |
|||
</el-dialog> |
|||
</template> |
|||
<script> |
|||
export default { |
|||
props: { |
|||
//名称 |
|||
formTitle: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
//是否弹窗 |
|||
displayDialog: { |
|||
type: Boolean, |
|||
default: () => { |
|||
return false |
|||
} |
|||
}, |
|||
//主表提交数据 |
|||
CreateFormData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//主表显示form |
|||
CreateForm: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
//检验 |
|||
Rules: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//下拉选择 |
|||
Options: { |
|||
type: Object, |
|||
default: () => { |
|||
return {} |
|||
} |
|||
}, |
|||
//子表table显示 |
|||
detailsTableColumns: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
selectionTable:{ |
|||
type: Boolean, |
|||
default: () => { |
|||
return false |
|||
} |
|||
}, |
|||
// 列表序号显示 |
|||
isShowIndex: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
editHandle: { |
|||
type: Array, |
|||
default: () => { |
|||
return [ |
|||
{ label: "取消", name: "cancel" }, |
|||
{ label: "确定", type: "primary", name: "determine" }, |
|||
]; |
|||
}, |
|||
}, |
|||
// loading: { |
|||
// type: Boolean, |
|||
// default: false |
|||
// }, |
|||
}, |
|||
data () { |
|||
return { |
|||
loading: false, |
|||
// editHandle: [ |
|||
// { label: "取消", name: "cancel" }, |
|||
// { label: "确定", type: "primary", name: "determine" }, |
|||
// ], |
|||
} |
|||
}, |
|||
methods: { |
|||
//点击表单提交 |
|||
editFormClick (val) { |
|||
if (val[0] == 0) { |
|||
// 取消 |
|||
this.$emit('update:displayDialog', false) |
|||
if(val[2].handleEvent)val[2].handleEvent() |
|||
} else if(val[0] == 1){ |
|||
// 确定 |
|||
val[1].validate((valid) => { |
|||
if (valid) { |
|||
const parent = this.$parent |
|||
this.loading = true |
|||
parent.handleFormSubmit().then(res => { |
|||
this.loading = false |
|||
}, err => { |
|||
this.loading = false |
|||
}) |
|||
} else { |
|||
this.$errorMsg('请检查表单') |
|||
return false; |
|||
} |
|||
}); |
|||
} else { |
|||
// 自定义 |
|||
if(val[2].handleEvent)val[2].handleEvent() |
|||
} |
|||
}, |
|||
handleSelectionChange(val){ |
|||
this.$emit("handleSelectionChange", val); |
|||
}, |
|||
//点击按钮打开自定义弹窗 |
|||
buttonClick(row,index) { |
|||
this.$emit("buttonClick", row,index); |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.handleForm { |
|||
display: flex; |
|||
flex-direction: column; |
|||
width: 100%; |
|||
height: 100%; |
|||
::v-deep .el-form { |
|||
flex: 1; |
|||
display: flex; |
|||
flex-direction: column; |
|||
overflow: hidden; |
|||
.el-row { |
|||
flex: 2; |
|||
flex-wrap: wrap; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
} |
|||
|
|||
.formTable-box { |
|||
flex: 2; |
|||
overflow: hidden; |
|||
|
|||
.el-form-item__content { |
|||
width: 100%; |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
overflow: hidden; |
|||
margin: 0 !important; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.el-table { |
|||
height: 500px !important; |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,993 @@ |
|||
<template> |
|||
<!-- 解决el-table 数据量过大导致卡顿现象 --> |
|||
<u-table |
|||
:id="_uid" |
|||
:key="isUpdate" |
|||
v-loading="tableLoading" |
|||
element-loading-text="拼命加载中..." |
|||
@sort-change="sortChange" |
|||
@selection-change="handleSelectionChange" |
|||
ref="multipleTable" |
|||
:data="tableData" |
|||
:row-key="rowKey" |
|||
:border="tableBorder" |
|||
style="width: 100%" |
|||
:cell-style="cellStyle" |
|||
use-virtual |
|||
:row-height="50" |
|||
:height="uTableHeight" |
|||
header-row-class-name="uTableHeader" |
|||
> |
|||
<!-- :tree-props="treeProps" 与 “height” 不能共存, 此组件暂不支持tree的格式--> |
|||
<!-- 操作列 (左侧)--> |
|||
<u-table-column |
|||
v-if="buttonOperationList_left" |
|||
:fixed="'left'" |
|||
width="auto" |
|||
min-width="120px" |
|||
:align="'center'" |
|||
:header-align="'center'" |
|||
> |
|||
<template #header> |
|||
<span>操作</span> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
v-for="(itemButton, indexButton) in buttonOperationList_left" |
|||
:key="indexButton" |
|||
type="text" |
|||
size="mini" |
|||
@click="buttonOperationClick_left(scope.row, itemButton, indexButton)" |
|||
>{{itemButton.label}}</el-button> |
|||
</template> |
|||
</u-table-column> |
|||
<!-- 操作列 (右侧)--> |
|||
<u-table-column |
|||
v-if="buttonOperationList_right" |
|||
:fixed="'right'" |
|||
width="auto" |
|||
min-width="120px" |
|||
:align="'center'" |
|||
:header-align="'center'" |
|||
> |
|||
<template #header> |
|||
<span>操作</span> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
v-for="(itemButton, indexButton) in buttonOperationList_right(scope.row)" |
|||
v-show="!itemButton.hide" |
|||
:key="indexButton" |
|||
type="text" |
|||
size="mini" |
|||
@click="buttonOperationClick_right(scope.row, itemButton, indexButton)" |
|||
>{{itemButton.label}}</el-button> |
|||
</template> |
|||
</u-table-column> |
|||
<u-table-column v-if="selectionTable" fixed="left" type="selection" :reserve-selection="true" /> |
|||
<u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" /> |
|||
<template v-for="(item, index) in TableSize"> |
|||
<u-table-column |
|||
min-width="150" |
|||
:key="index" |
|||
:prop="item.showProp ? item.prop + '.' + item.showProp : item.prop" |
|||
:sortable="item.sortable" |
|||
:fixed="setItemFixed(item,index)" |
|||
:show-overflow-tooltip="showOverflowTooltip" |
|||
:width="item.width" |
|||
:align="item.tableAlign" |
|||
:header-align="item.tableHeaderAlign" |
|||
v-if="item.istrue==null?true:item.istrue" |
|||
> |
|||
<template #header> |
|||
<span>{{ item.label }}</span> |
|||
<i style="color: #f56c6c" v-if="item.rules && requiredRules">*</i> |
|||
</template> |
|||
<template slot-scope="scope"> |
|||
<el-form> |
|||
<el-form-item |
|||
v-if="item.type == 'input'" |
|||
:onkeyup="itemOnKeyUp(item,searchData[item.prop])" |
|||
:prop="'details.' + scope.$index + '.' + item.prop" |
|||
:rules="item.rules" |
|||
> |
|||
<el-input |
|||
:placeholder="'请输入' + item.label" |
|||
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])" |
|||
v-model="scope.row[item.prop]" |
|||
@blur=" |
|||
inputPlaceholder($event, item, 'blur',scope.row) |
|||
" |
|||
@focus="inputPlaceholder($event, item, 'focus')" |
|||
clearable |
|||
> |
|||
</el-input> |
|||
</el-form-item> |
|||
<!-- 输入框(数字) onkeyup: 正则表达式,用于前端输入校验工作--> |
|||
<el-form-item |
|||
v-if="item.type == 'inputNumber'" |
|||
:prop="'details.' + scope.$index + '.' + item.prop" |
|||
:rules="item.rules" |
|||
> |
|||
<el-input |
|||
v-model="searchData[item.prop]" |
|||
:maxlength="item.maxlength" |
|||
:onkeyup="typeNumberOnkeyup(item,searchData[item.prop])" |
|||
clearable |
|||
:disabled="Boolean(item.disabled)" |
|||
:placeholder="'请输入' + item.label" |
|||
:prefix-icon="item.icon" |
|||
:show-password="item.showPassword" |
|||
@change="changeInput(item.prop,$event)" |
|||
@clear="clearInput(item.prop,$event)" |
|||
@blur=" |
|||
inputPlaceholder($event, item, 'blur',searchData) |
|||
" |
|||
@focus="inputPlaceholder($event, item, 'focus')" |
|||
></el-input> |
|||
</el-form-item> |
|||
<el-form-item |
|||
v-if="item.type == 'objectInput'" |
|||
:prop=" |
|||
'details.' + scope.$index + '.' + item.prop + '.' + item.showProp |
|||
" |
|||
:rules="item.rules" |
|||
> |
|||
<el-input |
|||
:placeholder="'请输入' + item.label" |
|||
v-model="scope.row[item.prop][item.showProp]" |
|||
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])" |
|||
@blur=" |
|||
inputPlaceholder($event, item, 'blur', scope.row) |
|||
" |
|||
@focus="inputPlaceholder($event, item, 'focus')" |
|||
clearable |
|||
> |
|||
</el-input> |
|||
</el-form-item> |
|||
<!-- 下拉框 --> |
|||
<el-select |
|||
v-if="item.type === 'select'" |
|||
v-model="scope.row[item.prop]" |
|||
:loading="selectLoading" |
|||
:clearable="item.clearable" |
|||
:multiple="item.multiple" |
|||
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])" |
|||
:filterable="item.filterable" |
|||
:allow-create="item.allowCreate" |
|||
style="width: 100%" |
|||
:placeholder="'请输入' + item.label" |
|||
> |
|||
<el-option |
|||
v-for="(op, index) in selectOptions(item.options) || |
|||
searchOptions['options']" |
|||
:label="op[item.optionsLabel] || op.label" |
|||
:value="op[item.optionsValue] || op.value" |
|||
:key="index" |
|||
></el-option> |
|||
</el-select> |
|||
<!--对象下拉框 --> |
|||
<el-select |
|||
v-if="item.type === 'objectSelect'" |
|||
v-model="scope.row[item.prop][item.showProp]" |
|||
:loading="selectLoading" |
|||
:clearable="item.clearable" |
|||
:multiple="item.multiple" |
|||
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])" |
|||
:filterable="item.filterable" |
|||
:allow-create="item.allowCreate" |
|||
style="width: 100%" |
|||
:placeholder="'请输入' + item.label" |
|||
> |
|||
<el-option |
|||
v-for="(op, index) in selectOptions(item.options) || |
|||
searchOptions['options']" |
|||
:label="op[item.optionsLabel] || op.label" |
|||
:value="op[item.optionsValue] || op.value" |
|||
:key="index" |
|||
></el-option> |
|||
</el-select> |
|||
<!--查询下拉--> |
|||
<el-form-item |
|||
v-if="item.type === 'autocomplete'" |
|||
:prop="'details.' + scope.$index + '.' + item.prop" |
|||
:rules="item.rules" |
|||
> |
|||
<el-autocomplete |
|||
class="inline-input" |
|||
style="width: 100%" |
|||
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])" |
|||
v-model="scope.row[item.prop]" |
|||
:fetch-suggestions=" |
|||
(queryString, cb) => { |
|||
querySearch(queryString, cb, item, scope); |
|||
} |
|||
" |
|||
:placeholder="'请输入' + item.label" |
|||
@select="handleSelect($event, item, scope)" |
|||
> |
|||
<!-- <template slot-scope="{item}"> |
|||
<div class="name" style="color:green">{{item.value = item.name}}</div> |
|||
<div class="name" >{{item.address = item.code}}</div> |
|||
</template> --> |
|||
<el-button |
|||
v-if="item.click" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
@click="item.click({ scope, item })" |
|||
style="color: #1890ff; background-color: #ffffff" |
|||
></el-button> |
|||
</el-autocomplete> |
|||
</el-form-item> |
|||
<!-- 对象查询下拉 --> |
|||
<el-form-item |
|||
v-if="item.type === 'objectAutocomplete'" |
|||
:prop=" |
|||
'details.' + scope.$index + '.' + item.prop + '.' + item.showProp |
|||
" |
|||
:rules="item.rules" |
|||
> |
|||
<el-autocomplete |
|||
class="inline-input" |
|||
style="width: 100%" |
|||
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])" |
|||
v-model="scope.row[item.prop][item.showProp]" |
|||
:fetch-suggestions=" |
|||
(queryString, cb) => { |
|||
querySearch(queryString, cb, item, scope); |
|||
} |
|||
" |
|||
:placeholder="'请输入' + item.label" |
|||
@select="handleSelect($event, item, scope)" |
|||
> |
|||
<!-- <template slot-scope="{item}"> |
|||
<div class="name" style="color:green">{{item.value = item.name}}</div> |
|||
<div class="name" >{{item.address = item.code}}</div> |
|||
</template> --> |
|||
<el-button |
|||
v-if="item.click" |
|||
slot="append" |
|||
icon="el-icon-search" |
|||
@click="item.click({ scope, item })" |
|||
style="color: #1890ff; background-color: #ffffff" |
|||
></el-button> |
|||
</el-autocomplete> |
|||
</el-form-item> |
|||
<!-- <el-form-item v-if="item.type == 'inputEnum'" :prop="item.prop"> |
|||
<el-input |
|||
placeholder="请输入内容" |
|||
v-model="scope.row[item.prop]" |
|||
clearable |
|||
> |
|||
</el-input> |
|||
</el-form-item> --> |
|||
|
|||
<el-form-item |
|||
v-if="item.type == 'dateTimeInput'" |
|||
:prop="'details.' + scope.$index + '.' + item.prop" |
|||
:rules="item.rules" |
|||
> |
|||
<el-date-picker |
|||
type="datetime" |
|||
v-model="scope.row[item.prop]" |
|||
placeholder="选择日期" |
|||
style="width: 100%" |
|||
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])" |
|||
value-format="yyyy-MM-ddTHH:mm:ss.sssZ" |
|||
format="yyyy-MM-dd" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item |
|||
v-if="item.type == 'objectDateTimeInput'" |
|||
:prop="'details.' + scope.$index + '.' + item.prop + '.' + item.showProp" |
|||
:rules="item.rules" |
|||
> |
|||
<el-date-picker |
|||
type="datetime" |
|||
v-model="scope.row[item.prop][item.showProp]" |
|||
placeholder="选择日期" |
|||
style="width: 100%" |
|||
:disabled="Boolean(item.disabled) || Boolean(scope.row['disabled'])" |
|||
value-format="yyyy-MM-ddTHH:mm:ss.sssZ" |
|||
format="yyyy-MM-dd" |
|||
></el-date-picker> |
|||
</el-form-item> |
|||
<!-- table表添加按钮事件 v-show="scope.row.number == 'PRJ202210060001'" --> |
|||
<!-- <el-form-item v-if="item.type == 'button'" > --> |
|||
<div v-if="item.type == 'button'"> |
|||
<el-button |
|||
v-show="scope.row[item.prop]==undefined?true:false" |
|||
type="primary" |
|||
size="mini" |
|||
@click="buttonClick(scope.row, scope.$index, item.label)" |
|||
>{{item.label}}</el-button> |
|||
</div> |
|||
<!-- </el-form-item> --> |
|||
<span v-if="item.type == 'object'"> |
|||
{{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }} |
|||
</span> |
|||
<span v-if="item.type == 'objectDateTime'"> |
|||
{{ scope.row[item.prop]? scope.row[item.prop][item.showProp]: "" | formatDate }} |
|||
</span> |
|||
<span v-if="item.type == 'dateTime'"> |
|||
{{ scope.row[item.prop] | formatDate }} |
|||
</span> |
|||
<!-- 调用主表信息 --> |
|||
<span v-else-if="item.type && item.type == 'outerMainFilter'"> |
|||
{{ propsData[item.showProp] }} |
|||
</span> |
|||
<el-tag |
|||
v-if="item.type == 'tagFilter'" |
|||
:effect="'dark'" |
|||
size="medium" |
|||
class="tagFilterTypeDarkItem" |
|||
:color="scope.row[item.prop] | trigger(item.filters, 'background')" |
|||
> |
|||
{{ scope.row[item.prop] | trigger(item.filters, "label") }} |
|||
</el-tag> |
|||
<span |
|||
v-if="item.type == 'filter'" |
|||
:style="scope.row[item.prop]" |
|||
> |
|||
{{ scope.row[item.prop] | trigger(item.filters, "label", item.dictType) }} |
|||
</span> |
|||
<span |
|||
v-if="item.type == 'objectFilter'" |
|||
:style="scope.row[item.prop][item.showProp]" |
|||
> |
|||
{{ scope.row[item.prop][item.showProp] | trigger(item.filters, "label") }} |
|||
</span> |
|||
<span v-else-if="item.type == 'filterList'" > |
|||
{{ scope.row[item.prop] | triggerList(item.filters, "label") }} |
|||
</span> |
|||
<!-- 可点出详情 --> |
|||
<span |
|||
v-if="item.type == 'showDetail'" |
|||
@click="showDetailInfo(scope.row[item.prop])" |
|||
style="cursor: pointer;" |
|||
:title="'点击查看详情'" |
|||
:class="{ showDetailHover: item.type == 'showDetail' }" |
|||
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span> |
|||
<!-- 可点出json转换的table弹窗 --> |
|||
<span |
|||
v-if="item.type == 'showJsonTable'" |
|||
@click="showJsonTable(scope.row[item.prop])" |
|||
style="cursor: pointer;" |
|||
:title="'点击查看详情'" |
|||
:class="{ showDetailHover: item.type == 'showJsonTable' }" |
|||
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span> |
|||
<span |
|||
v-if="item.type == 'name' || !item.type" |
|||
@click="item.type == 'name' && inlineDialog(scope.row)" |
|||
:class="{ spamHover: item.type == 'name' }" |
|||
>{{ scope.row[item.prop] ? scope.row[item.prop] + "" : scope.row[item.prop] }}</span> |
|||
</el-form> |
|||
</template> |
|||
</u-table-column> |
|||
</template> |
|||
<slot></slot> |
|||
|
|||
<!-- 点开查看全部弹窗 --> |
|||
<el-dialog |
|||
:visible.sync="showDetailDialog" |
|||
width="35%" |
|||
:modal-append-to-body="false" |
|||
:append-to-body="true" |
|||
:show-close="true" |
|||
:title="'内容详情'" |
|||
> |
|||
{{ showDetailData ? showDetailData + "" : showDetailData }} |
|||
</el-dialog> |
|||
|
|||
<!-- json弹窗(复制的json内容) --> |
|||
<el-dialog |
|||
id="copyJsonTextarea_dialog_ref" |
|||
:visible.sync="showJsonCopy" |
|||
:modal-append-to-body="false" |
|||
:append-to-body="true" |
|||
:show-close="true" |
|||
:close-on-click-modal="true" |
|||
:close-on-press-escape="true" |
|||
:title="'JSON详情'" |
|||
> |
|||
<el-input |
|||
ref="copyJsonTextarea_ref" |
|||
type="textarea" |
|||
readonly |
|||
autosize |
|||
placeholder="请输入内容" |
|||
v-model="showJsonData_str"> |
|||
</el-input> |
|||
</el-dialog> |
|||
|
|||
<!-- 点开查看Json转换后table弹窗 --> |
|||
<el-dialog |
|||
:visible.sync="showJsonDialog" |
|||
:modal-append-to-body="false" |
|||
:append-to-body="true" |
|||
:show-close="true" |
|||
:close-on-click-modal="true" |
|||
:close-on-press-escape="true" |
|||
:title="'内容详情'" |
|||
> |
|||
<el-button |
|||
@click="copyJsonHandle()" |
|||
type="primary" |
|||
style="margin-bottom: 10px;float: right;" |
|||
>复制JSON</el-button> |
|||
<el-table |
|||
:data="showJsonData" |
|||
:border="true" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="name" |
|||
width="220" |
|||
label="属性"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="值" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<!-- DETAILS todo:DETAILS判断条件需要优化,使用传参的方式 --> |
|||
<span v-if="(scope.row.name).toUpperCase() != 'DETAILS'">{{scope.row.value}}</span> |
|||
<el-table |
|||
v-else |
|||
height="300" |
|||
:data="scope.row.value" |
|||
:border="true" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
prop="name" |
|||
label="子属性" |
|||
></el-table-column> |
|||
<el-table-column |
|||
label="子值" |
|||
prop="value" |
|||
></el-table-column> |
|||
</el-table> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-dialog> |
|||
</u-table> |
|||
</template> |
|||
<script> |
|||
import { formatTimeStrToStr } from "@/utils/formatTime"; |
|||
import _ from "lodash"; |
|||
import { getMatchRegConformValue } from "@/utils/index" |
|||
export default { |
|||
name: "currenTable", |
|||
filters: { |
|||
formatDate(time) { |
|||
if (time == null) { |
|||
return '-' |
|||
} |
|||
return formatTimeStrToStr(time) |
|||
}, |
|||
}, |
|||
props: { |
|||
// 操作列按钮(左侧) |
|||
buttonOperationList_left:{ |
|||
type: Array, |
|||
default: null, |
|||
}, |
|||
// 操作列按钮(右侧) |
|||
buttonOperationList_right:{ |
|||
type: Function, |
|||
default: null, |
|||
}, |
|||
// 超出内容是否提示 |
|||
showOverflowTooltip:{ |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
// table是否有border |
|||
tableBorder: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
// 是否为第一个浮动,如果是,则item中的fixed无效(应用场景:主列表,因为用户排序不定元素为第一项) |
|||
firstFixed: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
propsData: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
tableData: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
tableLoading: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
tableColumns: { |
|||
type: Array, |
|||
default: () => { |
|||
return []; |
|||
}, |
|||
}, |
|||
selectionTable: { |
|||
type: Boolean, |
|||
default: true, |
|||
}, |
|||
requiredRules: { |
|||
type: Boolean, |
|||
default: true, |
|||
}, |
|||
searchOptions: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
}, |
|||
}, |
|||
treeProps: { |
|||
type: Object, |
|||
default: () => { |
|||
return {}; |
|||
} |
|||
}, |
|||
// table key 字段设置顺序后需更新该值 |
|||
isUpdate: { |
|||
type: Boolean, |
|||
default: () => { |
|||
return false |
|||
} |
|||
}, |
|||
rowKey:{ |
|||
type: String, |
|||
default: 'id', |
|||
}, |
|||
isShowIndex: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
cellStyle: { |
|||
type: Function, |
|||
default: () => { |
|||
return Function; |
|||
} |
|||
}, |
|||
// 已app-main高度为100% 需要减掉的高度 |
|||
setUTableHeight: { |
|||
type: Number, |
|||
default: () => { |
|||
return 280; |
|||
} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dropCol: null, |
|||
selectLoading: false, |
|||
random: '', |
|||
uTableHeight:null,//表格撑开高度 |
|||
showDetailDialog:false,//点开查看全部弹窗 |
|||
showDetailData:null,//点开查看全部内容 |
|||
showJsonDialog:false,//点开查看Json转换后table弹窗 |
|||
showJsonData:null,//点开查看Json的数据 |
|||
showJsonData_str:null,//复制的Json字符串 |
|||
showJsonCopy:false,//复制json的Dialog显隐控制 |
|||
}; |
|||
}, |
|||
computed: { |
|||
selectOptions() { |
|||
return (val) => { |
|||
if (val) { |
|||
let options = this.$staticOptions[val]; |
|||
if (options) { |
|||
return options(); |
|||
} else { |
|||
return []; |
|||
} |
|||
} else { |
|||
return false; |
|||
} |
|||
}; |
|||
}, |
|||
TableSize(){ |
|||
return this.tableColumnsFilter() |
|||
} |
|||
}, |
|||
watch: { |
|||
tableData: { |
|||
handler(val, oldVal) { |
|||
this.$nextTick(() => { |
|||
if (this.$refs.multipleTable && this.$refs.multipleTable.doLayout) { |
|||
this.$refs.multipleTable.doLayout() |
|||
} |
|||
}); |
|||
}, |
|||
immediate: false, |
|||
}, |
|||
tableColumns: { |
|||
handler(val, oldVal) { |
|||
this.$nextTick(() => { |
|||
if (this.$refs.multipleTable && this.$refs.multipleTable.doLayout) { |
|||
this.$refs.multipleTable.doLayout() |
|||
} |
|||
}); |
|||
}, |
|||
immediate: false, |
|||
}, |
|||
setUTableHeight(n,o){ |
|||
this.setTableHeightHandle(n) |
|||
} |
|||
}, |
|||
activated() { |
|||
this.$refs.multipleTable.doLayout(); |
|||
}, |
|||
mounted() { |
|||
this.random = this._uid |
|||
this.setTableHeightHandle() |
|||
}, |
|||
methods: { |
|||
// 设置表格高度 |
|||
setTableHeightHandle(height){ |
|||
let _height = height || this.setUTableHeight |
|||
let _app_height = document.getElementsByClassName('app-main')[0].clientHeight |
|||
this.uTableHeight = Number(_app_height) - Number(_height) |
|||
}, |
|||
// 获取表格高度 误删 业务当中有用 |
|||
getTableHeight(){ |
|||
return this.uTableHeight |
|||
}, |
|||
setItemFixed(item,index){ |
|||
let _re = false |
|||
if(this.firstFixed && item.fixed == 'left'){ |
|||
if(index == 0)_re = true |
|||
}else{ |
|||
_re = item.fixed |
|||
} |
|||
return _re |
|||
}, |
|||
// type=input情况下,框实时校验 |
|||
itemOnKeyUp(item,value){ |
|||
if(item.onkeyup){ |
|||
return item.onkeyup() |
|||
}else{ |
|||
if(value && item.validType){ |
|||
this.searchData[item.prop]=getMatchRegConformValue(item.validType,value,item.pointNumberFixed) |
|||
} |
|||
} |
|||
}, |
|||
// 数字类型input框onkeyup最大最小值处理 |
|||
typeNumberOnkeyup(item,value){ |
|||
if(value){ |
|||
let _match = String(value).match(/\d+/)//正整数 |
|||
this.searchData[item.prop] = _match?_match[0]:_match |
|||
} |
|||
if(this.searchData[item.prop] > item.max){ |
|||
this.searchData[item.prop] = item.max |
|||
} |
|||
if(this.searchData[item.prop] && this.searchData[item.prop] < item.min){ |
|||
this.searchData[item.prop] = item.min |
|||
} |
|||
if(item.onkeyup)item.onkeyup() |
|||
}, |
|||
tableColumnsFilter() { |
|||
let widthSize = _.cloneDeep(this.tableColumns); |
|||
for(let i = 0;i<widthSize.length;i++){ |
|||
let item = widthSize[i] |
|||
if (item.type == "autocomplete" || item.type == "objectAutocomplete") { |
|||
item.width = item.width ? item.width: "300px"; |
|||
} else if (item.type == "input" || item.type == "objectInput") { |
|||
if (item.width == '100%') { |
|||
item.width = '' |
|||
} else { |
|||
item.width = item.width ? item.width: "200px"; |
|||
} |
|||
} else if ( |
|||
item.type == "dateTimeInput" || |
|||
item.type == "objectDateTimeInput" |
|||
) { |
|||
item.width =item.width ? item.width: "200px"; |
|||
} else if (item.type == "objectDateTime" || item.type == "dateTime") { |
|||
item.width =item.width ? item.width: "200px"; |
|||
} else if (item.width == '100%') { |
|||
item.width = '' |
|||
} else { |
|||
item.width =item.width ? item.width: "auto"; |
|||
} |
|||
} |
|||
return widthSize |
|||
}, |
|||
inputPlaceholder(val, item, type, func) { |
|||
if (item.valueType) { |
|||
if (type == "focus") { |
|||
val.target.placeholder = "请输入" + item.label; |
|||
if (val.target.value != "") { |
|||
val.target.placeholder = val.target.value; |
|||
val.target.value = ""; |
|||
} |
|||
} else if (type == "blur") { |
|||
// val.target.value = "0" |
|||
val.target.value = val.target.value.toString().replace(/[^\d.]/g,'') |
|||
if (val.target.value == "") { |
|||
// if (val.target.placeholder.indexOf('请输入') == -1) { |
|||
val.target.value = val.target.placeholder; |
|||
// } |
|||
} |
|||
if(item.showProp){ |
|||
func[item.prop][item.showProp]= Number(val.target.value) |
|||
}else{ |
|||
func[item.prop]= Number(val.target.value) |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
//autocomplete下拉 |
|||
querySearch(queryString, cb, val, row) { |
|||
const { options, optionsValue, optionsLabel } = val; |
|||
let func = val.focus; |
|||
let data = { |
|||
scope: row, |
|||
}; |
|||
if (queryString) { |
|||
data.filter = [ |
|||
{ |
|||
logic: "And", |
|||
column: optionsValue, |
|||
action: "Like", |
|||
value: queryString, |
|||
}, |
|||
]; |
|||
} |
|||
func(data).then((res) => { |
|||
var restaurants = this.searchOptions["options"]; |
|||
let results = queryString |
|||
? restaurants.filter( |
|||
this.createFilter(queryString, optionsValue, optionsLabel) |
|||
) |
|||
: restaurants; |
|||
results.forEach((key) => { |
|||
if (typeof optionsValue === "string") { |
|||
key.value = key[optionsValue] + "----" + key[optionsLabel]; |
|||
} else { |
|||
key.value = |
|||
key[optionsValue[0]][optionsValue[1]] + |
|||
"----" + |
|||
key[optionsLabel]; |
|||
} |
|||
}); |
|||
// 调用 callback 返回建议列表的数据 |
|||
cb(results); |
|||
}); |
|||
}, |
|||
createFilter(queryString, optionsValue, optionsLabel) { |
|||
return (restaurant) => { |
|||
if (typeof optionsValue === "string") { |
|||
restaurant.value = |
|||
restaurant[optionsValue] + "----" + restaurant[optionsLabel]; |
|||
} else { |
|||
restaurant.value = |
|||
restaurant[optionsValue[0]][optionsValue[1]] + |
|||
"----" + |
|||
restaurant[optionsLabel]; |
|||
} |
|||
return ( |
|||
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) != |
|||
-1 |
|||
); |
|||
}; |
|||
}, |
|||
handleSelect(item, val, scope) { |
|||
let data = this.tableData[scope.$index]; |
|||
if (!val.showProp) { |
|||
if (typeof val.optionsValue === "string") { |
|||
data[val.prop] = item[val.optionsValue]; |
|||
} else { |
|||
data[val.prop] = item[val.optionsValue[0]][val.optionsValue[1]]; |
|||
} |
|||
} else { |
|||
if (typeof val.optionsValue === "string") { |
|||
data[val.prop][val.showProp] = item[val.optionsValue]; |
|||
} else { |
|||
data[val.prop][val.showProp] = |
|||
item[val.optionsValue[0]][val.optionsValue[1]]; |
|||
} |
|||
} |
|||
this.$emit("push", item, scope, val); |
|||
}, |
|||
getMaxLength(arr) { |
|||
return arr.reduce((acc, item) => { |
|||
if (item) { |
|||
const calcLen = this.getTexWidth(item); |
|||
if (acc < calcLen) { |
|||
acc = calcLen; |
|||
} |
|||
} |
|||
return acc; |
|||
}, 0); |
|||
}, |
|||
getTexWidth(str) { |
|||
let width = 0; |
|||
const html = document.createElement("span"); |
|||
html.innerText = str; |
|||
html.className = "getTextWidth"; |
|||
document.querySelector("body").appendChild(html); |
|||
width = document.querySelector(".getTextWidth").offsetWidth; |
|||
document.querySelector(".getTextWidth").remove(); |
|||
return width; |
|||
}, |
|||
flexColumnWidth(label, prop) { |
|||
const arr = this.tableData.map((x) => { |
|||
if (typeof prop !== "string") { |
|||
return x[prop[0]][prop[1]]; |
|||
} else { |
|||
return x[prop]; |
|||
} |
|||
}); |
|||
arr.push(label); |
|||
return this.getMaxLength(arr) + 60 + "px"; |
|||
}, |
|||
//排序 |
|||
sortChange(data) { |
|||
this.$emit("sortChange", data); |
|||
}, |
|||
//点击selection框 |
|||
handleSelectionChange(val) { |
|||
this.$emit("handleSelectionChange", val); |
|||
}, |
|||
//点击name提交emit打开编辑页面 |
|||
inlineDialog(row) { |
|||
this.$emit("inlineDialog", row); |
|||
}, |
|||
//可点出详情弹窗 |
|||
showDetailInfo(row) { |
|||
this.showDetailDialog = true |
|||
this.showDetailData = row |
|||
this.$emit("showDetailInfo", row); |
|||
}, |
|||
// 可点出json转换的table弹窗 |
|||
showJsonTable(row){ |
|||
this.showJsonDialog = true |
|||
let _json = eval('(' + row + ')') |
|||
let _arr = [] |
|||
let __initJson = (data) => { |
|||
let _init = [] |
|||
for(let item in data){ |
|||
_init.push({name:item,value:data[item]}) |
|||
} |
|||
return _init |
|||
} |
|||
for(let item in _json){ |
|||
// 直接输出 |
|||
if(!_json[item]){ |
|||
_arr.push({name:item,value:_json[item]}) |
|||
}else if(_json[item] && typeof _json[item] != 'object'){ |
|||
_arr.push({name:item,value:_json[item] + ""}) |
|||
}else{ |
|||
// 如果是数组 |
|||
if(Array.isArray(_json[item])){ |
|||
// 如果是 DETAILS todo:DETAILS判断条件需要优化,使用传参的方式 |
|||
let _value = (item).toUpperCase() == 'DETAILS' ? __initJson(_json[item][0]) : (_json[item]).join(",") |
|||
_arr.push({name:item,value:_value}) |
|||
} |
|||
// 如果是对象 |
|||
else{ |
|||
let _obj_arr = __initJson(_json[item]) |
|||
// 对象有数据 |
|||
if(_obj_arr.length > 0){ |
|||
_arr = [..._obj_arr] |
|||
}else{ |
|||
// 空对象 |
|||
_arr.push({name:item,value:""}) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
this.showJsonData = _arr |
|||
this.showJsonData_str = JSON.stringify(JSON.parse(JSON.stringify(this.showJsonData)), null, '\t') |
|||
this.$emit("showJsonTable", row); |
|||
}, |
|||
// 复制Json按钮 |
|||
copyJsonHandle(){ |
|||
this.showJsonCopy = true |
|||
navigator.clipboard.writeText(this.showJsonData_str) |
|||
.then(() => { |
|||
this.$message.success('复制成功'); |
|||
}) |
|||
.catch(err => { |
|||
this.$message.error('复制失败'); |
|||
}); |
|||
this.$nextTick(()=>{ |
|||
if(this.$refs.copyJsonTextarea_ref){ |
|||
this.$refs.copyJsonTextarea_ref.focus() |
|||
this.$nextTick(()=>{ |
|||
document.getElementById('copyJsonTextarea_dialog_ref').scrollTop = 0 |
|||
}) |
|||
} |
|||
}) |
|||
}, |
|||
//点击按钮打开自定义弹窗 |
|||
buttonClick(row, index, label) { |
|||
this.$emit("buttonClick", row, index, label); |
|||
}, |
|||
//点击table操作列(左侧)按钮 |
|||
buttonOperationClick_left(row, item, index) { |
|||
this.$emit("buttonOperationClick_left", row, item, index); |
|||
}, |
|||
//点击table操作列(右侧)按钮 |
|||
buttonOperationClick_right(row, item, index) { |
|||
this.$emit("buttonOperationClick_right", row, item, index); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
::v-deep .uTableHeader th{ |
|||
background: #f6f7fb !important; |
|||
border: none !important; |
|||
|
|||
// &:last-child{ |
|||
// background: unset !important; |
|||
// } |
|||
} |
|||
::v-deep .el-form-item__error{ |
|||
position: relative; |
|||
} |
|||
::v-deep .el-table__fixed { |
|||
display: block-inline !important; |
|||
height: auto !important; |
|||
bottom: 13px !important; |
|||
.el-table__fixed-header-wrapper { |
|||
z-index: auto !important; |
|||
} |
|||
.el-table__fixed-body-wrapper { |
|||
z-index: auto !important; |
|||
} |
|||
} |
|||
::v-deep .el-table__fixed-right { |
|||
display: block-inline !important; |
|||
height: auto !important; |
|||
bottom: 13px !important; |
|||
.el-table__fixed-header-wrapper { |
|||
z-index: auto !important; |
|||
} |
|||
.el-table__fixed-body-wrapper { |
|||
z-index: auto !important; |
|||
} |
|||
} |
|||
::v-deep .el-table__fixed::before, |
|||
.el-table__fixed-right::before { |
|||
z-index: auto !important; |
|||
} |
|||
.spamHover { |
|||
color: #409eff; |
|||
cursor: pointer; |
|||
} |
|||
.spamHover:hover { |
|||
border-bottom: 1px solid #409eff; |
|||
color: blue; |
|||
} |
|||
.showDetailHover:hover{ |
|||
color: #409eff; |
|||
} |
|||
span { |
|||
white-space: pre; |
|||
} |
|||
::v-deep .el-select { |
|||
.el-input__inner { |
|||
padding: 0 30px 0 15px; |
|||
} |
|||
.el-input__prefix { |
|||
width: 100% !important; |
|||
left: 0; |
|||
.el-button { |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
} |
|||
} |
|||
} |
|||
.u-table::before { |
|||
height: 0px; |
|||
} |
|||
</style> |
@ -1,53 +0,0 @@ |
|||
/** |
|||
* |
|||
* @returns {Array} '导入表格模板字段' |
|||
*/ |
|||
// 供货商导入表格
|
|||
export const supplierAsnExcel = { |
|||
// poNumber:"订单号",
|
|||
// number:"发货单号",
|
|||
supplierCode:"供应商代码", |
|||
planUserCode:"筹措员代码", |
|||
planArriveDate:"要求到货时间", |
|||
shipDate:"发货日期", |
|||
details:{ |
|||
projectCode:"明细-项目编号", |
|||
itemCode:"明细-物品代码", |
|||
ctype:"明细-类型", |
|||
recommendErpCode:"明细-指定ERP储位", |
|||
qty:"明细-发货数量", |
|||
uom:"明细-物品单位", |
|||
lot:"明细-生产批次", |
|||
produceDate:"明细-生产时间", |
|||
expireDate:"明细-过期时间", |
|||
packingCode:"明细-箱标签", |
|||
}, |
|||
remark:"订单备注", |
|||
} |
|||
|
|||
// 报表地址
|
|||
// const reportsUrl = "http://10.164.1.39:59088/#/reports/";
|
|||
const reportsUrl = localStorage.getItem('reportsUrl') |
|||
// 报表文件地址
|
|||
export const reportsAddress = { |
|||
PurchaseReceiptSummary:reportsUrl + '202211300914188516.rdlx',//采购收货汇总表
|
|||
Inventory_Detail:reportsUrl + '202211291142233052.rdlx',//库存账龄明细
|
|||
InventoryAccountingPeriodDetails:reportsUrl + '202211300913580741.rdlx',//库存单据明细报表
|
|||
FinishedProductDeliverySummary:reportsUrl + '202211300920074461.rdlx',//成品发货汇总表
|
|||
CompletionReceiptSummary:reportsUrl + '202211300919413598.rdlx',//完工收货汇总表
|
|||
UnPlannedReceiptSummary:reportsUrl + '202211300921294414.rdlx',//非生产退料汇总(原计划外入库汇总)
|
|||
UnplannedDeliverSummary:reportsUrl + '202211300921505958.rdlx',//非生产领料汇总(原计划外出库汇总)
|
|||
Scrap_Detail:reportsUrl + '202211300912414755.rdlx',//报废明细表
|
|||
PurchaseSum:reportsUrl + '202211300913268367.rdlx',//订单汇总查询
|
|||
PurchaseReturnSummary:reportsUrl + '202211300925599696.rdlx',//采购退货汇总
|
|||
ProductionReturnSummary:reportsUrl + '202211300918259711.rdlx',//生产退料汇总表
|
|||
ProductionIssueSummary_dy:reportsUrl + '202211300917169689.rdlx',//生产发料汇总表
|
|||
InventoryBlanace:reportsUrl + '202211300922434081.rdlx',//库存余额报表
|
|||
InventorySummary:reportsUrl + '202211300921065163.rdlx',//盘点记录汇总表
|
|||
InventoryAgingSegmentSummary:reportsUrl + '202211300912101560.rdlx',//库存账龄分段汇总表
|
|||
InventoryBookDetail:reportsUrl + '202212162111466911.rdlx',//库存流水帐明细
|
|||
InventoryBookSummary:reportsUrl + '202212162112124488.rdlx',//库存流水帐汇总
|
|||
inventoryBalanceReportLocationCode:reportsUrl + '202211300922434082.rdlx',//库存余额报表按库位
|
|||
inventoryBalanceReportLocationErpCode:reportsUrl + '202211300922434083.rdlx',//库存余额报表按ERP库位
|
|||
InventoryBookSummaryLocation:reportsUrl + '202212162112124489.rdlx',//库存流水帐汇总(库位)
|
|||
} |
@ -1,267 +0,0 @@ |
|||
/** |
|||
* |
|||
* @returns {Array} '权限' |
|||
*/ |
|||
|
|||
export function Roles(val){ |
|||
const role={ |
|||
// 通用
|
|||
"Create": "创建", |
|||
// "Edit": "修改",
|
|||
"Update": "修改", |
|||
"Delete": "删除", |
|||
|
|||
// 身份标识管理(AbpIdentity)
|
|||
"AbpIdentity": "身份标识管理", |
|||
|
|||
// 特性管理(FeatureManagement)
|
|||
"FeatureManagement": "特性管理", |
|||
|
|||
// 设置管理(SettingManagement)
|
|||
"SettingManagement": "设置管理", |
|||
|
|||
// 租户管理(AbpTenantManagement)
|
|||
"AbpTenantManagement": "租户管理", |
|||
|
|||
// 认证(Auth)
|
|||
"Auth": "认证", |
|||
//Auth-子集
|
|||
"Department": "部门", |
|||
/**/ |
|||
|
|||
// 基础数据(Basedata)
|
|||
"Basedata": "基础数据", |
|||
//Basedata-子集
|
|||
"Currency": "货币", |
|||
"CurrencyExchange": "货币兑换", |
|||
"CustomerBom": "用户清单", |
|||
"InventoryRoute": "库存路径", |
|||
"TransactionType": "交易类型", |
|||
"ProductionLineItem": "产品类项目", |
|||
"Machine": "生产线", |
|||
"Param": "参数", |
|||
"PurchasePriceSheet": "采购价格表", |
|||
"Rule": "规则", |
|||
"Strategy": "战略", |
|||
"StrategyRule": "战略规则", |
|||
"Route": "路线", |
|||
"SalePriceSheet": "销售价格表", |
|||
"StdCostPriceSheet": "标准价格表", |
|||
"WorkShop": "车间", |
|||
"WorkGroup": "工作组", |
|||
"ItemGuideBook": "指导书", |
|||
/**/ |
|||
|
|||
// 库存(Inventory)
|
|||
"Inventory": "库存", |
|||
//Inventory-子集
|
|||
"Container": "库存容量", |
|||
"LocationCapacity": "库存可用容量", |
|||
/**/ |
|||
|
|||
// 任务(Job)
|
|||
"Job": "任务", |
|||
//Job-子集
|
|||
"CheckJob": "校验任务", |
|||
"UnplannedIssueJob":"计划外出库任务", |
|||
"UnplannedReceiptJob":"计划外入库任务", |
|||
"ProductionReturnJob":"生产退库任务", |
|||
/**/ |
|||
|
|||
// 仓库(Store)
|
|||
"Store": "仓库", |
|||
//Store-子集
|
|||
"WorkOrder": "工作订单", |
|||
"ProductionReturnNote":"生产退库记录", |
|||
"InventoryTransferNote": "调拨发货", |
|||
"Print":"打印", |
|||
"Shipments": "发货任务(天津)", |
|||
"Instruments": "器具查询(天津)", |
|||
"ReceivingRecords": "收货记录(天津)", |
|||
"DeliveryRecord": "发货记录(天津)", |
|||
"CountAdjust": "库存调整", |
|||
"UnplannedIssueRequest":"非生产退料申请", |
|||
"UnplannedReceiptRequest":"非生产领料申请", |
|||
"ProductionReturnRequest":"生产退库申请", |
|||
"PurchaseReturnRequest": "采购退货申请", |
|||
"ProductRecycleRequest": "成品回收申请", |
|||
"NoOkConvertOkNote":"不合格转合格", |
|||
"PutawayRequest": "上架申请", |
|||
/**/ |
|||
|
|||
// 标签(Label)
|
|||
"labelsList":"标签查询", |
|||
"Label": "标签", |
|||
//Label-子集
|
|||
"PalletLabel":"托盘标签", |
|||
"ProductionLabel":"生产标签", |
|||
"PurchaseLabel":"采购标签", |
|||
"SaleLabel":"销售标签", |
|||
"PalletCode":"托盘编码", |
|||
"SerialCode":"序列代码", |
|||
"CountLabel":"盘点标签", |
|||
/**/ |
|||
|
|||
// 消息通知(Message)
|
|||
"Message": "消息通知", |
|||
//Message-子集
|
|||
"Announcement":"公告", |
|||
"NotifyMessage":"通知", |
|||
"PrivateMessage":"私人消息", |
|||
"MessageType":"消息类型", |
|||
"MessageTypeSubscribe":"消息订阅类型", |
|||
"UserNotifyMessage":"用户通知消息", |
|||
/**/ |
|||
|
|||
// 文件存储(FileStorage)
|
|||
"FileStorage":"文件存储", |
|||
//FileStorage-子集
|
|||
"DataImportTask":"数据导入任务", |
|||
"DataExportTask":"数据导出任务", |
|||
/**/ |
|||
|
|||
// 以下数据为接口已翻译20221103
|
|||
/**/ |
|||
//Basedata基础数据-子集
|
|||
// "Warehouse": "仓库",
|
|||
// "Area": "区域",
|
|||
// "AreaItem": "区域零件",
|
|||
// "Bom": "物品清单",
|
|||
// "InterfaceCalendar": "日历接口",
|
|||
// "Calendar": "日历",
|
|||
// "Company": "公司",
|
|||
// "Customer": "客户",
|
|||
// "CustomerItem": "客户物品",
|
|||
// "WorkStation": "工作中心",
|
|||
// "Team": "班组",
|
|||
// "Supplier": "供应商",
|
|||
// "SupplierItem": "供应商物品",
|
|||
// "Project": "项目",
|
|||
// "Shift": "班次",
|
|||
// "Uom": "计量单位",
|
|||
// "ItemBasic": "物品基础信息",
|
|||
// "ItemCategory": "物品分类信息",
|
|||
// "ItemPack": "物品包装信息",
|
|||
// "Category": "分类",
|
|||
// "Dock": "收货口",
|
|||
// "LocationGroup": "库位组",
|
|||
// "Location": "库位",
|
|||
// "ProductionLine": "生产线",
|
|||
// "Configuration": "配置",
|
|||
// "ItemQuality": "物品质量信息",
|
|||
// "AQL": "物品质检标准",
|
|||
// "SupplierTimeWindow": "供应商时间窗口",
|
|||
// "ItemStoreRelation": "库位零件关系维护",
|
|||
// "CustomerAddress": "客户地址",
|
|||
/**/ |
|||
//Inventory库存-子集
|
|||
// "Balance": "库存余额",
|
|||
// "Snapshot": "库存快照",
|
|||
// "Transaction": "库存事务",
|
|||
// "TransferLog": "库存转移日志",
|
|||
/**/ |
|||
//Job任务-子集
|
|||
// "PurchaseReceiptJob": "采购收货任务",
|
|||
// "InspectJob": "检验任务",
|
|||
// "PutawayJob": "上架任务",
|
|||
// "IssueJob": "发料任务",
|
|||
// "DeliverJob": "发货任务",
|
|||
// "PurchaseReturnJob": "采购退货任务",
|
|||
// "ProductReceiveJob": "完工收货任务",
|
|||
// "CountJob": "盘点任务",
|
|||
/**/ |
|||
//Store仓库-子集
|
|||
// "PurchaseOrder": "采购订单",
|
|||
// "SaleOrder": "销售订单",
|
|||
// "SupplierAsn": "供应商ASN",
|
|||
// "CustomerAsn": "客户发货通知",
|
|||
// "ProductionPlan": "生产计划",
|
|||
// "PreparationPlan": "备料计划",
|
|||
// "ProductReceiptNote": "完工收货记录",
|
|||
// "OfflineSettlementNote": "下线结算记录",
|
|||
// "PurchaseReceiptRequest": "到货请求",
|
|||
// "PurchaseReceiptNote": "采购收货记录",
|
|||
// "ReceiptAbnormalNote": "收货异常记录",
|
|||
// "PurchaseReturnNote": "采购退货记录",
|
|||
// "PutawayNote": "上架记录",
|
|||
// "MaterialRequest": "要料申请",
|
|||
// "IssueNote": "发料记录",
|
|||
// "UnplannedReceiptNote": "计划外入库记录",
|
|||
// "UnplannedIssueNote": "计划外出库记录",
|
|||
// "IsolationNote": "隔离记录",
|
|||
// "ScrapNote": "报废记录",
|
|||
// "DeliverPlan": "发货计划",
|
|||
// "DeliverRequest": "发货申请",
|
|||
// "DeliverNote": "发货记录",
|
|||
// "CountPlan": "盘点计划",
|
|||
// "CountNote": "盘点记录",
|
|||
// "CountAdjustNote": "盘点差异调整记录",
|
|||
// "InspectRequest": "报检单",
|
|||
// "InspectNote": "检验记录",
|
|||
// "InspectAbnormalNote": "质量异常记录",
|
|||
// "ProductRecycleNote": "成品回收记录",
|
|||
// "CustomerReturnNote": "客户退库记录",
|
|||
/**/ |
|||
|
|||
// 以下数据接口数据不存在20221103
|
|||
/**/ |
|||
// "InventoryLocationCapacity": "库位可用容量",
|
|||
// "Workshop": "车间",
|
|||
// "FISDeliverRequest":"FIS发货申请",
|
|||
// "FISDeliverNote":"FIS发货记录",
|
|||
// "Occupied": "已占用库存",
|
|||
// "Predictable": "预填充库存",
|
|||
// "TracebackNote": "追溯记录",
|
|||
// "StockReturnNote": "退库记录",
|
|||
// "UserManage": "用户",
|
|||
// "RoleManage": "权限控制",
|
|||
// "Identity": "身份",
|
|||
// "management": "管理",
|
|||
// "Role management": "角色",
|
|||
// // "Change": "修改",
|
|||
// "Change permissions": "修改权限",
|
|||
// "User management": "用户",
|
|||
// "Manage Host features": "管理主机功能",
|
|||
// "Tenant management": "租户",
|
|||
// "Manage features": "管理功能",
|
|||
// "Manage connection strings": "管理连接",
|
|||
// "Permission": "权限",
|
|||
// "PdaUserManage": "PDA控制",
|
|||
// "Param": "参数",
|
|||
// "Rule ": "规则",
|
|||
// "DocumentSetting": "文档设置",
|
|||
// "ItemSafetyStock": "物品安全库存",
|
|||
// // "UserDepartment": "用户部门对应关系",
|
|||
// "accountPeriodNote": "账期信息",
|
|||
// "UserNotifyMessage":"用户消息类型关系",
|
|||
// //调拨-线边仓
|
|||
// "lineSideWarehouseAllocationRequest":"线边仓调拨申请",
|
|||
// "lineSideWarehouseAllocationConfirm":"线边仓调拨确认",
|
|||
// "lineSideWarehouseAllocationNote":"线边仓调拨记录",
|
|||
// //调拨-储位间
|
|||
// "interStorageAllocationApply":"储位间调拨申请",
|
|||
// "interStorageAllocationConfirm":"储位间调拨确认",
|
|||
// "interStorageAllocationNote":"储位间调拨记录",
|
|||
// //调拨-客户储位
|
|||
// "customerStorageAllocationRequest":"客户储位调拨申请",
|
|||
// "customerStorageAllocationConfirm":"客户储位调拨确认",
|
|||
// "customerStorageAllocationNote":"客户储位调拨记录",
|
|||
// //东阳-追溯记录
|
|||
// "backFlushNote":"追溯记录",
|
|||
// //东阳-退拆
|
|||
// "customerDismantle":"退拆申请",
|
|||
// "customerDismantleNote":"退拆记录",
|
|||
// //回收料
|
|||
// "materialsAdjustment":"回收料调整记录",
|
|||
// "recycledMaterialsAdjustmentApply":"回收料调整申请",
|
|||
// "recycledMaterialsReceipt":"回收料收货记录",
|
|||
// // 自定义
|
|||
// "beforeGroundingReturnNote": "上架前退货记录",
|
|||
// // 非生产领料
|
|||
// "pickingRequest":"非生产领料申请",
|
|||
// // 非生产退料
|
|||
// "materialReturnRequest":"非生产退料申请"
|
|||
} |
|||
return role[val] |
|||
} |
|||
|
@ -1,7 +1,5 @@ |
|||
import * as status from "./status" |
|||
import * as options from "./options" |
|||
const filters = { |
|||
...status, |
|||
...options |
|||
...status |
|||
} |
|||
export default filters |
|||
|
@ -1,90 +0,0 @@ |
|||
import router from './router' |
|||
import store from './store' |
|||
import { |
|||
Message |
|||
} from 'element-ui' |
|||
import NProgress from 'nprogress' // progress bar
|
|||
import 'nprogress/nprogress.css' // progress bar style
|
|||
import { |
|||
getToken |
|||
} from '@/utils/auth' // get token from cookie
|
|||
import getPageTitle from '@/utils/get-page-title' |
|||
import { |
|||
asyncRoutes |
|||
} from '@/router' |
|||
|
|||
NProgress.configure({ |
|||
showSpinner: false |
|||
}) // NProgress Configuration
|
|||
|
|||
const whiteList = ['/login', '/auth-redirect', '/testForm'] // no redirect whitelist
|
|||
|
|||
router.beforeEach(async (to, from, next) => { |
|||
// 添加路由信息,方便代码修改定位
|
|||
// console.log('----------------' + to.meta.title + '-----------------------'+ to.fullPath.substring(to.fullPath.lastIndexOf('-')+1,to.fullPath.length) + '.vue' );
|
|||
// start progress bar
|
|||
NProgress.start() |
|||
|
|||
// set page title
|
|||
document.title = getPageTitle() |
|||
next() |
|||
// determine whether the user has logged in
|
|||
// todo-new:等获取token接口恢复后做处理
|
|||
const hasRoles =await store.getters.roles && await store.getters.roles.length > 0 |
|||
if (hasRoles) { |
|||
next() |
|||
} else { |
|||
try { |
|||
// get user info
|
|||
// note: roles must be a object array! such as: ['admin'] or ,['developer','editor']
|
|||
|
|||
// 如果缓存中没有 interfaceBoardColumnsNames(接口监控看板表头信息) 的缓存数据 则退出登录
|
|||
let _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") |
|||
if(!_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ |
|||
await store.dispatch('user/logout') |
|||
next(`/login?redirect=${to.path}`) |
|||
NProgress.done() |
|||
} |
|||
|
|||
const { |
|||
roles |
|||
} = await store.dispatch('user/getInfo') |
|||
// generate accessible routes map based on roles
|
|||
|
|||
// const accessRoutes = await store.dispatch('permission/generateRoutes', localStorage.getItem('userId'))
|
|||
// router.addRoutes(accessRoutes)
|
|||
|
|||
// 原码 防止刷新出现空白页(系统暂无出现所以注释)
|
|||
// const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
|
|||
// router.addRoutes(accessRoutes)
|
|||
|
|||
// hack method to ensure that addRoutes is complete
|
|||
// set the replace: true, so the navigation will not leave a history record
|
|||
next({ |
|||
...to, |
|||
replace: true |
|||
}) |
|||
} catch (error) { |
|||
// remove token and go to login page to re-login
|
|||
await store.dispatch('user/resetToken') |
|||
Message.error(error || 'Has Error') |
|||
next(`/login?redirect=${to.path}`) |
|||
NProgress.done() |
|||
} |
|||
} |
|||
}) |
|||
|
|||
router.afterEach(() => { |
|||
// element-ui 使用 Tooltip 提示时候,更换页面,提示依旧存在偶现bug处理。
|
|||
const mytooltipList = document.querySelectorAll('.el-tooltip__popper') // 获取页面所有tooltip的dom集合
|
|||
setTimeout(() => { |
|||
mytooltipList.forEach((value) => { |
|||
value.style.display = 'none' |
|||
if(value.parentElement){ |
|||
value.parentElement.removeChild(value) |
|||
} |
|||
}) |
|||
}, 1000) |
|||
// finish progress bar
|
|||
NProgress.done() |
|||
}) |
@ -0,0 +1,178 @@ |
|||
import router from './router' |
|||
import store from './store' |
|||
import { Message } from 'element-ui' |
|||
import NProgress from 'nprogress' // progress bar
|
|||
import 'nprogress/nprogress.css' // progress bar style
|
|||
import { getToken } from '@/utils/auth' // get token from cookie
|
|||
import getPageTitle from '@/utils/get-page-title' |
|||
import { asyncRoutes } from '@/router' |
|||
import { login,getUsersByUserName } from "@/api/wms-auth" |
|||
|
|||
NProgress.configure({ |
|||
showSpinner: false |
|||
}) // NProgress Configuration
|
|||
|
|||
router.beforeEach(async (to, from, next) => { |
|||
// start progress bar
|
|||
NProgress.start() |
|||
// set page title
|
|||
document.title = getPageTitle() |
|||
|
|||
// 获取枚举数据
|
|||
if(!store.getters.enumList || store.getters.enumList.length <= 0){ |
|||
await store.dispatch('definition/getDefinitionConfig') |
|||
} |
|||
|
|||
// // 获取表头转义
|
|||
// if(!store.getters.columZHList || store.getters.columZHList.length <= 0){
|
|||
// await store.dispatch('definition/getColumZHList')
|
|||
// }
|
|||
|
|||
// 判断是否自动登录
|
|||
let isAutoLogin = JSON.parse(localStorage.getItem('isAutoLogin')) |
|||
const interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") |
|||
// 如果路径中有isAutoLogin参数则优先,否则读取配置文件中的isAutoLogin参数
|
|||
let _url_isAutoLogin = to.query.isAutoLogin |
|||
if( _url_isAutoLogin== 'false' || _url_isAutoLogin == 'true'){ |
|||
isAutoLogin = JSON.parse(_url_isAutoLogin) |
|||
} |
|||
// 是否有用户信息:
|
|||
const userInfo = store.getters.currentUserInfo |
|||
// 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页)
|
|||
// 2、有/没有:则检查是否有api接口的表头数据,没有的话重新获取
|
|||
if(userInfo){ |
|||
console.log('有store.getters.currentUserInfo',store.getters.currentUserInfo) |
|||
if(store.getters.permission_routes && store.getters.permission_routes.length > 0){ |
|||
console.log('有store.getters.permission_routes',store.getters.permission_routes) |
|||
next() |
|||
} |
|||
else{ |
|||
console.log('没有store.getters.permission_routes',store.getters.permission_routes) |
|||
const accessRoutes = await store.dispatch('permission/getApiColumnsNames') |
|||
router.addRoutes(accessRoutes) |
|||
next({ |
|||
...to, |
|||
query:{ |
|||
loginName:to.query.loginName, |
|||
isAutoLogin:to.query.isAutoLogin, |
|||
isSinglePage:to.query.isSinglePage |
|||
}, |
|||
replace: true |
|||
}) |
|||
} |
|||
}else{ |
|||
// console.log('没有store.getters.currentUserInfo',store.getters.currentUserInfo)
|
|||
if(!interfaceBoardColumnsNames){ |
|||
console.log('没有interfaceBoardColumnsNames',interfaceBoardColumnsNames) |
|||
await store.dispatch('definition/getColumZHList') |
|||
// const accessRoutes = await store.dispatch('permission/getApiColumnsNames')
|
|||
// router.addRoutes(accessRoutes)
|
|||
next({ |
|||
...to, |
|||
query:{ |
|||
loginName:to.query.loginName, |
|||
isAutoLogin:to.query.isAutoLogin, |
|||
isSinglePage:to.query.isSinglePage |
|||
}, |
|||
replace: true |
|||
}) |
|||
} |
|||
if(isAutoLogin || to.query.loginName){ |
|||
console.log('有自动登录',isAutoLogin,to.query.loginName) |
|||
// let loginForm= {
|
|||
// userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"),
|
|||
// password:localStorage.getItem("client_secret"),
|
|||
// // rememberMe:true,
|
|||
// // grant_type: 'password',
|
|||
// // client_id: 'Auth_App',
|
|||
// }
|
|||
// // store.dispatch('user/login', loginForm).then(() => {
|
|||
// login(loginForm).then(()=>{
|
|||
let _username = to.query.loginName || localStorage.getItem("isLoginName") || localStorage.getItem("userNameOrEmailAddress") |
|||
if(to.path != '/login'){ |
|||
await store.dispatch('user/getUserInfo',_username).then(()=>{ |
|||
next({ |
|||
...to, |
|||
query:{ |
|||
loginName:to.query.loginName, |
|||
isAutoLogin:to.query.isAutoLogin, |
|||
isSinglePage:to.query.isSinglePage |
|||
}, |
|||
replace: true |
|||
}) |
|||
}).catch(()=>{ |
|||
next() |
|||
// next({
|
|||
// path:'/login',
|
|||
// query:{
|
|||
// isAutoLogin:to.query.isAutoLogin,
|
|||
// isSinglePage:to.query.isSinglePage
|
|||
// },
|
|||
// replace: true
|
|||
// })
|
|||
// next(`/login?loginName=${to.query.loginName}&isAutoLogin=${to.query.isAutoLogin}`)
|
|||
// next(`/login`)
|
|||
Message.error('获取用户信息失败,请重试!') |
|||
}) |
|||
}else{ |
|||
next() |
|||
// next({
|
|||
// ...to,
|
|||
// query:{
|
|||
// loginName:to.query.loginName,
|
|||
// isAutoLogin:to.query.isAutoLogin,
|
|||
// isSinglePage:to.query.isSinglePage
|
|||
// },
|
|||
// replace: true
|
|||
// })
|
|||
} |
|||
// })
|
|||
// .catch((error) => {
|
|||
// console.log('登录失败')
|
|||
// })
|
|||
} |
|||
else{ |
|||
console.log('不自动登录',isAutoLogin,to.query.loginName) |
|||
if (to.path != '/login') { |
|||
Message.error('获取用户信息失败,请重新登录') |
|||
next({ |
|||
path:'/login', |
|||
query:{ |
|||
isAutoLogin:to.query.isAutoLogin, |
|||
loginName:to.query.loginName, |
|||
isSinglePage:to.query.isSinglePage |
|||
}, |
|||
replace: true |
|||
}) |
|||
// next(`/login?loginName=${to.query.loginName}&isAutoLogin=${to.query.isAutoLogin}`)
|
|||
// next(`/login`)
|
|||
}else{ |
|||
// next({
|
|||
// ...to,
|
|||
// query:{
|
|||
// isAutoLogin:to.query.isAutoLogin,
|
|||
// loginName:to.query.loginName,
|
|||
// },
|
|||
// replace: true
|
|||
// })
|
|||
next() |
|||
} |
|||
} |
|||
NProgress.done() |
|||
} |
|||
}) |
|||
|
|||
router.afterEach(() => { |
|||
// element-ui 使用 Tooltip 提示时候,更换页面,提示依旧存在偶现bug处理。
|
|||
const mytooltipList = document.querySelectorAll('.el-tooltip__popper') // 获取页面所有tooltip的dom集合
|
|||
setTimeout(() => { |
|||
mytooltipList.forEach((value) => { |
|||
value.style.display = 'none' |
|||
if(value.parentElement){ |
|||
value.parentElement.removeChild(value) |
|||
} |
|||
}) |
|||
}, 1000) |
|||
// finish progress bar
|
|||
NProgress.done() |
|||
}) |
@ -0,0 +1,193 @@ |
|||
import Vue from 'vue' |
|||
import Router from 'vue-router' |
|||
|
|||
|
|||
Vue.use(Router) |
|||
|
|||
/* Layout */ |
|||
import Layout from '@/layout' |
|||
|
|||
/* Router Modules */ |
|||
import baseConfig from './modules/baseConfig' |
|||
import interfaceBoardRouter from './modules/interfaceBoard' |
|||
import systemManage from './modules/systemManage' |
|||
|
|||
/** |
|||
* Note: sub-menu only appear when route children.length >= 1 |
|||
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
|
|||
* |
|||
* hidden: true if set true, item will not show in the sidebar(default is false) |
|||
* alwaysShow: true if set true, will always show the root menu |
|||
* if not set alwaysShow, when item has more than one children route, |
|||
* it will becomes nested mode, otherwise not show the root menu |
|||
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb |
|||
* name:'router-name' the name is used by <keep-alive> (must set!!!) |
|||
* meta : { |
|||
roles: ['admin','editor'] control the page roles (you can set multiple roles) |
|||
title: 'title' the name show in sidebar and breadcrumb (recommend set) |
|||
icon: 'svg-name'/'el-icon-x' the icon show in the sidebar |
|||
noCache: true if set true, the page will no be cached(default is false) |
|||
affix: true if set true, the tag will affix in the tags-view |
|||
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true) |
|||
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set |
|||
} |
|||
*/ |
|||
|
|||
/** |
|||
* constantRoutes |
|||
* a base page that does not have permission requirements |
|||
* all roles can be accessed |
|||
*/ |
|||
export let constantRoutes = [ |
|||
{ |
|||
path: '/redirect', |
|||
component: Layout, |
|||
hidden: true, |
|||
children: [{ |
|||
path: '/redirect/:path(.*)', |
|||
component: () => import('@/views/redirect/index') |
|||
}] |
|||
}, |
|||
{ |
|||
path: '/login', |
|||
component: () => import('@/views/login/index'), |
|||
hidden: true |
|||
}, |
|||
{ |
|||
path: '/404', |
|||
component: () => import('@/views/error-page/404'), |
|||
hidden: true |
|||
}, |
|||
{ |
|||
path: '/401', |
|||
component: () => import('@/views/error-page/401'), |
|||
hidden: true |
|||
}, |
|||
{ |
|||
path: '/profileuser', |
|||
component: Layout, |
|||
redirect: '/profileuser/index', |
|||
hidden: true, |
|||
children: [{ |
|||
path: 'index', |
|||
component: () => import('@/views/profileuser/index'), |
|||
name: 'Profileuser', |
|||
meta: { |
|||
title: '个人中心', |
|||
icon: 'user', |
|||
noCache: true |
|||
} |
|||
}] |
|||
}, |
|||
{ |
|||
path: '/', |
|||
component: Layout, |
|||
redirect: '/dashboard', |
|||
// hidden: true,
|
|||
children: [{ |
|||
path: 'dashboard', |
|||
component: () => import('@/views/dashboard/index'), |
|||
name: 'Dashboard', |
|||
meta: { |
|||
keepAlive : true, |
|||
title: '系统首页', |
|||
icon: '系统首页', |
|||
outerFirst:true |
|||
// affix: true
|
|||
} |
|||
}] |
|||
}, |
|||
// 系统
|
|||
// {
|
|||
// path: '/systemManage',
|
|||
// component: Layout,
|
|||
// redirect: 'noRedirect',
|
|||
// meta: {
|
|||
// title: '系统权限管理11111',
|
|||
// icon: '系统权限控制',
|
|||
// roles:'skip'
|
|||
// },
|
|||
// children: [{
|
|||
// path: 'UserManage',
|
|||
// name: 'userManage',
|
|||
// component: () => import('@/views/systemManage/userManage'),
|
|||
// meta: {
|
|||
// title: '用户信息维护',
|
|||
// icon: '用户',
|
|||
// roles: 'AbpIdentity.Users'
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// path: 'RoleManage',
|
|||
// name: 'roleManage',
|
|||
// component: () => import('@/views/systemManage/roleManage'),
|
|||
// meta: {
|
|||
// title: 'PC权限信息维护',
|
|||
// icon: '权限控制',
|
|||
// roles: 'AbpIdentity.Roles'
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// path: 'pcMenu',
|
|||
// name: 'pcMenu',
|
|||
// // hidden: true,
|
|||
// component: () => import('@/views/systemManage/pcMenu'),
|
|||
// meta: {
|
|||
// title: 'PC权限菜单',
|
|||
// icon: 'PDA权限菜单',
|
|||
// roles: 'Auth.Menu'
|
|||
// }
|
|||
// },
|
|||
// {
|
|||
// path: 'UserWorkGroup',
|
|||
// name: 'UserWorkGroup',
|
|||
// // hidden: true,
|
|||
// component: () => import('@/views/systemManage/userWorkGroup'),
|
|||
// meta: {
|
|||
// title: '用户工作组对应关系',
|
|||
// icon: '用户工作组对应关系',
|
|||
// roles: 'Auth.UserWorkGroup'
|
|||
// }
|
|||
// },
|
|||
// ]
|
|||
// }
|
|||
] |
|||
|
|||
/** |
|||
* asyncRoutes |
|||
* the routes that need to be dynamically loaded based on user roles |
|||
*/ |
|||
// 动态获取菜单信息
|
|||
export let asyncRoutes = [ |
|||
/** when your routing map is too long, you can split it into small modules **/ |
|||
// 404 page must be placed at the end !!!
|
|||
baseConfig, |
|||
interfaceBoardRouter, |
|||
systemManage, |
|||
{ |
|||
path: '*', |
|||
redirect: '/404', |
|||
hidden: true |
|||
} |
|||
] |
|||
|
|||
const createRouter = () => new Router({ |
|||
// mode: 'history', // require service support
|
|||
scrollBehavior: () => ({ |
|||
y: 0 |
|||
}), |
|||
// todo-new:有token后使用去掉下一行代码
|
|||
routes: constantRoutes.concat(asyncRoutes) |
|||
// todo-new:有token后使打开下方代码,并检查是否有效
|
|||
// routes: constantRoutes
|
|||
}) |
|||
|
|||
const router = createRouter() |
|||
|
|||
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
|||
export function resetRouter() { |
|||
const newRouter = createRouter() |
|||
router.matcher = newRouter.matcher // reset router
|
|||
} |
|||
|
|||
export default router |
@ -1,25 +0,0 @@ |
|||
import Layout from '@/layout' |
|||
import { initFromApiColumnsLable } from '@/utils/index' |
|||
const interfaceBoardRouter = { |
|||
path: '/basicConfig', |
|||
alwaysShow:true, |
|||
component: Layout, |
|||
redirect: 'noRedirect', |
|||
meta: { |
|||
title: '基础数据管理', |
|||
icon: '基础数据管理', |
|||
roles:'skip' |
|||
}, |
|||
children: [{ |
|||
path: 'ExportCustomUserSetting', |
|||
name: 'ExportCustomUserSetting', |
|||
component: () => import('@/views/basicConfig/ExportCustomUserSetting'), |
|||
meta: { |
|||
title: initFromApiColumnsLable('ExportCustomUserSetting'),//导出配置
|
|||
icon: '用户', |
|||
roles: 'skip' |
|||
} |
|||
}, |
|||
] |
|||
} |
|||
export default interfaceBoardRouter |
@ -1,25 +0,0 @@ |
|||
import Layout from '@/layout' |
|||
import { initFromApiColumnsLable } from '@/utils/index' |
|||
const interfaceBoardRouter = { |
|||
path: '/interfaceBoard', |
|||
alwaysShow:true, |
|||
component: Layout, |
|||
redirect: 'noRedirect', |
|||
meta: { |
|||
title: '接口看板管理', |
|||
icon: '报表查看', |
|||
roles:'skip' |
|||
}, |
|||
children: [{ |
|||
path: 'TestSchool', |
|||
name: 'TestSchool', |
|||
component: () => import('@/views/interfaceBoard/TestSchool'), |
|||
meta: { |
|||
title: initFromApiColumnsLable('TestSchool'), |
|||
icon: '用户', |
|||
roles: 'skip' |
|||
} |
|||
}, |
|||
] |
|||
} |
|||
export default interfaceBoardRouter |
@ -1,44 +0,0 @@ |
|||
import Layout from '@/layout' |
|||
const systemManageRouter = { |
|||
path: '/systemManage', |
|||
component: Layout, |
|||
redirect: 'noRedirect', |
|||
meta: { |
|||
title: '系统权限管理', |
|||
icon: '系统权限控制', |
|||
roles:'skip' |
|||
}, |
|||
children: [{ |
|||
path: 'UserManage', |
|||
name: 'userManage', |
|||
component: () => import('@/views/systemManage/userManage'), |
|||
meta: { |
|||
title: '用户信息维护', |
|||
icon: '用户', |
|||
roles: 'AbpIdentity.Users' |
|||
} |
|||
}, |
|||
{ |
|||
path: 'RoleManage', |
|||
name: 'roleManage', |
|||
component: () => import('@/views/systemManage/roleManage'), |
|||
meta: { |
|||
title: '权限信息维护', |
|||
icon: '权限控制', |
|||
roles: 'AbpIdentity.Roles' |
|||
} |
|||
}, |
|||
// {
|
|||
// path: 'pcMenu',
|
|||
// name: 'pcMenu',
|
|||
// // hidden: true,
|
|||
// component: () => import('@/views/systemManage/pcMenu'),
|
|||
// meta: {
|
|||
// title: 'PC权限菜单',
|
|||
// icon: 'PDA权限菜单',
|
|||
// roles: 'Auth.Menu'
|
|||
// }
|
|||
// },
|
|||
] |
|||
} |
|||
export default systemManageRouter |
@ -0,0 +1,124 @@ |
|||
import { getInterfaceBoard,getApiDefinition } from "@/api/wms-interface" |
|||
|
|||
const state = { |
|||
enumList: [],//枚举
|
|||
columZHList:null,//表头转义
|
|||
dtoColumnTypes:[],//所有页面的dto类型
|
|||
} |
|||
|
|||
const mutations = { |
|||
// 设置枚举
|
|||
SET_ENUM_LIST: (state, data) => { |
|||
state.enumList=data |
|||
}, |
|||
// 设置表头转义
|
|||
SET_COLUMZH_LIST: (state, data) => { |
|||
state.columZHList=data |
|||
}, |
|||
// 所有页面的dto类型
|
|||
SET_DTOCOLUMN_TYPES: (state, data) => { |
|||
state.dtoColumnTypes=data |
|||
}, |
|||
} |
|||
|
|||
// 通过url做方法处理转换(S/C/U/G等)目前只做了S查询。如果有需要在丰富
|
|||
export function initDtoTypeByUrl(url){ |
|||
if(url.indexOf('get-list-page-by-filter') >= 0){ |
|||
return "S" |
|||
}else{ |
|||
return url |
|||
} |
|||
} |
|||
|
|||
// DTO类型转义
|
|||
export function initDtoColumnTypes(res) { |
|||
// modules>app>controller>这里是所有的接口
|
|||
let _controller = res.modules.app.controllers |
|||
let _allData = {} |
|||
for(let item in _controller){ |
|||
let _com = 'AppService' |
|||
// 获取简单的api(路由,如:IncomingData)
|
|||
let _api = item.substring(item.lastIndexOf('.') + 1,item.length - _com.length) |
|||
let _item = { |
|||
S:{ |
|||
dtoList:[], |
|||
dtoType: 'S', |
|||
dtoName:item.substring(0,item.length - _com.length), |
|||
columnsType:null |
|||
} |
|||
} |
|||
for(let ac in _controller[item].actions){ |
|||
let _actions = _controller[item].actions[ac] |
|||
// actions下通过URL匹配 做特殊处理
|
|||
// 查询处理
|
|||
if(initDtoTypeByUrl(_actions.url) == 'S'){ |
|||
let _type = _actions.returnValue.type |
|||
let _type_value = _type.substring(_type.indexOf('<') + 1,_type.indexOf('>')) |
|||
_item.S.columnsType=_type_value |
|||
// 通过returnValue.type 在 res.types 中获取全部的dto
|
|||
let _dtos = res.types[_type_value].properties |
|||
_dtos.forEach(d=>{ |
|||
// 如果是枚举做处理(目前枚举只根据Enums做处理,todo:是否需要其他处理)
|
|||
if(d.type.indexOf('Enums') >= 0){ |
|||
d.apiBaseType = 'enums' |
|||
d.isEnums = true |
|||
// -1 是去掉最后的'?'(todo:是否每个Enums类型都有?)
|
|||
let enums_type = d.type.substring(0,d.type.length - 1) |
|||
// 通过type包含Enums的全字段-'?'匹配res.types中的值
|
|||
let enums_list = res.types[enums_type] |
|||
if(enums_list){ |
|||
d.enums_list = [] |
|||
enums_list.enumValues.forEach((e,key)=>{ |
|||
d.enums_list.push({value:e,label:enums_list.enumNames[key]}) |
|||
}) |
|||
} |
|||
}else{ |
|||
if(d.typeSimple == 'number' || d.typeSimple == 'number?'){ |
|||
d.apiBaseType='number' |
|||
}else{ |
|||
let _end_index = d.type.lastIndexOf('?') >= 0 ? d.type.lastIndexOf('?') : d.type.length |
|||
d.apiBaseType = d.type.substring(d.type.lastIndexOf('.') + 1, _end_index).toLowerCase() |
|||
} |
|||
if(d.type.indexOf('Guid') >= 0){ |
|||
d.apiBaseType='string' |
|||
} |
|||
} |
|||
}) |
|||
_item.S.dtoList=_dtos |
|||
} |
|||
} |
|||
_allData[_api] = _item |
|||
} |
|||
return _allData |
|||
} |
|||
|
|||
const actions = { |
|||
// 获取枚举
|
|||
getDefinitionConfig({ commit }) { |
|||
return new Promise(resolve => { |
|||
getApiDefinition().then(res=>{ |
|||
commit('SET_DTOCOLUMN_TYPES', initDtoColumnTypes(res)) |
|||
commit('SET_ENUM_LIST', res.types) |
|||
resolve(res) |
|||
}) |
|||
}) |
|||
}, |
|||
// 获取表头转义
|
|||
getColumZHList({ commit }) { |
|||
return new Promise(resolve => { |
|||
getInterfaceBoard().then(res=>{ |
|||
let _zh = res.resources[localStorage.getItem('columnsApiNamesZh')].texts; |
|||
commit('SET_COLUMZH_LIST', _zh) |
|||
resolve(res) |
|||
}) |
|||
}) |
|||
} |
|||
} |
|||
|
|||
export default { |
|||
namespaced: true, |
|||
state, |
|||
mutations, |
|||
actions |
|||
} |
|||
|
@ -0,0 +1,163 @@ |
|||
import { |
|||
asyncRoutes, |
|||
constantRoutes |
|||
} from '@/router' |
|||
import Layout from '@/layout' |
|||
import { getWebMenu } from '@/api/wms-auth' |
|||
/** |
|||
* 静态路由懒加载 |
|||
* @param view 格式必须为 xxx/xxx 开头不要加斜杠 |
|||
* @returns |
|||
*/ |
|||
export const loadView = (view) => { |
|||
return (resolve) => require([`@/views/${view}`], resolve) |
|||
} |
|||
/** |
|||
* 把从后端查询的菜单数据拼装成路由格式的数据 |
|||
* @param routes |
|||
* @param data 后端返回的菜单数据 |
|||
*/ |
|||
export function generaMenu(routes, data) { |
|||
data.forEach(item => { |
|||
const menu = { |
|||
path: item.code, |
|||
component: item.component === '@/layout' ? Layout : loadView(item.component), |
|||
// hidden: item.status === 0, // 状态为0的隐藏
|
|||
children: [], |
|||
name: item.code, |
|||
// meta: item.meta
|
|||
meta: { |
|||
title: item.name, |
|||
icon: item.icon || '', |
|||
roles: item.permission |
|||
}, |
|||
|
|||
} |
|||
// 一级菜单 二级菜单 特定属性
|
|||
if (item.component == '@/layout' || item.component == 'index') { |
|||
menu.alwaysShow = true |
|||
menu.redirect = 'noRedirect' |
|||
} |
|||
if (item.sort < 99) { |
|||
menu.level = 1 |
|||
} else if (item.sort > 99 && item.sort < 9999) { |
|||
menu.level = 2 |
|||
} else { |
|||
menu.level = 3 |
|||
} |
|||
// iframe页面处理
|
|||
// if (item.permission.indexOf('Report') > -1) {
|
|||
// // delete menu.component
|
|||
// menu.iframeComponent = item.component === '@/layout' ? Layout : loadView(item.component)
|
|||
// menu.hasOpen = false // 是否打开过,默认false
|
|||
// }
|
|||
if (item.children && item.children.length > 0) { |
|||
generaMenu(menu.children, item.children) |
|||
} |
|||
// if (item.permission == 'skip' && item.children.length == 0) {
|
|||
// }
|
|||
routes.push(menu) |
|||
}) |
|||
return routes |
|||
} |
|||
|
|||
/** |
|||
* Use meta.role to determine if the current user has permission |
|||
* @param roles |
|||
* @param route |
|||
*/ |
|||
function hasPermission(roles, route) { |
|||
if (route.meta && route.meta.roles) { |
|||
if (route.meta.roles == "skip") { |
|||
return true |
|||
} else { |
|||
return roles.some(role => route.meta.roles.includes(role)) |
|||
} |
|||
} else { |
|||
return false |
|||
} |
|||
} |
|||
const filterAccessedRoutes = (items,indexVal,childrenIndex) => { |
|||
const route = JSON.parse(JSON.stringify(items)) |
|||
route.forEach((val, index) => { |
|||
// debugger;
|
|||
if(val.meta && val.meta.roles == "skip"){ |
|||
if (val.children && val.children.length != 0) { |
|||
filterAccessedRoutes(items[index-indexVal].children,childrenIndex) |
|||
} |
|||
if(items[index-indexVal].children && items[index-indexVal].children.length == 0){ |
|||
items.splice(index-indexVal, 1) |
|||
indexVal++ |
|||
} |
|||
} |
|||
}) |
|||
indexVal = 0 |
|||
} |
|||
/** |
|||
* Filter asynchronous routing tables by recursion |
|||
* @param routes asyncRoutes |
|||
* @param roles |
|||
*/ |
|||
export function filterAsyncRoutes(routes, roles) { |
|||
const res = [] |
|||
routes.forEach(route => { |
|||
const tmp = { |
|||
...route |
|||
} |
|||
if (hasPermission(roles, tmp)) { |
|||
if (tmp.children) { |
|||
tmp.children = filterAsyncRoutes(tmp.children, roles) |
|||
} |
|||
res.push(tmp) |
|||
} |
|||
}) |
|||
return res |
|||
} |
|||
|
|||
const state = { |
|||
routes: [], |
|||
addRoutes: [] |
|||
} |
|||
|
|||
const mutations = { |
|||
SET_ROUTES: (state, routes) => { |
|||
state.addRoutes = routes |
|||
state.routes = constantRoutes.concat(routes) |
|||
} |
|||
} |
|||
// todo-new:有token后使用generateRoutes,去掉下方一行代码
|
|||
state.routes = constantRoutes.concat(asyncRoutes) |
|||
|
|||
const actions = { |
|||
generateRoutes({ |
|||
commit |
|||
}, userId) { |
|||
return new Promise(resolve => { |
|||
// let accessedRoutes = asyncRoutes
|
|||
// // accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
|
|||
// let indexVal = 0
|
|||
// let childrenIndex = 0
|
|||
// filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex)
|
|||
// commit('SET_ROUTES', accessedRoutes)
|
|||
// resolve(accessedRoutes)
|
|||
// todo-new:动态路由(等token接口恢复后处理)
|
|||
getWebMenu({userId: userId}).then(res => { |
|||
let accessedRoutes = generaMenu(asyncRoutes, res) |
|||
let indexVal = 0 |
|||
let childrenIndex = 0 |
|||
filterAccessedRoutes(accessedRoutes,indexVal,childrenIndex) |
|||
commit('SET_ROUTES', accessedRoutes) |
|||
resolve(accessedRoutes) |
|||
}).catch(err => { |
|||
console.log(err) |
|||
}) |
|||
}) |
|||
} |
|||
} |
|||
|
|||
export default { |
|||
namespaced: true, |
|||
state, |
|||
mutations, |
|||
actions |
|||
} |
@ -0,0 +1,9 @@ |
|||
// 此文件为【明细 - 列表】表头从接口缓存的表头
|
|||
|
|||
import { zhApiColumnsLable } from '@/utils/index' |
|||
|
|||
// 测试数据
|
|||
// export const TestSchool = [
|
|||
// { label: zhApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" },
|
|||
// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
|
|||
// ]
|
@ -1,9 +1,10 @@ |
|||
// 此文件为【明细 - 列表】表头从接口缓存的表头
|
|||
// 如果有父级id字段,请设置showProp,避免明细列表内可查询其他主表的明细
|
|||
|
|||
import { initFromApiColumnsLable } from '@/utils/index' |
|||
import { zhApiColumnsLable } from '@/utils/index' |
|||
|
|||
// 测试数据
|
|||
export const TestSchool = [ |
|||
{ label: initFromApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" }, |
|||
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, |
|||
] |
|||
// export const TestSchool = [
|
|||
// { label: zhApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" },
|
|||
// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
|
|||
// ]
|
@ -1,9 +1,9 @@ |
|||
// 此文件为【主表-列表】表头从接口缓存的表头
|
|||
|
|||
import { initFromApiColumnsLable } from '@/utils/index' |
|||
import { zhApiColumnsLable } from '@/utils/index' |
|||
|
|||
// 测试数据
|
|||
export const TestSchool = [ |
|||
{ label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" }, |
|||
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, |
|||
] |
|||
// export const TestSchool = [
|
|||
// { label: zhApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" },
|
|||
// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
|
|||
// ]
|
@ -1,9 +1,9 @@ |
|||
// 此文件为【主表-明细】表头从接口缓存的表头
|
|||
|
|||
import { initFromApiColumnsLable } from '@/utils/index' |
|||
import { zhApiColumnsLable } from '@/utils/index' |
|||
|
|||
// 测试数据
|
|||
export const TestSchool = [ |
|||
{ label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" }, |
|||
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, |
|||
] |
|||
// export const TestSchool = [
|
|||
// { label: zhApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" },
|
|||
// { label: zhApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
|
|||
// ]
|
@ -0,0 +1,221 @@ |
|||
<template> |
|||
<!-- 瀑布流版本布局 + 高度随宽度调整变化 --> |
|||
<el-card class="homeMenuPage" v-resize="setMaxHeight" v-loading="loading"> |
|||
<div class="firstMenuContain homeMenuPage-List"> |
|||
<div |
|||
class="firstMenuItem menuItem" |
|||
v-for="(item,index) in navList" |
|||
:key="index" |
|||
> |
|||
<div class="firstTitle" v-if="item.meta"> |
|||
<div class="icon"><svg-icon :icon-class="item.meta.icon" style="fill:currentColor; color:#fff;"/></div> |
|||
<div>{{item.meta.title}}</div> |
|||
</div> |
|||
<ul class="menuInfo" v-if="item.children && item.children.length > 0"> |
|||
<li |
|||
v-for="(item2,index2) in item.children" |
|||
:key="index2" |
|||
> |
|||
<div class="title"> |
|||
{{item2.meta.title}} |
|||
<i class="el-icon-arrow-right"></i> |
|||
</div> |
|||
<!-- 有下级菜单 --> |
|||
<div class="lastList" v-if="item2.children && item2.children.length > 0"> |
|||
<div |
|||
v-for="(item3,index3) in item2.children" |
|||
:key="index3" |
|||
class="item" |
|||
> |
|||
<span @click="goPage(item3)">{{item3.meta.title}}</span> |
|||
</div> |
|||
</div> |
|||
<!-- 如果二级为最后一级,统一格式,补充到children中 --> |
|||
<div class="lastList" v-else> |
|||
<div class="item"> |
|||
<span @click="goPage(item2)">{{item2.meta.title}}</span> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<span class="firstMenuItem break"></span> |
|||
<span class="firstMenuItem break"></span> |
|||
<span class="firstMenuItem break"></span> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
export default { |
|||
directives: { |
|||
// 页面宽度变化,重新计算总高度 |
|||
resize: { // 指令的名称 |
|||
bind(el, binding) { // el为绑定的元素,binding为绑定给指令的对象 |
|||
let width = '', height = ''; |
|||
function isReize() { |
|||
const style = document.defaultView.getComputedStyle(el); |
|||
if (width !== style.width || height !== style.height) { |
|||
binding.value(); // 关键 |
|||
} |
|||
width = style.width; |
|||
height = style.height; |
|||
} |
|||
el.__vueSetInterval__ = setInterval(isReize, 300); |
|||
}, |
|||
unbind(el) { |
|||
clearInterval(el.__vueSetInterval__); |
|||
} |
|||
} |
|||
}, |
|||
name: 'Dashboard', |
|||
data() { |
|||
return { |
|||
loading:true, |
|||
navList:[], |
|||
} |
|||
}, |
|||
watch: { |
|||
permission_routes(val, oldVal) { |
|||
this.initData(val) |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'permission_routes' |
|||
]) |
|||
}, |
|||
mounted(){ |
|||
this.initData(this.permission_routes) |
|||
}, |
|||
methods:{ |
|||
initData(data){ |
|||
data.forEach(item => { |
|||
if(!item.hidden && item.path !== '/') { |
|||
this.navList.push(item) |
|||
} |
|||
}) |
|||
this.$nextTick(()=>{ |
|||
this.setMaxHeight() |
|||
}) |
|||
}, |
|||
goPage(item){ |
|||
this.$router.push({name: item.name}) |
|||
}, |
|||
setMaxHeight(){ |
|||
// todo:用this.$route.path != /dashboard 判断 |
|||
console.log("setMaxHeight",this.$route.path) |
|||
if(document.getElementsByClassName("homeMenuPage-List").length <= 0){ |
|||
return |
|||
} |
|||
let _items = document.getElementsByClassName("menuItem") |
|||
let _left = []; |
|||
let _right = []; |
|||
let _left_num = 0; |
|||
let _right_num = 0; |
|||
_items.forEach((item,key)=>{ |
|||
// 左侧 |
|||
if(key % 2 == 0){ |
|||
_left.push(item.offsetHeight) |
|||
_left_num += Number(item.offsetHeight) |
|||
} |
|||
// 右侧 |
|||
else{ |
|||
_right.push(item.offsetHeight) |
|||
_right_num += Number(item.offsetHeight) |
|||
} |
|||
}) |
|||
let _max = _left_num > _right_num ? _left_num : _right_num |
|||
_max += 20 * _items.length |
|||
document.getElementsByClassName("homeMenuPage-List")[0].style.height = _max + 'px' |
|||
this.loading = false |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
$iconSize:26px; |
|||
.homeMenuPage{ |
|||
height: 100%; |
|||
overflow: auto; |
|||
// padding: 20px 0; |
|||
} |
|||
.firstMenuContain { |
|||
display: flex; |
|||
flex-flow: column wrap; |
|||
align-content: space-between; |
|||
/* 容器必须有固定高度 |
|||
* 且高度大于最高的列高 */ |
|||
// height: 2500px; |
|||
.firstMenuItem { |
|||
width: calc(50% - 20px); |
|||
margin-bottom: 20px; |
|||
|
|||
.firstTitle{ |
|||
display: flex; |
|||
font-weight: bold; |
|||
font-size: 18px; |
|||
.icon{ |
|||
background: #409eff; |
|||
color: #fff; |
|||
border-radius: 4px; |
|||
width: $iconSize; |
|||
height: $iconSize; |
|||
line-height: $iconSize; |
|||
overflow: hidden; |
|||
text-align: center; |
|||
margin-right: 10px; |
|||
} |
|||
} |
|||
|
|||
.menuInfo{ |
|||
background: #f9fafb; |
|||
margin: 20px 0; |
|||
padding: 5px 0; |
|||
li{ |
|||
list-style: none; |
|||
display: flex; |
|||
padding-top: 10px; |
|||
.title{ |
|||
width: 240px; |
|||
text-align: right; |
|||
font-weight: bold; |
|||
flex-shrink: 0; |
|||
.el-icon-arrow-right{ |
|||
font-weight: bold; |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
.lastList{ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
margin-left: 15px; |
|||
.item{ |
|||
margin-right: 25px; |
|||
margin-bottom: 10px; |
|||
cursor: pointer; |
|||
|
|||
&:hover{ |
|||
color: #409eff; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
/* 将内容块重排为4列 */ |
|||
&:nth-of-type(2n+1) { order: 1; } |
|||
&:nth-of-type(2n) { order: 2; } |
|||
|
|||
/* 强制换列 */ |
|||
&.break { |
|||
flex-basis: 100%; |
|||
width: 0; |
|||
margin: 0; |
|||
content: ""; |
|||
padding: 0; |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -1,221 +1,60 @@ |
|||
<template> |
|||
<!-- 瀑布流版本布局 + 高度随宽度调整变化 --> |
|||
<el-card class="homeMenuPage" v-resize="setMaxHeight" v-loading="loading"> |
|||
<div class="firstMenuContain homeMenuPage-List"> |
|||
<div |
|||
class="firstMenuItem menuItem" |
|||
v-for="(item,index) in navList" |
|||
:key="index" |
|||
> |
|||
<div class="firstTitle"> |
|||
<div class="icon"><svg-icon :icon-class="item.meta.icon" style="fill:currentColor; color:#fff;"/></div> |
|||
<div>{{item.meta.title}}</div> |
|||
</div> |
|||
<ul class="menuInfo" v-if="item.children && item.children.length > 0"> |
|||
<li |
|||
v-for="(item2,index2) in item.children" |
|||
:key="index2" |
|||
> |
|||
<div class="title"> |
|||
{{item2.meta.title}} |
|||
<i class="el-icon-arrow-right"></i> |
|||
</div> |
|||
<!-- 有下级菜单 --> |
|||
<div class="lastList" v-if="item2.children && item2.children.length > 0"> |
|||
<div |
|||
v-for="(item3,index3) in item2.children" |
|||
:key="index3" |
|||
class="item" |
|||
> |
|||
<span @click="goPage(item3)">{{item3.meta.title}}</span> |
|||
</div> |
|||
</div> |
|||
<!-- 如果二级为最后一级,统一格式,补充到children中 --> |
|||
<div class="lastList" v-else> |
|||
<div class="item"> |
|||
<span @click="goPage(item2)">{{item2.meta.title}}</span> |
|||
</div> |
|||
</div> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
<span class="firstMenuItem break"></span> |
|||
<span class="firstMenuItem break"></span> |
|||
<span class="firstMenuItem break"></span> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
<div class="dashboardPage"> |
|||
<el-tree |
|||
:data="navList" |
|||
:props="defaultProps" |
|||
@node-click="goPage" |
|||
></el-tree> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
export default { |
|||
directives: { |
|||
// 页面宽度变化,重新计算总高度 |
|||
resize: { // 指令的名称 |
|||
bind(el, binding) { // el为绑定的元素,binding为绑定给指令的对象 |
|||
let width = '', height = ''; |
|||
function isReize() { |
|||
const style = document.defaultView.getComputedStyle(el); |
|||
if (width !== style.width || height !== style.height) { |
|||
binding.value(); // 关键 |
|||
} |
|||
width = style.width; |
|||
height = style.height; |
|||
} |
|||
el.__vueSetInterval__ = setInterval(isReize, 300); |
|||
}, |
|||
unbind(el) { |
|||
clearInterval(el.__vueSetInterval__); |
|||
} |
|||
} |
|||
}, |
|||
name: 'Dashboard', |
|||
data() { |
|||
return { |
|||
loading:true, |
|||
navList:[], |
|||
} |
|||
}, |
|||
watch: { |
|||
permission_routes(val, oldVal) { |
|||
this.initData(val) |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'permission_routes' |
|||
]) |
|||
}, |
|||
mounted(){ |
|||
this.initData(this.permission_routes) |
|||
}, |
|||
methods:{ |
|||
initData(data){ |
|||
data.forEach(item => { |
|||
if(!item.hidden && item.path !== '/') { |
|||
this.navList.push(item) |
|||
} |
|||
}) |
|||
this.$nextTick(()=>{ |
|||
this.setMaxHeight() |
|||
}) |
|||
}, |
|||
goPage(item){ |
|||
this.$router.push({name: item.name}) |
|||
}, |
|||
setMaxHeight(){ |
|||
// todo:用this.$route.path != /dashboard 判断 |
|||
console.log("setMaxHeight",this.$route.path) |
|||
if(document.getElementsByClassName("homeMenuPage-List").length <= 0){ |
|||
return |
|||
} |
|||
let _items = document.getElementsByClassName("menuItem") |
|||
let _left = []; |
|||
let _right = []; |
|||
let _left_num = 0; |
|||
let _right_num = 0; |
|||
_items.forEach((item,key)=>{ |
|||
// 左侧 |
|||
if(key % 2 == 0){ |
|||
_left.push(item.offsetHeight) |
|||
_left_num += Number(item.offsetHeight) |
|||
} |
|||
// 右侧 |
|||
else{ |
|||
_right.push(item.offsetHeight) |
|||
_right_num += Number(item.offsetHeight) |
|||
} |
|||
}) |
|||
let _max = _left_num > _right_num ? _left_num : _right_num |
|||
_max += 20 * _items.length |
|||
document.getElementsByClassName("homeMenuPage-List")[0].style.height = _max + 'px' |
|||
this.loading = false |
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
export default { |
|||
name: 'Dashboard', |
|||
data() { |
|||
return { |
|||
navList:[], |
|||
defaultProps: { |
|||
children: 'children', |
|||
label: 'title' |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
$iconSize:26px; |
|||
.homeMenuPage{ |
|||
height: 100%; |
|||
overflow: auto; |
|||
// padding: 20px 0; |
|||
} |
|||
.firstMenuContain { |
|||
display: flex; |
|||
flex-flow: column wrap; |
|||
align-content: space-between; |
|||
/* 容器必须有固定高度 |
|||
* 且高度大于最高的列高 */ |
|||
// height: 2500px; |
|||
.firstMenuItem { |
|||
width: calc(50% - 20px); |
|||
margin-bottom: 20px; |
|||
|
|||
.firstTitle{ |
|||
display: flex; |
|||
font-weight: bold; |
|||
font-size: 18px; |
|||
.icon{ |
|||
background: #409eff; |
|||
color: #fff; |
|||
border-radius: 4px; |
|||
width: $iconSize; |
|||
height: $iconSize; |
|||
line-height: $iconSize; |
|||
overflow: hidden; |
|||
text-align: center; |
|||
margin-right: 10px; |
|||
} |
|||
} |
|||
|
|||
.menuInfo{ |
|||
background: #f9fafb; |
|||
margin: 20px 0; |
|||
padding: 5px 0; |
|||
li{ |
|||
list-style: none; |
|||
display: flex; |
|||
padding-top: 10px; |
|||
.title{ |
|||
width: 240px; |
|||
text-align: right; |
|||
font-weight: bold; |
|||
flex-shrink: 0; |
|||
.el-icon-arrow-right{ |
|||
font-weight: bold; |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
.lastList{ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
margin-left: 15px; |
|||
.item{ |
|||
margin-right: 25px; |
|||
margin-bottom: 10px; |
|||
cursor: pointer; |
|||
|
|||
&:hover{ |
|||
color: #409eff; |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'permission_routes' |
|||
]) |
|||
}, |
|||
mounted(){ |
|||
this.initData(this.permission_routes) |
|||
}, |
|||
methods:{ |
|||
initData(data){ |
|||
data.forEach(item => { |
|||
if(!item.hidden && item.path !== '/' && item.meta) { |
|||
let _item = { |
|||
title:item.meta.title, |
|||
name:item.name, |
|||
path:item.path, |
|||
children:item.children |
|||
} |
|||
this.navList.push(_item) |
|||
} |
|||
} |
|||
|
|||
/* 将内容块重排为4列 */ |
|||
&:nth-of-type(2n+1) { order: 1; } |
|||
&:nth-of-type(2n) { order: 2; } |
|||
|
|||
/* 强制换列 */ |
|||
&.break { |
|||
flex-basis: 100%; |
|||
width: 0; |
|||
margin: 0; |
|||
content: ""; |
|||
padding: 0; |
|||
} |
|||
} |
|||
if(!item.hidden && item.children){ |
|||
this.initData(item.children) |
|||
} |
|||
}) |
|||
}, |
|||
goPage(item){ |
|||
this.$router.push({name: item.name}) |
|||
}, |
|||
} |
|||
</style> |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
.dashboardPage{ |
|||
padding:30px 10px; |
|||
background: #fff; |
|||
} |
|||
</style> |
@ -0,0 +1,196 @@ |
|||
|
|||
<template> |
|||
<div class="page-box" v-loading="Loading.tableLoading"> |
|||
<!-- DEMO:只有主表 基础的主表增删改查 --> |
|||
<tablePagination |
|||
v-if="apiColumns_Table" |
|||
:currenButtonData="currenButtonData" |
|||
:tableData="tableData" |
|||
:tableLoading="Loading.tableLoading" |
|||
:tableColumns="apiColumns_Table" |
|||
@rowDrop="rowDrop" |
|||
:totalCount="totalCount" |
|||
:multipleSelection="multipleSelection" |
|||
:MaxResultCount="PageListParams.MaxResultCount" |
|||
@topbutton="topbutton" |
|||
@inlineDialog="inlineDialog" |
|||
@sortChange="sortChange" |
|||
@alertoldSkipCount="alertoldSkipCount" |
|||
@alterResultCount="alterResultCount" |
|||
@handleSelectionChange="handleSelectionChange" |
|||
:currentPageProps="oldSkipCount" |
|||
:quicklySearchOption="quicklySearchOption" |
|||
@quicklySearchClick="quicklySearchClick" |
|||
@quicklySearchClear="quicklySearchClear" |
|||
:primarySearchOption="primarySearchOption" |
|||
@overallSearchFormClick="overallSearchFormClick" |
|||
:httpOverallSearchData="httpOverallSearchData" |
|||
:buttonOperationList_left="buttonOperationClick_leftBase" |
|||
@buttonOperationClick_left="buttonOperationClick_left" |
|||
> |
|||
<!-- <div slot="tableTopSlot"> |
|||
上方按钮插槽位置预留 |
|||
</div> |
|||
<div slot="searchPrimarySlot"> |
|||
普通初级搜索插槽位置预留 |
|||
</div> --> |
|||
<!-- <template>表格内容插槽位置预留</template> --> |
|||
</tablePagination> |
|||
<!-- 新增与编辑 --> |
|||
<newAndEdiDialog |
|||
:loading="Loading.newAndEdiLoading" |
|||
:active="active" |
|||
:pageStatus="pageStatus" |
|||
:formReveal="formReveal" |
|||
:formTitle="formTitle" |
|||
:displayDialog="editDialog" |
|||
:FormData="formReveal ? CreateFormData : editFormData" |
|||
:Form="formReveal ? CreateForm : editForm" |
|||
:Options="editOptions" |
|||
:Handle="editHandle" |
|||
:Rules="formReveal ? editRules.cerateRule : editRules.editRule" |
|||
@FormSubmit="FormSubmit" |
|||
@close="FormClose" |
|||
@goBack="goBack" |
|||
></newAndEdiDialog> |
|||
<!-- 搜索按钮——窗体组件 --> |
|||
<searchPage |
|||
ref="searchTable" |
|||
:tableLoading="Loading.autoTableLoading" |
|||
:advancedFilter="advancedFilter()" |
|||
:filterPageListParams="filterPageListParams" |
|||
:formTitle="searchTitle" |
|||
:displayDialog="displayDialog.AddNewDialog" |
|||
:searchTableData="searchData" |
|||
:searchTableColumns="searchColumns" |
|||
:searchTotalCount="searchTotalCount" |
|||
:supplierItemPage="searchPageListParams" |
|||
@handleSelectionChange="prepareFormData" |
|||
@SizeChange="searchAlterResultCount($event, searchPageListParams)" |
|||
@CurrentChange="searchAlertoldSkipCount($event, searchPageListParams)" |
|||
@tableButtonClick="searchSubmit(arguments)" |
|||
></searchPage> |
|||
<!-- 新导入 disabledMethod 导入方式禁用 disabledIsAllowPartImport 是否局部导入禁用--> |
|||
<!-- methodValue 导入方式默认选项 是否局部导入 默认选项 --> |
|||
<importFile |
|||
:loading="Loading.importLoading" |
|||
:show="displayDialog.importDialog" |
|||
:disabledMethod = {method1:false,method2:false,method3:false} |
|||
:disabledIsAllowPartImport = {isAllowPartImport1:false,isAllowPartImport2:false} |
|||
isAllowPartImportValue="1" |
|||
@importClick="postImportMergeClick(arguments)" |
|||
@postImportDown="importDown" |
|||
></importFile> |
|||
<!--抽屉--> |
|||
<curren-Drawer |
|||
ref="currenDrawer_Ref" |
|||
:title="apiColumns_DesTions" |
|||
@rowDrop="rowDrop" |
|||
:tableColumns="apiColumns_DetailsTable" |
|||
:tabsDesTions="apiColumns_DesTions" |
|||
:DrawerLoading="Loading.DrawerLoading" |
|||
:drawer="displayDialog.detailsDialog" |
|||
:propsData="propsData" |
|||
:dropdownData="dropdownData" |
|||
@drawerShut="(val) => (displayDialog.detailsDialog = val)" |
|||
@drawerbutton="drawerbutton" |
|||
@handleCommand="drawerHandle" |
|||
@close-value="closeValue" |
|||
:firstTabs="firstTabs" |
|||
:totalCount="totalCountDetails" |
|||
:currentPage="oldSkipCountDetails" |
|||
:MaxResultCount="MaxResultCountDetails" |
|||
@alterResultCountDetails="alterResultCountDetails" |
|||
@alertoldSkipCountDetails="alertoldSkipCountDetails" |
|||
:buttonOperationList_left="operationButtonsDetail" |
|||
></curren-Drawer> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import { tableMixins } from "@/mixins/TableMixins" |
|||
import { LoadingMixins } from "@/mixins/LoadingMixins" |
|||
import { drawerMixins } from "@/mixins/drawerMixins" |
|||
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins" |
|||
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins" |
|||
import { mixins } from "@/mixins/mixins" |
|||
import { filterSelectMixins } from '@/mixins/filter-Select' |
|||
import { zhApiColumnsLable } from '@/utils/index' |
|||
|
|||
export default { |
|||
name: "ExportCustomUserSetting", |
|||
mixins: [ |
|||
tableMixins, |
|||
LoadingMixins, |
|||
drawerMixins, |
|||
TableHeaderMixins, |
|||
mixins, |
|||
filterSelectMixins, |
|||
newAndEdiDialogMixins |
|||
], |
|||
computed: { |
|||
editDialog: { |
|||
get: function () { |
|||
return this.displayDialog.newDialog || this.displayDialog.editDialog; |
|||
}, |
|||
}, |
|||
}, |
|||
data () { |
|||
const userInfo=this.$store.getters.currentUserInfo |
|||
return { |
|||
tableLoading:false, |
|||
//常用按钮数据 |
|||
currenButtonData: [ |
|||
this.defaultAddBtn(),//新增 |
|||
this.defaultFieldSettingBtn(),//字段设置 |
|||
this.defaultFreshBtn(),//刷新 |
|||
this.defaultFilterBtn(),//筛选 |
|||
], |
|||
//新增 |
|||
CreateFormData: { |
|||
customUserSetting: null, |
|||
exportUserName: userInfo.name, |
|||
exportUserId: userInfo.id, |
|||
exportColumnName: null, |
|||
exportTableName: null, |
|||
}, |
|||
//编辑 |
|||
editFormData: { |
|||
customUserSetting: null, |
|||
exportUserName: userInfo.name, |
|||
exportUserId: userInfo.id, |
|||
exportColumnName: null, |
|||
exportTableName: null, |
|||
}, |
|||
editOptions: {}, |
|||
CreateForm: [ |
|||
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 }, |
|||
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 }, |
|||
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 }, |
|||
], |
|||
editForm: [ |
|||
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingCustomUserSetting'), prop: "customUserSetting", colSpan: 12 }, |
|||
{ type: "input", label:zhApiColumnsLable('ExportCustomUserSettingExportColumnName'), prop: "exportColumnName", colSpan: 12 }, |
|||
{ type: "input", label: zhApiColumnsLable('ExportCustomUserSettingExportTableName'), prop: "exportTableName", colSpan: 12 }, |
|||
], |
|||
editRules: { |
|||
cerateRule: { |
|||
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
exportColumnName: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
}, |
|||
editRule: { |
|||
customUserSetting: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
exportColumnName: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
exportTableName: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
} |
|||
}, |
|||
}; |
|||
}, |
|||
mounted () { |
|||
this.paging(); |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/styles/basicData.scss"; |
|||
</style> |
@ -0,0 +1,79 @@ |
|||
<template> |
|||
<div class="page-box" v-loading="Loading.tableLoading"> |
|||
<!-- DEMO:只有主表查询 没有新增编辑删除 --> |
|||
<tablePagination |
|||
v-if="apiColumns_Table" |
|||
:currenButtonData="currenButtonData" |
|||
:tableData="tableData" |
|||
:tableLoading="Loading.tableLoading" |
|||
:tableColumns="apiColumns_Table" |
|||
@rowDrop="rowDrop" |
|||
:totalCount="totalCount" |
|||
:multipleSelection="multipleSelection" |
|||
:MaxResultCount="PageListParams.MaxResultCount" |
|||
@topbutton="topbutton" |
|||
@inlineDialog="inlineDialog" |
|||
@sortChange="sortChange" |
|||
@alertoldSkipCount="alertoldSkipCount" |
|||
@alterResultCount="alterResultCount" |
|||
@handleSelectionChange="handleSelectionChange" |
|||
:currentPageProps="oldSkipCount" |
|||
:quicklySearchOption="quicklySearchOption" |
|||
@quicklySearchClick="quicklySearchClick" |
|||
@quicklySearchClear="quicklySearchClear" |
|||
:primarySearchOption="primarySearchOption" |
|||
@overallSearchFormClick="overallSearchFormClick" |
|||
:httpOverallSearchData="httpOverallSearchData" |
|||
></tablePagination> |
|||
<!-- 导出弹窗 --> |
|||
<exportDrop |
|||
v-if="displayDialog.exportDialog" |
|||
@closeDialog="closeExportDrop" |
|||
@exportDropSubmit="exportDropSubmit" |
|||
></exportDrop> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import { tableMixins } from "@/mixins/TableMixins"; |
|||
import { LoadingMixins } from "@/mixins/LoadingMixins"; |
|||
import { drawerMixins } from "@/mixins/drawerMixins" |
|||
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; |
|||
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins" |
|||
import { mixins } from "@/mixins/mixins"; |
|||
import { filterSelectMixins } from '@/mixins/filter-Select' |
|||
import { getToken } from '@/utils/auth' |
|||
|
|||
|
|||
export default { |
|||
name: "IncomingData", |
|||
mixins: [ |
|||
tableMixins, |
|||
LoadingMixins, |
|||
drawerMixins, |
|||
TableHeaderMixins, |
|||
mixins, |
|||
filterSelectMixins, |
|||
newAndEdiDialogMixins |
|||
], |
|||
data() { |
|||
return { |
|||
//常用按钮数据 |
|||
currenButtonData: [ |
|||
this.defaultExportBtn({ |
|||
isRedundance:true, |
|||
isDetailExport:true |
|||
}),//导出 |
|||
this.defaultFieldSettingBtn(),//字段设置 |
|||
this.defaultFreshBtn(),//刷新 |
|||
this.defaultFilterBtn(),//筛选 |
|||
], |
|||
}; |
|||
}, |
|||
mounted() { |
|||
this.paging(); |
|||
}, |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/styles/basicData.scss"; |
|||
</style> |
@ -1,466 +0,0 @@ |
|||
<template> |
|||
<div class="page-box" v-loading="Loading.appMainLoading"> |
|||
<tablePagination |
|||
:currenButtonData="currenButtonData" |
|||
:tableData="tableData" |
|||
:tableLoading="Loading.tableLoading" |
|||
:tableColumns="apiColumns_Table" |
|||
@rowDrop="rowDrop" |
|||
:totalCount="totalCount" |
|||
:multipleSelection="multipleSelection" |
|||
:MaxResultCount="PageListParams.MaxResultCount" |
|||
@topbutton="customTopbutton" |
|||
@inlineDialog="inlineDialog" |
|||
@sortChange="sortChange" |
|||
@alertoldSkipCount="alertoldSkipCount" |
|||
@alterResultCount="alterResultCount" |
|||
@handleSelectionChange="handleSelectionChange" |
|||
:currentPageProps="oldSkipCount" |
|||
:quicklySearchOption="quicklySearchOption" |
|||
@quicklySearchClick="quicklySearchClick" |
|||
@quicklySearchClear="quicklySearchClear" |
|||
:primarySearchOption="primarySearchOption" |
|||
@overallSearchFormClick="overallSearchFormClick" |
|||
:httpOverallSearchData="httpOverallSearchData" |
|||
></tablePagination> |
|||
<!-- 新增与编辑 --> |
|||
<newAndEdiDialogForDetail |
|||
v-if="apiColumns_DetailsTable" |
|||
ref="newAndEdiDialogForDetail" |
|||
:loading="Loading.newAndEdiLoading" |
|||
:active="active" |
|||
:pageStatus="pageStatus" |
|||
:formReveal="formReveal" |
|||
:formTitle="formTitle" |
|||
:displayDialog="editDialog" |
|||
:FormData="formReveal ? CreateFormData : editFormData" |
|||
:Form="formReveal ? CreateForm : editForm" |
|||
:Options="editOptions" |
|||
:Handle="editHandle" |
|||
:Rules="formReveal ? editRules.cerateRule : editRules.editRule" |
|||
@FormSubmit="FormSubmit" |
|||
@close="FormClose" |
|||
@goBack="goBack" |
|||
:flexTableColumns="flexTableColumns" |
|||
></newAndEdiDialogForDetail> |
|||
<curren-Drawer |
|||
:title="apiColumns_DesTions" |
|||
:tableColumns="apiColumns_DetailsTable" |
|||
:tabsDesTions="apiColumns_DesTions" |
|||
:DrawerLoading="Loading.DrawerLoading" |
|||
:drawer="displayDialog.detailsDialog" |
|||
:dropdownData="dropdownData" |
|||
:propsData="propsData" |
|||
@drawerShut="(val) => (displayDialog.detailsDialog = val)" |
|||
@drawerbutton="drawerbutton" |
|||
@handleCommand="drawerHandle" |
|||
@close-value="closeValue" |
|||
:totalCount="totalCountDetails" |
|||
:currentPage="oldSkipCountDetails" |
|||
:MaxResultCount="MaxResultCountDetails" |
|||
@alterResultCountDetails="alterResultCountDetails" |
|||
@alertoldSkipCountDetails="alertoldSkipCountDetails" |
|||
> |
|||
<!-- 明细中的删除示例 (但是明细应该只读,删除及新增编辑在明细查询中处理,所以暂隐藏) --> |
|||
<!-- <template v-if="currentTagName == 'mx' "> |
|||
<el-table-column |
|||
label="操作" |
|||
:align="'center'" |
|||
width="100" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-popover |
|||
placement="left" |
|||
width="260" |
|||
v-model="scope.row.deleteTipVisible" |
|||
> |
|||
<p>此操作将永久删除该消息, 是否继续?</p> |
|||
<div style="text-align: right; margin: 0"> |
|||
<el-button size="mini" type="text" style="margin-right: 20px;" @click="scope.row.deleteTipVisible = false">取消</el-button> |
|||
<el-button type="primary" size="mini" @click="deleteHandleForDetail(scope.row)">确定</el-button> |
|||
</div> |
|||
<el-button type="text" slot="reference" style="color: red;">删除</el-button> |
|||
</el-popover> |
|||
</template> |
|||
</el-table-column> |
|||
</template> --> |
|||
</curren-Drawer> |
|||
<filterForDetailPage |
|||
v-if="filterForDetailShow" |
|||
ref="filterForDetailPage" |
|||
listApi="TestSchoolDetailList" |
|||
DeleteApi="TestSchoolDetailList_delete" |
|||
:listColumns="apiColumns_DetailsTable" |
|||
@closeDialog="changeFilterForDetailShow" |
|||
></filterForDetailPage> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import { tableMixins } from "@/mixins/TableMixins"; |
|||
import { LoadingMixins } from "@/mixins/LoadingMixins"; |
|||
import { drawerMixins } from "@/mixins/drawerMixins" |
|||
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; |
|||
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins" |
|||
import { mixins } from "@/mixins/mixins"; |
|||
import { filterSelectMixins } from '@/mixins/filter-Select' |
|||
// import { TestSchool,TestSchool_save,TestSchoolItemById,TestSchool_delete,TestSchoolDetailList_delete } from "@/api/wms-interface" |
|||
import { getToken } from '@/utils/auth' |
|||
|
|||
export default { |
|||
name: "TestSchool", |
|||
mixins: [ |
|||
tableMixins, |
|||
LoadingMixins, |
|||
drawerMixins, |
|||
TableHeaderMixins, |
|||
mixins, |
|||
filterSelectMixins, |
|||
newAndEdiDialogMixins |
|||
], |
|||
computed: { |
|||
editDialog: { |
|||
get: function () { |
|||
return this.displayDialog.newDialog || this.displayDialog.editDialog; |
|||
}, |
|||
}, |
|||
}, |
|||
data() { |
|||
// let _Dashboard = JSON.parse(localStorage.getItem("interfaceBoardColumnsNames")) // 接口监控看板 |
|||
return { |
|||
currentTagName:'mx', |
|||
//常用按钮数据 |
|||
currenButtonData: [ |
|||
this.defaultAddBtn(),//新增 |
|||
this.defaultExportBtn(),//导出 |
|||
this.defaultFieldSettingBtn(),//字段设置 |
|||
this.defaultFreshBtn(),//刷新 |
|||
this.defaultFilterBtn(),//筛选 |
|||
this.defaultFilterForDetailBtn()//明细查询按钮 |
|||
], |
|||
flexTableColumns:[ |
|||
{ label: "学生33", prop: "studentName", width:"auto", type:"input" }, |
|||
{ label: "orderType33", prop: "orderType", width:"auto" }, |
|||
{ label: "创建时间33", prop: "creationTime", type: "dateTime", width:"auto" }, |
|||
], |
|||
//新增 |
|||
CreateFormData: { |
|||
schoolName:null, |
|||
orderType:null, |
|||
details:null, |
|||
// details: [ |
|||
// { |
|||
// "lastModifierId": "ad731144-d789-f322-fede-327cac55dd36", |
|||
// "creationTime": "1978-07-18T22:00:37.5Z", |
|||
// "creatorId": "19e78d1b-6203-8d6d-b6e7-ae5b503c0824", |
|||
// "id": "5926ec25-2132-ba25-6b93-e453c17f00e2", |
|||
// "studentName": "张三", |
|||
// "orderType": 2, |
|||
// "masterId": "a044e2c6-3bc6-7cdd-55a6-f1a2a9682ccb", |
|||
// "lastModificationTime": "1946-12-30T14:22:31.982Z" |
|||
// }, |
|||
// ], |
|||
// number: null,//数字+点* |
|||
// remark: null, |
|||
// dataType: null, |
|||
// tableType: null,//数字+点* |
|||
// dataAction: null,//数字+点* |
|||
// effectiveDate: null,//* |
|||
// status: null,//数字+点* |
|||
// sourceSystem: null, |
|||
// sourceDataId: null, |
|||
// sourceDataGroupCode: null, |
|||
// sourceDataDetailCode: null, |
|||
// sourceDataContent: null, |
|||
// writeTime: null,//* |
|||
// writer: null, |
|||
// destinationSystem: null, |
|||
// destinationDataId: null, |
|||
// destinationDataContent: null, |
|||
// readTime: null,//* |
|||
// reader: null, |
|||
// errorCode: null,//数字+点* |
|||
// errorMessage: null, |
|||
// retryTimes: null,//数字+点* |
|||
}, |
|||
//编辑 |
|||
editFormData: { |
|||
id:null, |
|||
schoolName:null, |
|||
orderType:null, |
|||
details:null, |
|||
// number: null,//数字+点* |
|||
// remark: null, |
|||
// dataType: null, |
|||
// tableType: null,//数字+点* |
|||
// dataAction: null,//数字+点* |
|||
// effectiveDate: null,//* |
|||
// status: null,//数字+点* |
|||
// sourceSystem: null, |
|||
// sourceDataId: null, |
|||
// sourceDataGroupCode: null, |
|||
// sourceDataDetailCode: null, |
|||
// sourceDataContent: null, |
|||
// writeTime: null,//* |
|||
// writer: null, |
|||
// destinationSystem: null, |
|||
// destinationDataId: null, |
|||
// destinationDataContent: null, |
|||
// readTime: null,//* |
|||
// reader: null, |
|||
// errorCode: null,//数字+点* |
|||
// errorMessage: null, |
|||
// retryTimes: null,//数字+点* |
|||
}, |
|||
CreateForm: [ |
|||
{ type: "input", label: '名称', prop: 'schoolName', colSpan: 12 }, |
|||
{ type: "input", label: 'orderType', prop: 'orderType', colSpan: 12 }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDataType, prop: 'dataType', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalTableType, prop: 'tableType', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDataAction, prop: 'dataAction', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "dateTime", label: _Dashboard.OutgoingToExternalEffectiveDate, prop: 'effectiveDate', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalStatus, prop: 'status', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceSystem, prop: 'sourceSystem', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataId, prop: 'sourceDataId', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataGroupCode, prop: 'sourceDataGroupCode', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataDetailCode, prop: 'sourceDataDetailCode', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataContent, prop: 'sourceDataContent', colSpan: 12, }, |
|||
// { type: "dateTime", label: _Dashboard.OutgoingToExternalWriteTime, prop: 'writeTime', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalWriter, prop: 'writer', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationSystem, prop: 'destinationSystem', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationDataId, prop: 'destinationDataId', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationDataContent, prop: 'destinationDataContent', colSpan: 12, }, |
|||
// { type: "dateTime", label: _Dashboard.OutgoingToExternalReadTime, prop: 'readTime', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalReader, prop: 'reader', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalErrorCode, prop: 'errorCode', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalErrorMessage, prop: 'errorMessage', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalRetryTimes, prop: 'retryTimes', colSpan: 12, validType:'pointNumber'}, |
|||
], |
|||
editForm: [ |
|||
{ type: "input", label: '名称', prop: 'schoolName', colSpan: 12 }, |
|||
{ type: "input", label: 'orderType', prop: 'orderType', colSpan: 12 }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalNumber, prop: 'number', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalRemark, prop: 'remark', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDataType, prop: 'dataType', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalTableType, prop: 'tableType', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDataAction, prop: 'dataAction', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "dateTime", label: _Dashboard.OutgoingToExternalEffectiveDate, prop: 'effectiveDate', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalStatus, prop: 'status', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceSystem, prop: 'sourceSystem', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataId, prop: 'sourceDataId', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataGroupCode, prop: 'sourceDataGroupCode', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataDetailCode, prop: 'sourceDataDetailCode', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalSourceDataContent, prop: 'sourceDataContent', colSpan: 12, }, |
|||
// { type: "dateTime", label: _Dashboard.OutgoingToExternalWriteTime, prop: 'writeTime', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalWriter, prop: 'writer', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationSystem, prop: 'destinationSystem', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationDataId, prop: 'destinationDataId', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalDestinationDataContent, prop: 'destinationDataContent', colSpan: 12, }, |
|||
// { type: "dateTime", label: _Dashboard.OutgoingToExternalReadTime, prop: 'readTime', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalReader, prop: 'reader', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalErrorCode, prop: 'errorCode', colSpan: 12, validType:'pointNumber' }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalErrorMessage, prop: 'errorMessage', colSpan: 12, }, |
|||
// { type: "input", label: _Dashboard.OutgoingToExternalRetryTimes, prop: 'retryTimes', colSpan: 12, validType:'pointNumber'}, |
|||
], |
|||
editOptions: {}, |
|||
editRules: { |
|||
cerateRule: { |
|||
schoolName: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// number: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// tableType: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// dataAction: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// effectiveDate: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// status: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// writeTime: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// readTime: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// errorCode: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// retryTimes: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
}, |
|||
editRule: { |
|||
schoolName: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// number: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// tableType: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// dataAction: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// effectiveDate: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// status: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// writeTime: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// readTime: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// errorCode: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
// retryTimes: [{ required: true, trigger: "blur", message: "不可为空" }], |
|||
} |
|||
}, |
|||
// 明细查询弹窗显示 |
|||
filterForDetailShow:false, |
|||
currentDetailId:null,//当前删除主表id,用于删除后重新刷新子表 |
|||
}; |
|||
}, |
|||
mounted() { |
|||
this.initApiColumns() |
|||
this.paging(); |
|||
}, |
|||
methods: { |
|||
//渲染数据 |
|||
// paging(callback) { |
|||
// this.Loading.tableLoading = true; |
|||
// // this.apiColumns_Table = tableColumns_api[this.$route.name] |
|||
// // this.apiColumns_DesTions = tabsDesTions_api[this.$route.name] |
|||
// // this.apiColumns_DetailsTable = detailsTableColumns_api[this.$route.name] |
|||
// this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount |
|||
// TestSchool(this.PageListParams,true) |
|||
// .then(result => { |
|||
// this.tableData = result.items |
|||
// this.totalCount = result.totalCount |
|||
// this.pagingCallback(callback) |
|||
// }) |
|||
// .catch(err => { |
|||
// this.Loading.tableLoading = false |
|||
// this.$message.error("数据获取失败") |
|||
// }) |
|||
// }, |
|||
//打开抽屉 |
|||
inlineDialog(val) { |
|||
this.Loading.DrawerLoading = true |
|||
this.displayDialog.detailsDialog = true; |
|||
this.currentDetailId = val.id |
|||
// TestSchoolItemById(val.id) |
|||
// .then(res => { |
|||
// if (res.details) { |
|||
// // 前端分页处理 |
|||
// this.tableDataDetails = JSON.parse(JSON.stringify(res)) |
|||
// let linshiTableDataDetails = JSON.parse(JSON.stringify(this.tableDataDetails)) |
|||
// this.totalCountDetails = res.details.length |
|||
// this.propsData = linshiTableDataDetails |
|||
// // 删除除当前页面最大数以外数据 |
|||
// linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails); |
|||
// } else { |
|||
// this.propsData = res |
|||
// } |
|||
// this.inlineDialogCallback() |
|||
// }) |
|||
// .catch(err => { |
|||
// this.Loading.DrawerLoading = false |
|||
// this.$message.error("数据获取失败") |
|||
// }) |
|||
}, |
|||
// 新增/编辑提交 todo:编辑报错 |
|||
FormSubmit(val){ |
|||
this.Loading.tableLoading = true |
|||
let _data = this.formReveal ? this.CreateFormData : this.editFormData |
|||
// if(!this.formReveal){ |
|||
// _data.details= [ |
|||
// { |
|||
// "lastModifierId": "ad731144-d789-f322-fede-327cac55dd36", |
|||
// "creationTime": "1978-07-18T22:00:37.5Z", |
|||
// "creatorId": "19e78d1b-6203-8d6d-b6e7-ae5b503c0824", |
|||
// "id": "5926ec25-2132-ba25-6b93-e453c17f00e2", |
|||
// "studentName": "张三2", |
|||
// "orderType": 32, |
|||
// "masterId": "a044e2c6-3bc6-7cdd-55a6-f1a2a9682ccb", |
|||
// "lastModificationTime": "1946-12-30T14:22:31.982Z" |
|||
// }, |
|||
// { |
|||
// "orderType": 4, |
|||
// "id": "b1d829d2-f3c2-9584-5b91-5ce64eea194a", |
|||
// "masterId": "f789a9ef-ffbe-f690-fc49-b87d57093b5c", |
|||
// "lastModificationTime": null, |
|||
// "creationTime": "2010-07-21T09:46:13.372Z", |
|||
// "creatorId": null, |
|||
// "studentName": "李四", |
|||
// "lastModifierId": null |
|||
// }, |
|||
// ] |
|||
// } |
|||
// TestSchool_save(_data,this.formReveal) |
|||
// .then(result => { |
|||
// this.FormResult("success") |
|||
// this.Loading.tableLoading = false |
|||
// }) |
|||
// .catch(err => { |
|||
// this.FormResult("error") |
|||
// this.Loading.tableLoading = false |
|||
// }) |
|||
// const _data = new URLSearchParams(); |
|||
// for(let item in this.CreateFormData){ |
|||
// _data.append('ViewModel.'+item.slice(0,1).toUpperCase() +item.slice(1).toLowerCase(), this.CreateFormData[item]) |
|||
// } |
|||
// // todo:1、接口302 2、token取值的问题 |
|||
// _data.append('__RequestVerificationToken',getToken()) |
|||
// // this.formReveal为真是新增 |
|||
// TestSchool_save(_data,this.formReveal) |
|||
// .then(result => { |
|||
// this.Loading.tableLoading = false |
|||
// }) |
|||
// .catch(err => { |
|||
// this.Loading.tableLoading = false |
|||
// }) |
|||
}, |
|||
// FormSubmit(val){ |
|||
// this.Loading.tableLoading = true |
|||
// const _data = new URLSearchParams(); |
|||
// for(let item in this.CreateFormData){ |
|||
// _data.append('ViewModel.'+item.slice(0,1).toUpperCase() +item.slice(1).toLowerCase(), this.CreateFormData[item]) |
|||
// } |
|||
// // todo:1、接口302 2、token取值的问题 |
|||
// _data.append('__RequestVerificationToken',getToken()) |
|||
// // this.formReveal为真是新增 |
|||
// TestSchool_save(_data,this.formReveal) |
|||
// .then(result => { |
|||
// this.Loading.tableLoading = false |
|||
// }) |
|||
// .catch(err => { |
|||
// this.Loading.tableLoading = false |
|||
// }) |
|||
// }, |
|||
// 重载抽屉 删除按钮 |
|||
drawerHandle(val) { |
|||
if (val == 'delete') { |
|||
this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.Loading.appMainLoading = true |
|||
this.displayDialog.detailsDialog = false |
|||
// todo:1、接口302 |
|||
// TestSchool_delete(this.propsData.id).then(res => { |
|||
// this.$successMsg('删除成功!') |
|||
// this.Loading.appMainLoading = false |
|||
// this.paging() |
|||
// }).catch(err => { |
|||
// this.Loading.appMainLoading = false |
|||
// this.$message.error("删除失败!") |
|||
// }) |
|||
}).catch(() => { |
|||
//取消操作 |
|||
}); |
|||
} |
|||
}, |
|||
changeFilterForDetailShow(data){ |
|||
this.filterForDetailShow = data |
|||
}, |
|||
customTopbutton(val,item){ |
|||
// 明细筛选按钮 |
|||
if(val == 'filterForDetail'){ |
|||
this.changeFilterForDetailShow(true) |
|||
}else{ |
|||
this.topbutton(val,item) |
|||
} |
|||
}, |
|||
deleteHandleForDetail(data){ |
|||
this.Loading.appMainLoading = true |
|||
data.deleteTipVisible = false |
|||
// TestSchoolDetailList_delete(data.id).then(res => { |
|||
// this.$successMsg('删除成功!') |
|||
// this.Loading.appMainLoading = false |
|||
// this.oldSkipCountDetails = 1 |
|||
// this.inlineDialog({id:this.currentDetailId}) |
|||
// }).catch(err => { |
|||
// this.Loading.appMainLoading = false |
|||
// this.$message.error("删除失败!") |
|||
// }) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
<style lang="scss" scoped> |
|||
@import "@/styles/basicData.scss"; |
|||
</style> |
Loading…
Reference in new issue