Browse Source

【EQI前端】功能页面+table编辑方式暂存

web
安虹睿 4 days ago
parent
commit
42520a2811
  1. 13
      Web/src/api/common/index.js
  2. 790
      Web/src/components/ediTtablePage/index.vue
  3. 18
      Web/src/components/elPager/index.vue
  4. 73
      Web/src/components/elTable/index.vue
  5. 3
      Web/src/components/tablePage/index.vue
  6. 33
      Web/src/utils/common/apiTableColumns.js
  7. 11
      Web/src/views/logisticsPlan/supplierConMmrp/index.vue

13
Web/src/api/common/index.js

@ -84,4 +84,15 @@ export function getCommonDeatailPaged(urlName,data) {
method: 'post',
data
})
}
}
// 通过id获取详情实体
export function getCommonDetailById(urlName,id) {
return request({
url: `/api/${urlName}/getdetialbyid`,
method: 'get',
params:{id:id}
})
}
// getCommonInfoById

790
Web/src/components/ediTtablePage/index.vue

@ -0,0 +1,790 @@
<template>
<div class="app-container" v-loading="state.loading">
<!-- 查询头部 -->
<el-card class="search-container" v-if="!props.hideSearch">
<el-form :inline="true">
<el-form-item
v-auth="props.apiName + state.searchBtnOptions['search'].auth"
v-for="(item,index) in props.searchOptions"
:key="index"
:label="item.label">
<!-- 文本 -->
<el-input
v-if="item.type == 'input'"
v-model="props.searchFilter[item.prop]"
:placeholder="item.label"
:clearable="!item.noClear"
/>
<!-- 数字 -->
<el-input-number
v-if="item.type == 'number'"
v-model="props.searchFilter[item.prop]"
:min="item.min"
:max="item.max"
/>
<!-- 时间区域 -->
<el-date-picker
v-if="item.type == 'datetimerange'"
v-model="props.searchFilter[item.prop]"
type="datetimerange"
start-placeholder="起始时间"
end-placeholder="结束时间"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
/>
<!-- 选择框 -->
<el-select
v-if="item.type == 'select'"
v-model="props.searchFilter[item.prop]"
:filterable="!item.noSearch"
placeholder="请选择"
style="width: 240px"
:clearable="!item.noClear"
>
<el-option
v-for="(op,op_index) in item.options"
:key="op_index"
:label="op.label"
:value="op.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
v-for="(btn,btn_key) in props.searchButtons"
:key="btn_key"
:icon="state.searchBtnOptions[btn].icon"
v-auth="state.searchBtnOptions[btn].sAuth || props.apiName + state.searchBtnOptions[btn].auth"
:type="state.searchBtnOptions[btn].type"
@click="searchBtnHandle(btn)"
>{{state.searchBtnOptions[btn].label}}</el-button>
</el-form-item>
</el-form>
<!-- 右侧按钮(保存页面) -->
<div>
<el-button
v-for="(btn,btn_key) in state.searchRightBtn"
:key="btn_key"
:icon="btn.icon"
v-auth="btn.sAuth || props.apiName + btn.auth"
:type="btn.type"
@click="searchRightBtnHandle(btn)"
>{{btn.label}}</el-button>
</div>
</el-card>
<!-- 头部详情 -->
<el-card v-loading="state.detailLoading" class="headerInfo-container" v-if="!props.hideHeaderInfo">
<el-descriptions :border="true" :column="6" v-if="state.headerInfoData && state.headerInfoData.length > 0">
<el-descriptions-item
v-for="(item,index) in state.headerInfoData"
:key="index"
:label="item.label">
{{item.value}}
</el-descriptions-item>
</el-descriptions>
<el-empty v-else description="暂无数据" class="headerInfoEmpty"/>
</el-card>
<!-- 列表 -->
<el-card class="paged-table-container">
<elTable
:columnWidth="props.columnWidth"
:columnHeaderAlign="props.columnHeaderAlign"
:columnAlign="props.columnAlign"
:tableData="state.tableData"
:tableColumns="getTableColumns()"
@sortChange="sortChange"
:leftOperation="props.leftOperation"
@leftOperationHadel="leftOperationHadel"
:rightOperation="getRightOperation()"
@rightOperationHadel="rightOperationHadel"
:multipleTable="props.multipleTable"
@tableSelectionHandle="tableSelectionHandle"
@editItemFocusHandle="(item,scope,event)=>{getItemDetail(item.type,scope.row,'focus')}"
@editItemChangeHandle="editItemChangeHandle"
@cell-click="(row,column,cell,event)=>{getItemDetail('cell',row,'cellClick')}"
@editItemClearHandle="(item,scope)=>{getItemDetail(item.type,scope.row,'clear')}"
:getEditItemDisabled="getEditItemDisabled"
:selectableDisabled="selectableDisabled"
></elTable>
<elPager
v-loading="state.pageLoading"
style="margin-top: 15px;float:right"
:pager="state.pager"
@size-change="pageSizeChange"
@current-change="pageCurrentChange"
></elPager>
</el-card>
<!-- 导入弹窗 -->
<importPop
ref="importPopRef"
:apiName="props.apiName"
@success="importSuccess"
/>
<!-- 编辑弹窗 -->
<apiEditPop
ref="apiEditPopRef"
:apiName="props.apiName"
@submitEditForm="submitEditForm"
:formRules="props.apiEditFormRules"
/>
</div>
</template>
<script setup>
defineOptions({ name: 'ediTtablePage' })
import store from '@/stores'
import apiTableColumns from '@/utils/common/apiTableColumns'
import { reactive, ref, onMounted,computed } from 'vue'
import {
getCommonPaged,
getCommonDeatailPaged,
postCommonExport,
postCommonCreate,
putCommonUpdate,
deleteCommonApi,
getCommonCustominvoke ,
getCommonDetailById
} from '@/api/common/index'
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus'
import elTable from '@/components/elTable/index.vue'
import elPager from '@/components/elPager/index.vue'
import { getPageParamsForFilter } from '@/utils/common/index'
import { downloadByData } from '@/utils/download'
import importPop from '@/components/importPop/index.vue'
import apiEditPop from '@/components/apiEditPop/index.vue'
import { formatDate } from '@/utils/formatTime'
import apiServeNames from '@/utils/common/apiServeNames'
import { useRoute } from 'vue-router'
const route = useRoute()
const userStore = store.userStore()
const userInfo = userStore.state
const auths = store.permissionStore()
const state = reactive({
loading:false,
detailLoading:false,
pageLoading:false,
searchBtnOptions:{
search:{icon:'Search',auth:':page',label:'查询',type:null},
create:{icon:'Plus',auth:':create',label:'新增',type:'primary'},
import:{icon:'BottomRight',auth:':import',label:'导入',type:'warning'},
export:{icon:'TopRight',auth:':export',label:'导出',type:'success'},
custominvoke:{icon:'Position',auth:':custominvoke',label:'手动开关',type:'primary'},
outputMany:{icon:'Position',auth:':outputMany',label:'手动传出',type:'primary'},
},
searchRightBtn:[{icon:'Check',auth:':pageSave',label:'保存页面',type:'warning'}],
tableData:[],
// table
sortFilter:{
sortBy:undefined,
isAscending:undefined
},
pager:{
page: 1,
pageSize: 10,
total: 1,
},
tableSelectList:[],
leaveSaveTip:'此操作将重新渲染页面,检测有数据【未保存】,操作后将【清空未保存数据】,是否确定继续?',
//
headerInfoData:[],
currentDetailId:null,//id
//
stage_tableData:[],
//
stage_indexs:[],
})
const props = defineProps({
// api
apiName: {
type: String,
default: null
},
// colum
detailColumName:{
type: String,
default: null
},
// api detailApigetdetailpageApigetdatapaged
apiType: {
type: String,
default: null
},
//
hideSearch:{
type: Boolean,
default: false
},
//
multipleTable:{
type: Boolean,
default: false
},
//
leftOperation:{
type: Object,
default: null
},
//
rightOperation:{
type: [Object,String],
default: null
},
// api
showApiRightOperation:{
type: Object,
default: null
},
// readState=true
// 使,=
apiRightHideConfig:{
type: Object,
default: {
apiUpdate:{prop:'readState',ruleValue:true},
apiDelete:{prop:'readState',ruleValue:true},
}
},
// table
tableColumns: {
type: Object,
default: null
},
//
searchOptions: {
type: Object,
default: []
},
//
searchButtons: {
type: Object,
default: ['search','export']
},
// tablefilter
searchFilter: {
type: Object,
default: {}
},
//
columnWidth:{
type: Number,
default: 120
},
//
columnHeaderAlign:{
type: String,
default: 'center'
},
//
columnAlign:{
type: String,
default: 'center'
},
//
apiEditFormRules:{
type: Object,
default: null
},
//
hideHeaderInfo:{
type: Boolean,
default: false
},
// readState=true
// 使,=
editDisabledConfig:{
type: Object,
default: [
{prop:'readState',ruleValue:true},
]
},
})
//
function getTableColumns(){
return props.tableColumns || apiTableColumns[props.apiName]
}
const emits = defineEmits([
'leftOperationHadel',
'rightOperationHadel',
'tableSelectionHandle'
])
// table
function tableSelectionHandle (val){
state.tableSelectList = val
emits('tableSelectionHandle',val)
}
//
function leftOperationHadel(btn,scope) {
emits('leftOperationHadel',btn,scope)
}
//
function getRightOperation() {
// api
if(typeof props.rightOperation == 'object' && !props.showApiRightOperation){
return props.rightOperation
}
// api
else if(
(typeof props.rightOperation == 'object' && props.showApiRightOperation)
|| typeof props.rightOperation == 'string'
){
// api
let _apiArr = props.showApiRightOperation || props.rightOperation.split(',')
let _config = {
apiUpdate:{label:'编辑',type:'warning'},
apiDelete:{label:'删除',type:'danger'},
}
let _btns = []
if(_apiArr && _apiArr.length > 0){
_apiArr.forEach(item => {
_btns.push({
label:_config[item].label,
name:item,
link:true,
type:_config[item].type,
auth:props.apiName+':'+item,
hide:(row,scope) => {return row[props.apiRightHideConfig[item].prop] == props.apiRightHideConfig[item].ruleValue}
})
});
}
// api
if(typeof props.rightOperation == 'object'){
_btns = [..._btns,...props.rightOperation]
}
return _btns
}
}
//
const apiEditPopRef = ref()
function rightOperationHadel(btn,scope) {
//
if(btn.name == 'apiUpdate'){
let _tableColums = getTableColumns()
let _list = _tableColums.filter(item => !item.noEdit)
apiEditPopRef.value.open(_list,scope.row)
}
//
if(btn.name == 'apiDelete'){
ElMessageBox.confirm(`是否确定删除?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
state.loading = true
deleteCommonApi(props.apiName,scope.row.uId)
.then(res=>{
ElMessage.success('操作成功!')
getTableData(1);
})
.catch(err=>{ElMessage.error('操作失败!')})
.finally(()=>{state.loading = false})
})
}
emits('rightOperationHadel',btn,scope)
}
//
const submitEditForm = async (type,formData,formConfig) => {
apiEditPopRef.value.validate((valid) => {
if(valid){
//
if(type == 'create'){
if(formData.hasOwnProperty('createUser')){formData.createUser = userInfo.realName}
if(formData.hasOwnProperty('createByUser')){formData.createByUser = userInfo.realName}
if(formData.hasOwnProperty('createTime')){formData.createTime = formatDate(new Date(), "YYYY-mm-dd HH:MM:SS")}
apiEditPopRef.value.changeLoading(true)
postCommonCreate(props.apiName,formData)
.then(res=>{
apiEditPopRef.value.close()
ElMessage.success('操作成功!')
getTableData(1);
})
.catch(err=>{ElMessage.error('操作失败!')})
.finally(()=>{apiEditPopRef.value.changeLoading(false)})
}else{
//
if(
(formData.hasOwnProperty('updateByUser') && formData.hasOwnProperty('updateTime'))
|| (formData.hasOwnProperty('updateUser') && formData.hasOwnProperty('updateTime'))
){
if(formData.hasOwnProperty('updateByUser')){formData.updateByUser = userInfo.realName}
if(formData.hasOwnProperty('updateUser')){formData.updateUser = userInfo.realName}
if(formData.hasOwnProperty('updateTime')){formData.updateTime = formatDate(new Date(), "YYYY-mm-dd HH:MM:SS")}
}else{
//
let _notChange=['taskconifgure']
if(_notChange.indexOf(props.apiName) < 0){
formData.remark= `修改信息:${userInfo.realName} ${formatDate(new Date(), "YYYY-mm-dd HH:MM:SS")}`
}
}
apiEditPopRef.value.changeLoading(true)
putCommonUpdate(props.apiName,formData)
.then(res=>{
apiEditPopRef.value.close()
ElMessage.success('操作成功!')
getTableData(1);
})
.catch(err=>{ElMessage.error('操作失败!')})
.finally(()=>{apiEditPopRef.value.changeLoading(false)})
}
}
})
}
//
function getPageParams(){
let _filters = []
if(props.hideSearch){
_filters = props.searchFilter
}else{
for(let i in props.searchFilter){
let _item = props.searchOptions.filter(item=>item.prop == i)
let _type = (_item && _item.length > 0) ? _item[0].type : null
if(props.searchFilter[i] || props.searchFilter[i] == 0){
//
if(_type == 'datetimerange'){
_filters.push(
{
logic: "And",
column: i,
action: '>=',
value: props.searchFilter[i][0]
}
)
_filters.push(
{
logic: "And",
column: i,
action: '<=',
value: props.searchFilter[i][1]
}
)
}else{
let _action = 'like'
let _EqualTypes = ['tagFilter','filter','number','select']//
if(_EqualTypes.indexOf(_type) >= 0){
_action = '=='
}
_filters.push(
{
logic: "And",
column: i,
action: _action,
value: props.searchFilter[i]
}
)
}
}
}
}
let _pageParams = getPageParamsForFilter({
pageNumber:state.pager.page,
pageSize:state.pager.pageSize,
sortBy:state.sortFilter.sortBy,
isAscending:state.sortFilter.isAscending,
condition:{
filters:_filters
}
})
return _pageParams
}
//
function getTableData(page) {
state.stage_indexs = []
if(props.apiType == 'detailApi'){
state.loading = true
if(!page)page = state.pager.page
if(page)state.pager.page = page
getCommonDeatailPaged(props.apiName,getPageParams())
.then((resp) => {
state.headerInfoData = []
state.tableData = resp.data.data
state.stage_tableData = JSON.parse(JSON.stringify(resp.data.data))
state.pager.total = resp.data.totalCount
})
.catch(err=>{ElMessage.error('数据获取失败!')})
.finally(() => (state.loading = false))
}else{
state.loading = true
if(!page)page = state.pager.page
if(page)state.pager.page = page
getCommonPaged(props.apiName,getPageParams())
.then((resp) => {
state.headerInfoData = []
state.tableData = resp.data.data
state.stage_tableData = JSON.parse(JSON.stringify(resp.data.data))
state.pager.total = resp.data.totalCount
})
.catch(err=>{ElMessage.error('数据获取失败!')})
.finally(() => (state.loading = false))
}
}
const importPopRef = ref()
//
function searchBtnHandle(btn){
//
if(btn == 'search'){
beforClearEdit().then(() => {
getTableData()
})
}
//
else if (btn == 'create'){
beforClearEdit().then(() => {
let _tableColums = getTableColumns()
let _list = _tableColums.filter(item => !item.noEdit)
apiEditPopRef.value.open(_list)
})
}
//
else if (btn == 'import'){
beforClearEdit().then(() => {
importPopRef.value.open()
})
}
//
else if (btn == 'export'){
beforClearEdit().then(() => {
state.loading = true
getTableData()//
postCommonExport(props.apiName,getPageParams())
.then((res) => {
downloadByData(res.data,route.meta.title+'.xlsx')
})
.catch(err=>{ElMessage.error('操作失败!')})
.finally(() => (state.loading = false))
})
}
//
else if (btn == 'custominvoke'){
beforClearEdit().then(() => {
state.loading = true
let _data = {
taskName:apiServeNames[props.apiName].taskName,
client:'Chery'
}
getCommonCustominvoke(props.apiName,_data)
.then((res) => {
ElMessage.success('操作成功!')
getTableData(1)//
})
.finally(() => (state.loading = false))
})
}
//
else if (btn == 'outputMany'){
if(!state.tableSelectList || state.tableSelectList.length <= 0 ){
return ElMessage.warning('未选中任何数据')
}
// todo:
console.log(state.tableSelectList)
}
}
//
function searchRightBtnHandle(btn){
let _idEditData = checkPageEditList()
if(!_idEditData || _idEditData.length <= 0)return ElMessage.warning('暂无数据修改')
ElMessageBox.confirm('是否确定提交更改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// todo:
console.log(613,_idEditData)
})
}
//
function sortChange(data) {
beforClearEdit().then(() => {
const { prop, order } = data;
if (!prop || !order) {
state.sortFilter.sortBy = undefined;
state.sortFilter.isAscending = undefined;
getTableData(1);
return;
}
state.sortFilter.sortBy = prop;
state.sortFilter.isAscending = (order == "ascending");
getTableData(1);
})
}
//
function importSuccess(response,importDate){
getTableData()
}
// size-change
function pageSizeChange(pageSize,returnSize){
state.pageLoading=true
let _oldSize = state.pager.pageSize
state.pager.pageSize = pageSize
beforClearEdit()
.then(res => {
getTableData(1)
state.pageLoading=false
})
.catch(res=>{
state.pager.pageSize = _oldSize
state.pageLoading=false
})
}
// current-change
function pageCurrentChange(page){
beforClearEdit().then(res => {
getTableData(page)
})
}
//
function getDeatilLableByProp(prop){
let _colums = apiTableColumns[props.detailColumName]
let _item = _colums.filter(item=>item.prop == prop)
let _name = null
if(_item && _item.length > 0){
_name = _item[0].title
}
return _name
}
//
function getEditItemDisabled(item,row,index){
let _auth = auths.hasPermission(props.apiName+':pageSave')
if(item.disabled || !_auth){
return true
}
if(state.tableSelectList && state.tableSelectList.length > 0){
return true
}
let hasDisable = false
for(let i = 0;i<props.editDisabledConfig.length;i++){
if(row[props.editDisabledConfig[i].prop] == props.editDisabledConfig[i].ruleValue){
hasDisable = true
break
}
}
return hasDisable
}
// table
function selectableDisabled(row,index){
let _auth = auths.hasPermission(props.apiName+':outputMany')
if(!_auth)return false
let _idEditData = checkPageEditList()
return !_idEditData || _idEditData.length <= 0
}
// Focus
function getItemDetail(type,row,eventType) {
state.tableSelectList = []
// id
if(row.id == state.currentDetailId){return}
let _focuseExt = ['input','numberInput']
// focus_focuseExtcell
if(eventType == 'focus' && _focuseExt.indexOf(type) >= 0){return}
console.log(type,row,eventType)
console.log('------------')
state.currentDetailId = row.id
state.detailLoading = true
getCommonDetailById(props.apiName,row.id)
.then((res) => {
state.headerInfoData = []
for(let item in res.data){
let _label = getDeatilLableByProp(item)
if(_label){
state.headerInfoData.push({
label:_label,
value:res.data[item]
})
}
}
})
.finally(() => (state.detailLoading = false))
}
// change
function editItemChangeHandle(item,scope,data) {
if(state.stage_indexs.indexOf(scope.$index) < 0){
state.stage_indexs.push(scope.$index)
}
}
//
function beforClearEdit(){
return new Promise((resolve, reject) => {
let _idEditData = checkPageEditList()
if(!_idEditData || _idEditData.length <= 0){
resolve()
}else{
ElMessageBox.confirm(state.leaveSaveTip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
resolve()
}).catch(()=>{
reject()
})
}
})
}
//
function checkPageEditList(){
if(!state.stage_indexs || state.stage_indexs.length<=0){
return false
}
else{
let _changeArr = []
state.stage_indexs.forEach(item=>{
if(JSON.stringify(state.stage_tableData[item]) != JSON.stringify(state.tableData[item])){
_changeArr.push(state.tableData[item])
}
})
return _changeArr
}
}
onMounted(() => {
getTableData()
})
</script>
<style scoped lang="scss">
::v-deep .search-container{
.el-card__body{
width: 100%;
display: flex;
justify-content: space-between;
}
}
::v-deep .headerInfo-container{
margin-top:10px;
.el-card__body{
padding-bottom: 10px !important;
min-height:66px
}
}
::v-deep .headerInfoEmpty{
height:145px;
.el-empty__image{
width:90px !important
}
}
</style>

18
Web/src/components/elPager/index.vue

@ -1,7 +1,7 @@
<template>
<el-pagination
:currentPage="state.currentPage"
:page-size="state.pageSize"
:currentPage="props.pager.page"
:page-size="props.pager.pageSize"
:total="props.pager.total"
:background="props.pageBackGround"
:layout="props.pageLayout"
@ -16,11 +16,6 @@
defineOptions({ name: 'elPager' })
import { reactive, ref, onMounted,watch } from 'vue'
import { ElMessageBox, ElMessage,ElPagination } from 'element-plus'
const state = reactive({
currentPage:1,
pageSize:null
})
const props = defineProps({
// table
@ -47,25 +42,18 @@
pageSizeList:{
type: Object,
default: [10, 20, 50, 100]
}
},
})
const emits = defineEmits(['pageSizeChange', 'pageCurrentChange'])
watch(props.pager, (val) => {
state.currentPage = val.page
state.pageSize = val.pageSize
})
// size-change
function pageSizeChange(pageSize){
state.pageSize = pageSize
emits('pageSizeChange',pageSize)
}
// current-change
function pageCurrentChange(page){
state.currentPage = page
emits('pageCurrentChange',page)
}

73
Web/src/components/elTable/index.vue

@ -6,6 +6,7 @@
:border="true"
@sort-change="sortChange"
@selection-change="tableSelectionHandle"
:row-class-name="'setDisabledStyle'"
>
<!-- 多选框 -->
<el-table-column
@ -13,6 +14,7 @@
type="selection"
:fixed="'left'"
width="55"
:selectable="selectableDisabled"
/>
<!-- 左侧操作列 -->
<el-table-column
@ -60,8 +62,11 @@
v-else-if="item.type == 'input'"
v-model="scope.row[item.prop]"
:placeholder="item.label"
:disabled="item.disabled"
:disabled="getEditItemDisabled(item,scope.row,scope)"
:clearable="!item.noClear"
@focus="(event)=>{editItemFocusHandle(item,scope,event)}"
@change="editItemChangeHandle(item,scope,arguments)"
@clear="editItemClearHandle(item,scope)"
/>
<!-- 可编辑字典选择 -->
<el-select
@ -69,8 +74,11 @@
v-model="scope.row[item.prop]"
:filterable="!item.noSearch"
placeholder="请选择"
:disabled="item.disabled"
:clearable="!item.noClear">
:disabled="getEditItemDisabled(item,scope.row,scope)"
:clearable="!item.noClear"
@focus="(event)=>{editItemFocusHandle(item,scope,event)}"
@change="editItemChangeHandle(item,scope,arguments)"
@clear="editItemClearHandle(item,scope)">
<el-option
v-for="(op,op_index) in item.options"
:key="op_index"
@ -87,7 +95,10 @@
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
:clearable="!item.noClear"
:disabled="item.disabled"
:disabled="getEditItemDisabled(item,scope.row,scope)"
@focus="(event)=>{editItemFocusHandle(item,scope,event)}"
@change="editItemChangeHandle(item,scope,arguments)"
@clear="editItemClearHandle(item,scope)"
/>
<!-- 可编辑数字 -->
<el-input-number
@ -95,8 +106,9 @@
v-model="scope.row[item.prop]"
:min="item.min"
:max="item.max"
:clearable="!item.noClear"
:disabled="item.disabled"
:disabled="getEditItemDisabled(item,scope.row,scope)"
@focus="(event)=>{editItemFocusHandle(item,scope,event)}"
@change="editItemChangeHandle(item,scope,arguments)"
/>
<!-- 正常直接显示 -->
<span v-else> {{ scope.row[item.prop] }} </span>
@ -185,18 +197,26 @@
type: String,
default: 'center'
},
// tabel
isEditTable:{
type: Boolean,
//
getEditItemDisabled:{
type: [Function,Boolean],
default: false
},
// table
selectableDisabled:{
type: [Function,Boolean],
default: true
}
})
const emits = defineEmits([
'sortChange',
'leftOperationHadel',
'rightOperationHadel',
'tableSelectionHandle'
'tableSelectionHandle',
'editItemFocusHandle',
'editItemChangeHandle',
'editItemClearHandle',
])
//
@ -240,6 +260,39 @@
return _arr
}
//
function getEditItemDisabled(item,row,scope){
if(typeof props.getEditItemDisabled == 'boolean'){
return props.getEditItemDisabled
}else{
return props.getEditItemDisabled(item,row,scope.$index)
}
}
// table
function selectableDisabled(row,index){
if(typeof props.selectableDisabled == 'function'){
return props.selectableDisabled(row,index)
}else{
return props.selectableDisabled
}
}
// Focus
function editItemFocusHandle(item,scope,event) {
emits('editItemFocusHandle',item,scope,event)
}
// change
function editItemChangeHandle(item,scope,data) {
emits('editItemChangeHandle',item,scope,data)
}
// clear
function editItemClearHandle(item,scope) {
emits('editItemClearHandle',item,scope)
}
//
function rightOperationHadel(btn,scope) {
emits('rightOperationHadel',btn,scope)

3
Web/src/components/tablePage/index.vue

@ -191,8 +191,7 @@
default: null
},
// writeState=true
// readState使,
// =
// 使,=
apiRightHideConfig:{
type: Object,
default: {

33
Web/src/utils/common/apiTableColumns.js

@ -117,6 +117,39 @@ const apiTableColumns = {
{prop:'quantityMeet11',title:'满足数量11',type:'numberInput'},
{prop:'quantityMeet12',title:'满足数量12',type:'numberInput'},
],
// M+6月物料需求计划风险确认-明细
cherysupplierconmmrpDetail:[
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'零件号'},
{prop:'materialDescription',title:'零件名称'},
{prop:'plantId',title:'工厂代码'},
{prop:'plantName',title:'工厂名称'},
{prop:'startMonth',title:'起始月份'},
{prop:'quantityDemand1',title:'需求数量1'},
{prop:'quantityDemand2',title:'需求数量2'},
{prop:'quantityDemand3',title:'需求数量3'},
{prop:'quantityDemand4',title:'需求数量4'},
{prop:'quantityDemand5',title:'需求数量5'},
{prop:'quantityDemand6',title:'需求数量6'},
{prop:'quantityDemand7',title:'需求数量7'},
{prop:'quantityDemand8',title:'需求数量8'},
{prop:'quantityDemand9',title:'需求数量9'},
{prop:'quantityDemand10',title:'需求数量10',width:130},
{prop:'quantityDemand11',title:'需求数量11',width:130},
{prop:'quantityDemand12',title:'需求数量12',width:130},
{prop:'requestDate',title:'请求日期',width:180},
// {prop:'remark',title:'备注',align:'left',width:300},
{prop:'createByUser',title:'创建人'},
{prop:'createTime',title:'创建时间',width:180},
// {prop:'creationTime',title:'创建时间(接收)',width:180},
{prop:'updateByUser',title:'修改人'},
{prop:'updateTime',title:'修改时间',width:180},
{prop:'version',title:'版本号'},
// {prop:'isDelete',title:'是否删除',type:'tagFilter',options:EnumList.whether},
// {prop:'isUpdate',title:'是否更新',type:'tagFilter',options:EnumList.whether},
// {prop:'writeState',title:'writeState',type:'tagFilter',options:EnumList.whetherBoolean},
// {prop:'readState',title:'readState',type:'tagFilter',options:EnumList.whetherBoolean},
],
// 日物料需求计划
cherysuppliermrpdata:[
{prop:'releaseEdition',title:'需求发布版次',width:150},

11
Web/src/views/logisticsPlan/supplierConMmrp/index.vue

@ -1,19 +1,22 @@
<template>
<tablePage
<ediTtablePage
:columnWidth="200"
:apiName="state.apiName"
:searchOptions="state.searchOptions"
:searchFilter="state.searchFilter"
:rightOperation="state.rightOperation"
:isEditTable="true"
></tablePage>
:detailColumName="'cherysupplierconmmrpDetail'"
:searchButtons="['search','export','outputMany']"
:multipleTable="true"
></ediTtablePage>
</template>
<script setup>
// M+6
defineOptions({ name: 'supplierConMmrp' })
import { reactive, ref, onMounted } from 'vue'
import tablePage from '@/components/tablePage/index.vue'
import ediTtablePage from '@/components/ediTtablePage/index.vue'
const state = reactive({
apiName:'cherysupplierconmmrp',

Loading…
Cancel
Save