Browse Source

【EQI前端】编辑,导入等暂存

web
安虹睿 1 week ago
parent
commit
ab46d560ac
  1. 2
      Web/.env.development
  2. 18
      Web/src/api/common/index.js
  3. 178
      Web/src/components/apiEditPop/index.vue
  4. 115
      Web/src/components/elTable/index.vue
  5. 35
      Web/src/components/importPop/index.vue
  6. 161
      Web/src/components/tablePage/index.vue
  7. 96
      Web/src/utils/common/apiTableColumns.js
  8. 18
      Web/src/utils/common/enumList.js
  9. 2
      Web/src/utils/request.js
  10. 55
      Web/src/views/demo/tablePageDemo.vue
  11. 26
      Web/src/views/logisticsPlan/supplierConMmrp/index.vue
  12. 6
      Web/src/views/logisticsPlan/supplierProPlaning/index.vue
  13. 39
      Web/src/views/logisticsPlan/supplierSinvData/index.vue
  14. 54
      Web/src/views/productionQuality/supplierProMaterialStock/index.vue
  15. 75
      Web/src/views/task/taskSub/index.vue

2
Web/.env.development

@ -2,4 +2,4 @@
ENV = 'development'
# base api
VITE_API_BASE_URL = 'http://192.168.1.228:7629/'
VITE_API_BASE_URL = 'http://192.168.1.228:7629'

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

@ -10,6 +10,24 @@ export function getCommonPaged(urlName,data) {
})
}
// 通过id获取实体
export function getCommonInfoById(urlName,id) {
return request({
url: `/api/${urlName}/getbyid`,
method: 'get',
params:{id:id}
})
}
// 修改提交
export function putCommonUpdate(urlName,data) {
return request({
url: `/api/${urlName}/update`,
method: 'put',
data
})
}
// 导出
export function postCommonExport(urlName,data) {
return request({

178
Web/src/components/apiEditPop/index.vue

@ -0,0 +1,178 @@
<template>
<el-dialog
v-model="dialogVisible"
title="编辑"
width="70%"
:close-on-click-modal="false"
top="10vh"
>
<div v-loading="formLoading" style="height:calc(70vh - 50px);overflow:auto">
<el-form
ref="editFormRef"
v-if="!formLoading"
:model="formData"
:size="'large'"
:rules="props.formRules">
<el-row :gutter="40">
<el-col
v-for="(item, index) in formConfig"
:span="getItemConfig(item,'colSpan') || 12"
:key="index"
>
<el-form-item
:prop="getItemConfig(item,'prop')"
:label="getItemConfig(item,'title')"
:label-width="getItemConfig(item,'labelWidth') || 180"
>
<!-- 文本 -->
<el-input
v-if="!getItemConfig(item) || getItemConfig(item) == 'input'"
v-model="formData[getItemConfig(item,'prop')]"
:placeholder="'请输入'"
:clearable="!getItemConfig(item,'noClear')"
:disabled="getItemConfig(item,'disabled')"
/>
<!-- 数字 -->
<el-input-number
v-if="getItemConfig(item) == 'number'"
v-model="formData[getItemConfig(item,'prop')]"
:min="getItemConfig(item,'min')"
:max="getItemConfig(item,'max')"
:clearable="!getItemConfig(item,'noClear')"
:disabled="getItemConfig(item,'disabled')"
/>
<!-- 时间 -->
<el-date-picker
v-if="getItemConfig(item) == 'datetime'"
v-model="formData[getItemConfig(item,'prop')]"
style="width:100%"
type="datetime"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
:clearable="!getItemConfig(item,'noClear')"
:disabled="getItemConfig(item,'disabled')"
/>
<!-- 选择框 -->
<el-select
v-if="getItemConfig(item) == 'select' || getItemConfig(item) == 'tagFilter'"
v-model="formData[getItemConfig(item,'prop')]"
:filterable="!getItemConfig(item,'noSearch')"
placeholder="请选择"
:clearable="!getItemConfig(item,'noClear')"
:disabled="getItemConfig(item,'disabled')"
>
<el-option
v-for="(op,op_index) in getItemConfig(item,'options')"
:key="op_index"
:label="op.label"
:value="op.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<template #footer>
<div style="padding:10px">
<el-button el-button @click="close">取消</el-button>
<el-button :disabled="formLoading" type="primary" @click="submitForm">确定</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
defineOptions({ name: 'apiEditPop' })
import { reactive, ref, onMounted } from 'vue'
import { ElDialog,ElMessage } from 'element-plus'
import { getCommonInfoById } from '@/api/common/index'
import { useRoute } from 'vue-router'
const route = useRoute()
const dialogVisible = ref(false) //
const formLoading = ref(false) //
const formData = ref(null)//
const formConfig = ref(null)//
const props = defineProps({
// api
apiName: {
type: String,
default: null
},
//
formRules:{
type: Object,
default: null
}
})
/** 重置表单 */
const resetForm = () => {
//
formLoading.value = false
formData.value = null
formConfig.value = null
}
/** 打开弹窗 */
const open = (configs,row) => {
resetForm()
dialogVisible.value = true
formConfig.value = configs
getFormData(row.uId)
}
/** 关闭弹窗 */
const close = () => {
//
resetForm()
dialogVisible.value = false
}
//
const changeLoading = (data) => {
formLoading.value = data
}
const editFormRef = ref(null)//
//
const validate = (data) => {
return editFormRef.value.validate(data)
}
defineExpose({ open,close,changeLoading,validate })
/** 获取表单 */
const getFormData = async (uId) => {
formLoading.value = true
getCommonInfoById(props.apiName,uId)
.then(res=>{
formData.value = res.data
formLoading.value = false
})
}
//
const getItemConfig = (item,type='type') => {
if(item.formConfig && item.formConfig[type]){
return item.formConfig[type]
}else{
return item[type]
}
}
const emits = defineEmits(['submitEditForm'])
/** 提交表单 */
const submitForm = async () => {
emits('submitEditForm',formData.value,formConfig.value)
}
</script>
<style lang="scss" scoped>
::v-deep .el-row{
margin:0 !important
}
</style>

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

@ -5,7 +5,34 @@
:data="props.tableData"
:border="true"
@sort-change="sortChange"
@selection-change="tableSelectionHandle"
>
<!-- 多选框 -->
<el-table-column
v-if="props.multipleTable"
type="selection"
:fixed="'left'"
width="55"
/>
<!-- 左侧操作列 -->
<el-table-column
v-if="props.leftOperation && props.leftOperation.length > 0"
:fixed="'left'"
:width="props.leftOperationColumnWidth"
label="操作"
:align="'center'">
<template #default="scope">
<el-button
v-for="(btn,index) in props.leftOperation"
:key="index"
:type="btn.type"
:link="btn.link"
@click="leftOperationHadel(btn,scope)"
>{{btn.label}}</el-button>
</template>
</el-table-column>
<!-- 数据列 -->
<el-table-column
v-for="(item, index) in props.tableColumns"
:key="index"
@ -15,14 +42,13 @@
:fixed="item.fixed"
:width="item.width || props.columnWidth"
:align="item.align || props.columnAlign"
:header-align="item.headerAlign || props.columnHeaderAlign"
>
:header-align="item.headerAlign || props.columnHeaderAlign">
<template #default="scope">
<!-- 时间格式 -->
<span v-if="item.type == 'datetime'"> {{ formatTableDate(scope.row[item.prop]) }} </span>
<!-- 标签格式 -->
<el-tag
v-if="item.type == 'tagFilter'"
v-else-if="item.type == 'tagFilter'"
:type="formatTableTagFilter('type',scope.row,item)"
>
{{ formatTableTagFilter('label',scope.row,item) }}
@ -31,6 +57,26 @@
<span v-else> {{ scope.row[item.prop] }} </span>
</template>
</el-table-column>
<!-- 右侧操作列 -->
<el-table-column
v-if="props.rightOperation && props.rightOperation.length > 0"
v-auth-any="getShowRightOpera()"
:fixed="'right'"
:width="props.rightOperationColumnWidth"
:align="'center'"
label="操作">
<template #default="scope">
<el-button
v-for="(btn,index) in props.rightOperation"
:key="index"
:type="btn.type"
:link="btn.link"
@click="rightOperationHadel(btn,scope)"
v-auth="btn.auth"
>{{btn.label}}</el-button>
</template>
</el-table-column>
</el-table>
</template>
@ -43,6 +89,31 @@
const state = reactive({})
const props = defineProps({
//
multipleTable:{
type: Boolean,
default: false
},
//
leftOperation:{
type: Object,
default: null
},
//
leftOperationColumnWidth:{
type: Number,
default: 120
},
//
rightOperation:{
type: Object,
default: null
},
//
rightOperationColumnWidth:{
type: Number,
default: 120
},
// table
tableData: {
type: Object,
@ -70,6 +141,18 @@
},
})
const emits = defineEmits([
'sortChange',
'leftOperationHadel',
'rightOperationHadel',
'tableSelectionHandle'
])
//
function tableSelectionHandle (val){
emits('tableSelectionHandle',val)
}
//
function formatTableDate(time) {
let _time = '-'
@ -80,14 +163,36 @@
// TagFilter
function formatTableTagFilter(type,row,item){
let _op = item.options.filter(op=>op.value == row[item.prop])
if(_op && _op.length > 0){ return _op[0][type] }
if(!_op || _op.length <=0 || !_op[0][type]){
if(type=='type'){return 'info'}
else{return '--'}
}else{
return _op[0][type]
}
}
const emits = defineEmits(['sortChange'])
//
function sortChange(data) {
emits('sortChange',data)
}
//
function leftOperationHadel(btn,scope) {
emits('leftOperationHadel',btn,scope)
}
//
function getShowRightOpera(){
let _arr = []
props.rightOperation.forEach(item=>{_arr.push(item.auth)})
return _arr
}
//
function rightOperationHadel(btn,scope) {
emits('rightOperationHadel',btn,scope)
}
onMounted(() => {})

35
Web/src/components/importPop/index.vue

@ -32,8 +32,8 @@
</el-button>
</div>
<div>
<el-button :disabled="formLoading" type="primary" @click="submitForm">确定</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button :disabled="formLoading" type="primary" @click="submitForm">确定</el-button>
</div>
</div>
</template>
@ -69,8 +69,10 @@ const props = defineProps({
default: '.xlsx,.xls'
},
})
const importUrl = `/api/${props.apiName}/import`
const mode = import.meta.env.MODE
let app_base_api = mode == 'prod' ? systemConfig.baseUrl : import.meta.env.VITE_API_BASE_URL
const importUrl = `${app_base_api}/api/${props.apiName}/import`
console.log('importUrl',importUrl)
/** 重置表单 */
const resetForm = () => {
@ -125,38 +127,15 @@ const submitForm = async () => {
// /** */
const emits = defineEmits(['success'])
// todo:
//
const submitFormSuccess = (response: any) => {
formLoading.value = true
formLoading.value = false
if (response) {
if(response.code == '200'){
ElMessage.success('导入成功!')
}else{
ElMessage.error(response.msg)
}
// if (response.code == 500) {
// uploadRef.value!.clearFiles()
// ElMessage.error('')
// formLoading.value = false
// return
// }
// // todo:
// else if (response.code == 0) {
// if (response.data.errorCount > 0) {
// ElMessage.confirm('').then(async () => {
// // todo:
// window.open(
// getJmreportBaseUrl() + response.data.errorFile,
// 'TITLE'
// )
// })
// } else {
// ElMessage.success('')
// }
// }
// else if(response.data == null){
// ElMessage.error(response.msg)
// }
}
//

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

@ -1,8 +1,9 @@
<template>
<div class="app-container" v-loading="state.loading">
<el-card class="search-container" v-if="!props.hideSearch">
<el-form :inline="true" v-auth="props.apiName + state.searchBtnOptions['search'].auth">
<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">
@ -70,6 +71,10 @@
@sortChange="sortChange"
:leftOperation="props.leftOperation"
@leftOperationHadel="leftOperationHadel"
:rightOperation="getRightOperation()"
@rightOperationHadel="rightOperationHadel"
:multipleTable="props.multipleTable"
@tableSelectionHandle="tableSelectionHandle"
></elTable>
<elPager
@ -86,30 +91,44 @@
:apiName="props.apiName"
@success="importSuccess"
/>
<!-- 编辑弹窗 -->
<apiEditPop
ref="apiEditPopRef"
:apiName="props.apiName"
@submitEditForm="submitEditForm"
:formRules="props.apiEditFormRules"
/>
</div>
</template>
<script setup>
defineOptions({ name: 'tablePage' })
import store from '@/stores'
import apiTableColumns from '@/utils/common/apiTableColumns'
import { reactive, ref, onMounted } from 'vue'
import { getCommonPaged,postCommonExport } from '@/api/common/index'
import { reactive, ref, onMounted,computed } from 'vue'
import { getCommonPaged,postCommonExport,putCommonUpdate } 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 { useRoute } from 'vue-router'
const route = useRoute()
const userStore = store.userStore()
const userInfo = userStore.state
const state = reactive({
loading:false,
searchBtnOptions:{
search:{icon:'Search',auth:':page',label:'查询',type:null},
import:{icon:'BottomRight',auth:':import',label:'导入',type:'warning'},
export:{icon:'TopRight',auth:':export',label:'导出',type:'success'},
custominvoke:{icon:'Position',auth:':custominvoke',label:'手动传出',type:'primary'},
},
tableData:[],
// table
@ -121,7 +140,8 @@
page: 1,
pageSize: 10,
total: 1,
}
},
tableSelectList:[]
})
const props = defineProps({
@ -135,11 +155,26 @@
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
},
// table
tableColumns: {
type: Object,
@ -153,7 +188,7 @@
//
searchButtons: {
type: Object,
default: ['search','import','export']
default: ['search','export']
},
// tablefilter
searchFilter: {
@ -175,6 +210,11 @@
type: String,
default: 'center'
},
//
apiEditFormRules:{
type: Object,
default: null
}
})
//
@ -182,12 +222,86 @@
return props.tableColumns || apiTableColumns[props.apiName]
}
const emits = defineEmits(['leftOperationHadel'])
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'},
}
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})
});
}
// 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)
}
emits('rightOperationHadel',btn,scope)
}
// todo:putCommonUpdate
const submitEditForm = async (formData,formConfig) => {
apiEditPopRef.value.validate((valid) => {
if(valid){
//
formData.remark= `修改信息:${userInfo.realName} ${formatDate(new Date(), "YYYY-mm-dd HH:MM:SS")}`
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")}
apiEditPopRef.value.changeLoading(true)
putCommonUpdate(props.apiName,formData)
.then(res=>{
apiEditPopRef.value.close()
ElMessage.success('操作成功!')
getTableData(1);
})
.finally(()=>{apiEditPopRef.value.changeLoading(false)})
}
})
}
//
function getPageParams(){
let _filters = []
@ -277,6 +391,39 @@
})
.finally(() => (state.loading = false))
}
// todo:
else if (btn == 'custominvoke'){
ElMessageBox.confirm('是否确定手动传出?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// state.loading = true
// deleteMenu({ ids:[id] }).then(() => {
// })
// .finally(() => (state.loading = false))
})
}
// todo:
else if (btn == 'custominvokeMany'){
console.log(state.tableSelectList)
if(state.tableSelectList && state.tableSelectList.length > 0 ){
ElMessageBox.confirm('是否确定手动传出?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// state.loading = true
// deleteMenu({ ids:[id] }).then(() => {
// })
// .finally(() => (state.loading = false))
})
}else{
ElMessage.warning('未选中任何数据')
}
}
}
//

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

@ -1,7 +1,7 @@
import EnumList from '@/utils/common/enumList'
const apiTableColumns = {
// 任务列
// 接口设置
taskconifgure:[
{prop:'api',title:'api',align:'left',width:200},
{prop:'corn',title:'corn'},
@ -17,6 +17,28 @@ const apiTableColumns = {
{prop:'remark',title:'remark',align:'left',width:300},
],
// 任务列表
tasksub:[
// {prop:'writeState',title:'writeState'},
// {prop:'readState',title:'readState'},
// {prop:'taskId',title:'taskId'},
{prop:'tableName',title:'表名',align:'left',width:240},
{prop:'taskName',title:'任务名称',align:'left',width:160},
{prop:'dataCount',title:'同步总数量'},
{prop:'subscriber',title:'客户名'},
{prop:'failedCount',title:'失败次数',type:'number'},
{prop:'failedInfo',title:'失败信息'},
{prop:'domain',title:'域名'},
{prop:'site',title:'站点'},
{prop:'syncedPageCount',title:'更新完成时间',width:150},
{prop:'remark',title:'备注',align:'left',width:300},
{prop:'createUser',title:'创建人'},
{prop:'creationTime',title:'创建时间',width:180},
{prop:'updateUser',title:'修改人'},
{prop:'updateTime',title:'修改时间',width:180},
],
/*计划物流 */
// 整车月度生产计划2
supplierproplaning:[
{prop:'releaseEdition',title:'需求发布版次',width:150},
@ -70,6 +92,32 @@ const apiTableColumns = {
{prop:'isDelete',title:'是否删除',type:'tagFilter',options:EnumList.whether},
{prop:'version',title:'版本号'},
],
// M+M+6月物料需求计划风险确认
cherysupplierconmmrp:[
{prop:'supplierCode',title:'供应商代码'},
{prop:'releaseEdition',title:'需求发布版次',width:150},
{prop:'materialCode',title:'零件号'},
{prop:'plantId',title:'工厂代码'},
{prop:'feedbackResults',title:'反馈结果',type:'tagFilter',options:EnumList.whether},
// todo:当反馈结果=1时,此字段必输
{prop:'ventureType',title:'风险类型',type:'tagFilter',options:EnumList.whether},
// todo:当反馈结果=1时,此字段必输
{prop:'ventureSpecific',title:'具体风险'},
{prop:'measures',title:'应对措施'},
{prop:'startMonth',title:'起始月份',type:'datetime'},
{prop:'quantityMeet1',title:'满足数量1',type:'number'},
{prop:'quantityMeet2',title:'满足数量2',type:'number'},
{prop:'quantityMeet3',title:'满足数量3',type:'number'},
{prop:'quantityMeet4',title:'满足数量4',type:'number'},
{prop:'quantityMeet5',title:'满足数量5',type:'number'},
{prop:'quantityMeet6',title:'满足数量6',type:'number'},
{prop:'quantityMeet7',title:'满足数量7',type:'number'},
{prop:'quantityMeet8',title:'满足数量8',type:'number'},
{prop:'quantityMeet9',title:'满足数量9',type:'number'},
{prop:'quantityMeet10',title:'满足数量10',type:'number'},
{prop:'quantityMeet11',title:'满足数量11',type:'number'},
{prop:'quantityMeet12',title:'满足数量12',type:'number'},
],
// 计划协议
cherysuppliersaweek:[
{prop:'scheduleAgreement',title:'计划协议号',width:120},
@ -181,14 +229,15 @@ const apiTableColumns = {
{prop:'materialCode',title:'零件号'},
{prop:'materialDescription',title:'零件名称'},
{prop:'materialType',title:'物料类型',type:'tagFilter',options:EnumList.materialType},
{prop:'quantityCurrent',title:'当前库存数量'},
{prop:'quantityPlan',title:'原材料在途数量'},
{prop:'quantityCurrent',title:'当前库存数量',type:'number'},
{prop:'quantityPlan',title:'原材料在途数量',type:'number'},
{prop:'inventoryStatus',title:'库存状态',type:'tagFilter',options:EnumList.inventoryStatus},
{prop:'safetyStock',title:'安全库存'},
{prop:'safetyStock',title:'安全库存',type:'number'},
{prop:'productionCycle',title:'生产/采购周期'},
{prop:'dataUpdateTime',title:'库存更新时间',width:180},
{prop:'dataUpdateTime',title:'库存更新时间',type:'datetime',width:180},
{prop:'supplierBatch',title:'批次'},
{prop:'supplieryxqDate',title:'效期截止日期',width:180},
{prop:'supplieryxqDate',title:'效期截止日期',type:'datetime',width:180},
{prop:'creationTime',title:'创建时间',type:'datetime',width:180,noEdit:true},
],
// 日MRP预警推移
cherysuppliermrpwarning:[
@ -210,6 +259,41 @@ const apiTableColumns = {
{prop:'isDelete',title:'是否删除',type:'tagFilter',options:EnumList.whether},
{prop:'version',title:'版本号'},
],
/*生产质量 */
// 来料检验数据
supplierpromaterialstock:[
{prop:'supplierCode',title:'供应商代码'},
{prop:'supplierName',title:'供应商名称'},
{prop:'supplierSubCode',title:'供应商子零件编号',width:180},
{prop:'supplierSubName',title:'供应商子零件名称',width:180},
{prop:'subSupplierCode',title:'分供方代码'},
{prop:'subSupplierName',title:'分供方名称'},
{prop:'subSupplierAddress',title:'分供方地址'},
{prop:'componentCode',title:'分供方子件编码'},
{prop:'componentName',title:'分供方子件名称'},
{prop:'subBatchNo',title:'子件批次号'},
{prop:'subBatchNum',title:'子件批次数量',type:'number'},
{prop:'subBatchSn',title:'子件SN码'},
{prop:'empCode',title:'检验人员编号'},
{prop:'empName',title:'检验人员姓名'},
{prop:'deviceCode',title:'检测设备编号'},
{prop:'deviceName',title:'检测设备名称'},
{prop:'featureName',title:'参数/特性名称'},
{prop:'featureUnit',title:'参数/特性单位'},
{prop:'standardValue',title:'参数/特性标准值',width:180},
{prop:'featureUpper',title:'参数/特性上限值',width:180},
{prop:'featureLower',title:'参数/特性下限值',width:180},
{prop:'featureValue',title:'参数/特性实测值',width:180},
{prop:'checkNo',title:'来料检验单号'},
{prop:'checkResult',title:'批次的最终判定结果',type:'tagFilter',options:EnumList.checkResult,width:180},
{prop:'checkTime',title:'检验时间',type:'datetime',width:180},
{prop:'samplingRate',title:'控制项要求频率',type:'number'},
{prop:'limitUpdateTime',title:'上下限更新时间',type:'datetime',width:180},
{prop:'vendorFieldDesc',title:'控制项描述'},
{prop:'vendorFieldCode',title:'控制项代码'},
{prop:'deadLine',title:'库存有效日期',type:'datetime',width:180},
]
}
export default apiTableColumns

18
Web/src/utils/common/enumList.js

@ -22,6 +22,24 @@ const EnumList = {
{label:'备件',value:'备件'},
{label:'KD件',value:'KD件'},
],
// 反馈结果
feedbackResults:[
{label:'异常',value:1},
{label:'无异常',value:0},
],
// 风险类型
ventureType:[
{label:'生产节拍不足',value:1},
{label:'人员不足',value:2},
{label:'原材料不足',value:3},
{label:'设备异常',value:4},
{label:'其他',value:5},
],
// 批次的最终判定结果
checkResult:[
{label:'合格',value:'OK'},
{label:'不合格',value:'NG'},
]
}
export default EnumList

2
Web/src/utils/request.js

@ -60,7 +60,7 @@ service.interceptors.response.use(
return response
}
// 1 是正确 .
if (res.code != 1) {
if (res.code != 1 && res.code != 200) {
//报错
ElMessage({
message: res.message || 'Error',

55
Web/src/views/demo/tablePageDemo.vue

@ -0,0 +1,55 @@
<template>
<tablePage
:apiName="state.apiName"
:searchOptions="state.searchOptions"
:searchFilter="state.searchFilter"
></tablePage>
</template>
<script setup>
// tablePage 使demo
defineOptions({ name: 'tablePageDemo' })
import { reactive, ref, onMounted } from 'vue'
import tablePage from '@/components/tablePage/index.vue'
const state = reactive({
apiName:'supplierproplaning',
searchFilter: {
materialCode: null,
// createTime:null,
// isDelete:null,
// quantity1:null
},
searchOptions:[
{type:'input',prop:'materialCode',label:'物料号'},
// {type:'datetimerange',prop:'createTime',label:''},
// {type:'number',prop:'quantity1',label:'1'},
// {type:'select',prop:'isDelete',label:'',options:EnumList.whether,noSearch:true},
],
// , view/task/taskConifgure.vue
// leftOperation:[
// {label:'',name:'showInfo',link:true,type:'primary'}
// ],
// 1api
// rightOperation:'apiUpdate',
//2,api使showApiRightOperation
// rightOperation:[],
// showApiRightOperation:['apiUpdate']
})
//
// function leftOperationHadel(btn,scope) {
// console.log(btn,scope)
// }
//2
// state.rightOperation = [{label:'2',name:'edit',link:true,type:'danger',auth:state.apiName+':page'}]
//
// :leftOperation="state.leftOperation"
// @leftOperationHadel="leftOperationHadel"
// :rightOperation="state.rightOperation"
// :showApiRightOperation="state.showApiRightOperation"
</script>

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

@ -0,0 +1,26 @@
<template>
<tablePage
:columnWidth="150"
:apiName="state.apiName"
:searchOptions="state.searchOptions"
:searchFilter="state.searchFilter"
:rightOperation="state.rightOperation"
></tablePage>
</template>
<script setup>
defineOptions({ name: 'supplierConMmrp' })
import { reactive, ref, onMounted } from 'vue'
import tablePage from '@/components/tablePage/index.vue'
const state = reactive({
apiName:'cherysupplierconmmrp',
searchFilter: {
supplierCode: null
},
searchOptions:[
{type:'input',prop:'supplierCode',label:'供应商代码'}
],
rightOperation:'apiUpdate',
})
</script>

6
Web/src/views/logisticsPlan/supplierProPlaning/index.vue

@ -15,15 +15,9 @@ const state = reactive({
apiName:'supplierproplaning',
searchFilter: {
materialCode: null,
// createTime:null,
// isDelete:null,
// quantity1:null
},
searchOptions:[
{type:'input',prop:'materialCode',label:'物料号'},
// {type:'datetimerange',prop:'createTime',label:''},
// {type:'number',prop:'quantity1',label:'1'},
// {type:'select',prop:'isDelete',label:'',options:EnumList.whether,noSearch:true},
],
})
</script>

39
Web/src/views/logisticsPlan/supplierSinvData/index.vue

@ -0,0 +1,39 @@
<template>
<tablePage
:columnWidth="150"
:apiName="state.apiName"
:searchOptions="state.searchOptions"
:searchFilter="state.searchFilter"
:rightOperation="state.rightOperation"
:apiEditFormRules="state.apiEditFormRules"
></tablePage>
</template>
<script setup>
defineOptions({ name: 'supplierSinvData' })
import { reactive, ref, onMounted } from 'vue'
import tablePage from '@/components/tablePage/index.vue'
const state = reactive({
apiName:'cherysuppliersinvdata',
searchFilter: {
supplierCode: null
},
searchOptions:[
{type:'input',prop:'supplierCode',label:'供应商代码'}
],
rightOperation:'apiUpdate',
apiEditFormRules:{
supplierCode: [{ required: true, message: '必填项', trigger: 'blur' }],
supplierName: [{ required: true, message: '必填项', trigger: 'blur' }],
materialCode: [{ required: true, message: '必填项', trigger: 'blur' }],
materialDescription: [{ required: true, message: '必填项', trigger: 'blur' }],
quantityCurrent: [{ required: true, message: '必填项', trigger: 'blur' }],
quantityPlan: [{ required: true, message: '必填项', trigger: 'blur' }],
inventoryStatus: [{ required: true, message: '必填项', trigger: 'blur' }],
safetyStock: [{ required: true, message: '必填项', trigger: 'blur' }],
productionCycle: [{ required: true, message: '必填项', trigger: 'blur' }],
supplierBatch: [{ required: true, message: '必填项', trigger: 'blur' }],
}
})
</script>

54
Web/src/views/productionQuality/supplierProMaterialStock/index.vue

@ -0,0 +1,54 @@
<template>
<tablePage
:columnWidth="150"
:apiName="state.apiName"
:searchOptions="state.searchOptions"
:searchFilter="state.searchFilter"
:rightOperation="state.rightOperation"
:apiEditFormRules="state.apiEditFormRules"
:searchButtons="['search','import','export']"
></tablePage>
</template>
<script setup>
defineOptions({ name: 'supplierProMaterialStock' })
import { reactive, ref, onMounted } from 'vue'
import tablePage from '@/components/tablePage/index.vue'
const state = reactive({
apiName:'supplierpromaterialstock',
searchFilter: {
supplierCode: null
},
searchOptions:[
{type:'input',prop:'supplierCode',label:'供应商代码'}
],
rightOperation:'apiUpdate',
apiEditFormRules:{
supplierCode: [{ required: true, message: '必填项', trigger: 'blur' }],
supplierName: [{ required: true, message: '必填项', trigger: 'blur' }],
supplierSubCode: [{ required: true, message: '必填项', trigger: 'blur' }],
supplierSubName: [{ required: true, message: '必填项', trigger: 'blur' }],
subSupplierCode: [{ required: true, message: '必填项', trigger: 'blur' }],
subSupplierName: [{ required: true, message: '必填项', trigger: 'blur' }],
subSupplierAddress: [{ required: true, message: '必填项', trigger: 'blur' }],
subBatchNo: [{ required: true, message: '必填项', trigger: 'blur' }],
subBatchNum: [{ required: true, message: '必填项', trigger: 'blur' }],
empCode: [{ required: true, message: '必填项', trigger: 'blur' }],
empName: [{ required: true, message: '必填项', trigger: 'blur' }],
deviceCode: [{ required: true, message: '必填项', trigger: 'blur' }],
deviceName: [{ required: true, message: '必填项', trigger: 'blur' }],
featureName: [{ required: true, message: '必填项', trigger: 'blur' }],
featureUnit: [{ required: true, message: '必填项', trigger: 'blur' }],
standardValue: [{ required: true, message: '必填项', trigger: 'blur' }],
featureUpper: [{ required: true, message: '必填项', trigger: 'blur' }],
featureLower: [{ required: true, message: '必填项', trigger: 'blur' }],
featureValue: [{ required: true, message: '必填项', trigger: 'blur' }],
checkNo: [{ required: true, message: '必填项', trigger: 'blur' }],
checkResult: [{ required: true, message: '必填项', trigger: 'blur' }],
checkTime: [{ required: true, message: '必填项', trigger: 'blur' }],
vendorFieldCode: [{ required: true, message: '必填项', trigger: 'blur' }],
deadLine: [{ required: true, message: '必填项', trigger: 'blur' }],
}
})
</script>

75
Web/src/views/task/taskSub/index.vue

@ -0,0 +1,75 @@
<template>
<div class="taskConifgurePage">
<!-- -->
<tablePage
:apiName="state.apiName"
:searchOptions="state.searchOptions"
:searchFilter="state.searchFilter"
@leftOperationHadel="leftOperationHadel"
:leftOperation="state.leftOperation"
></tablePage>
<!-- 明细抽屉 -->
<el-drawer
v-model="state.drawerShow"
title="详情"
direction="rtl"
destroy-on-close
:size="'80%'"
>
<div style="height: 100%;display: flex">
<tablePage
:apiName="state.drawerApiName"
:hideSearch="true"
></tablePage>
</div>
</el-drawer>
</div>
</template>
<script setup>
defineOptions({ name: 'taskSub' })
import { reactive, ref, onMounted,nextTick } from 'vue'
import tablePage from '@/components/tablePage/index.vue'
const state = reactive({
apiName:'tasksub',
searchFilter: {
taskName: null
},
searchOptions:[
{type:'input',prop:'taskName',label:'任务名称'}
],
leftOperation:[
{label:'查看详情',name:'showInfo',link:true,type:'primary'}
],
drawerShow:false,
drawerApiName:null,
})
function leftOperationHadel(btn,scope) {
//
if(btn.name == 'showInfo'){
// todo:
if(scope.row.uId == '1'){
state.drawerApiName = 'cherysuppliersaweek'
}else{
state.drawerApiName = 'supplierproplaning'
}
nextTick(() => {
state.drawerShow = true
})
}
}
</script>
<style scope lang="scss">
.taskConifgurePage{
height: 100%;
display: flex;
width:100%;
.el-drawer__header {
margin-bottom:0 !important
}
}
</style>
Loading…
Cancel
Save