Browse Source

生产bug修复和优化开发

master^2
ljlong_2630 2 weeks ago
parent
commit
962222e84b
  1. 8
      .env.development
  2. 6
      src/api/eam/item/applicationRecordMain/index.ts
  3. 13
      src/utils/disposition/defaultButtons.ts
  4. 2
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  5. 103
      src/views/eam/device/devicemaintainjob/index.vue
  6. 58
      src/views/eam/item/applicationRecord/applicationRecordMain.data.ts
  7. 24
      src/views/eam/item/applicationRecord/index.vue
  8. 27
      src/views/eam/item/itemAccounts/itemAccounts.data.ts
  9. 14
      src/views/eam/item/itemApplyMain/index.vue
  10. 91
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts
  11. 47
      src/views/eam/item/itemInLocation/itemInLocation.data.ts
  12. 41
      src/views/eam/item/itemOutLocation/itemOutLocation.data.ts
  13. 107
      src/views/eam/mold/moldmaintainjob/index.vue
  14. 11
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

8
.env.development

@ -4,11 +4,11 @@ NODE_ENV=development
VITE_DEV=false VITE_DEV=false
# 请求路径 # 请求路径
VITE_BASE_URL='http://192.168.0.159:12080' VITE_BASE_URL='http://192.168.0.229:12081'
# VITE_BASE_URL='http://192.168.0.165:12080' # VITE_BASE_URL='http://192.168.0.165:12080'
# 上传路径 # 上传路径
VITE_UPLOAD_URL='http://192.168.0.159:12080/admin-api/infra/file/upload' VITE_UPLOAD_URL='http://192.168.0.229:12081/admin-api/infra/file/upload'
# 接口前缀 # 接口前缀
VITE_API_BASEPATH=/dev-api VITE_API_BASEPATH=/dev-api
@ -32,7 +32,7 @@ VITE_SOURCEMAP=false
VITE_OUT_DIR=dist VITE_OUT_DIR=dist
# 自定义接口路径 # 自定义接口路径
VITE_INTERFACE_URL='http://192.168.0.159:12080/magic/web/index.html' VITE_INTERFACE_URL='http://192.168.0.229:12081/magic/web/index.html'
# 积木报表请求路径 # 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://192.168.0.159:12080' VITE_JMREPORT_BASE_URL='http://192.168.0.229:12081'

6
src/api/eam/item/applicationRecordMain/index.ts

@ -65,3 +65,9 @@ export const exportApplicationRecordMain = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-request-main/get-import-template' }) return request.download({ url: '/eam/item-apply-request-main/get-import-template' })
} }
// 关闭工单
export const updateRequestStatus = async (number) => {
return await request.get({ url: `/eam/item-apply-request-main/updateRequestStatus?number=` + number })
}

13
src/utils/disposition/defaultButtons.ts

@ -1026,6 +1026,19 @@ export function pictureBtn(option:any) {
}) })
} }
// 主列表-完成
export function uploadImgsBtn(option:any) {
return __defaultBtnOption(option,{
label: '上传图片',
name: 'uploadImgs',
hide: false,
type: 'success',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-二维码 // 主列表-二维码
export function selectQrCodeBatchBtn(option:any) { export function selectQrCodeBatchBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{

2
src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts

@ -251,7 +251,7 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 200, width: 260,
fixed: 'right' fixed: 'right'
}, },
isDetail: false, isDetail: false,

103
src/views/eam/device/devicemaintainjob/index.vue

@ -124,6 +124,32 @@
</template> </template>
</Dialog> </Dialog>
<Dialog
title="照片上传"
v-model="dialogUploadVisible"
:width="600"
:maxHeight="900"
:style="{height:'600px'}"
:key="dialogFormKey"
>
<el-form ref="fileDialogUploadRef" :model="fileDialogUploadData" >
<el-form-item label="">
<UploadImgs v-model="fileDialogUploadData.filePathList" :limit="20" />
</el-form-item>
</el-form>
<el-button type="primary" @click="dialogUploadFile">提交</el-button>
</Dialog>
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -141,6 +167,8 @@ import { useUserStore } from '@/store/modules/user'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import * as uploadApi from '@/api/eam/upload'
import * as fileApi from '@/api/infra/file'
defineOptions({ name: 'DeviceMaintainOrderMain' }) defineOptions({ name: 'DeviceMaintainOrderMain' })
@ -155,6 +183,7 @@ const tableColumns = ref(DeviceMaintainOrderMain.allSchemas.tableColumns)
const tableData = ref([]) const tableData = ref([])
const dialogVisible = ref(false) const dialogVisible = ref(false)
const dialogRowData = ref() const dialogRowData = ref()
const dialogUploadVisible = ref(false)
const updateFormValue = ref({ const updateFormValue = ref({
verifyContent:'' verifyContent:''
}) })
@ -164,6 +193,15 @@ const src = ref(BASE_URL + '/jmreport/view/940395429096013824?token=' + getAcces
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const fileDialogUploadData = ref({
filePathList: []
})
const dialogUploadNumber = ref()
const dialogFormKey = ref(0)
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
@ -280,8 +318,14 @@ const butttondata = (row) => {
defaultButtons.orderPrintBtn({ defaultButtons.orderPrintBtn({
hasPermi:'eam:device-maintain-job-main:print', hasPermi:'eam:device-maintain-job-main:print',
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED')) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED'))
}) // }), //
defaultButtons.uploadImgsBtn({
hasPermi: 'eam:device-maintain-job-main:upload',
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}), //
defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0 && row.status != 'PECEIVED')
}) //
] ]
} }
const onChange = (field, cur, item) => { const onChange = (field, cur, item) => {
@ -313,6 +357,12 @@ const buttonTableClick = async (val, row) => {
finishOrder(row) finishOrder(row)
} else if (val == 'orderPrint') { } else if (val == 'orderPrint') {
orderPrint(row) orderPrint(row)
} else if (val == 'uploadImgs') {
openDialogUpload(row)
} else if (val == 'picture') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} }
} }
@ -654,6 +704,55 @@ const onSubmit = () => {
}) })
} }
const openDialogUpload = (row) => {
dialogUploadNumber.value = row.number
uploadApi.getImage({
number: row.number,
funcCode: "maintenance"
})
.then((res) => {
fileApi.selectList().then(response=>{
fileDialogUploadData.value.filePathList = res.map(item=>{
response.forEach(element=>{
if(item.url == element.url){
item.name = element.name
}
})
return item
})
dialogUploadVisible.value = true
dialogFormKey.value += 1
})
})
}
function dialogUploadFile() {
let data = {
number: dialogUploadNumber.value,
fileInfoList: fileDialogUploadData.value.filePathList?fileDialogUploadData.value.filePathList:[],
funcCode: "maintenance",
}
uploadApi.uploadImage(data).then((res) => {
message.success(t('common.submitSuccess'))
})
}
const getImage = () => {
uploadApi.getImage({
number: dialogUploadNumber.value,
funcCode: "maintenance",
})
.then((res) => {
nextTick(() => {
fileDialogUploadData.value.filePathList = res
dialogFormKey.value += 1
})
})
}
const orderPrint = (row) => { const orderPrint = (row) => {
window.open(src.value + "&id=" + row.id) window.open(src.value + "&id=" + row.id)
} }

58
src/views/eam/item/applicationRecord/applicationRecordMain.data.ts

@ -3,8 +3,10 @@ import { dateFormatter } from '@/utils/formatTime'
import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data' import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts' import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance' import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import * as UserApi from '@/api/system/user'
import { validateHanset, validateEmail } from '@/utils/validator' import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
const userListAll = await UserApi.getSimpleUserList()
/** /**
* @returns {Array} * @returns {Array}
@ -21,12 +23,37 @@ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
fixed: 'left' fixed: 'left'
}, },
}, },
{
label: '申领时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isTable: true,
table: {
width: 180,
},
isForm: false
},
{ {
label: '申领人', label: '申领人',
field: 'applyId', field: 'applyId',
sort: 'custom', sort: 'custom',
isForm: false, isForm: false,
isSearch: false, isSearch: false,
table: {
width: 150,
},
},
{
label: '审批时间',
field: 'approveTime',
sort: 'custom',
formatter: dateFormatter,
isTable: true,
table: {
width: 180,
},
isForm: false
}, },
{ {
label: '审批人', label: '审批人',
@ -34,6 +61,9 @@ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isForm: false, isForm: false,
isSearch: false, isSearch: false,
table: {
width: 150,
},
}, },
{ {
label: '出库人', label: '出库人',
@ -41,11 +71,17 @@ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isForm: false, isForm: false,
isSearch: false, isSearch: false,
table: {
width: 150,
},
}, },
{ {
label: '描述', label: '描述',
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
table: {
width: 150,
},
}, },
{ {
label: '状态', label: '状态',
@ -136,6 +172,15 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
] ]
}, },
}, },
{
label: '备件名称',
field: 'name',
sort: 'custom',
isTable: true,
table: {
width: 150
},
},
{ {
label: '类型', label: '类型',
field: 'type', field: 'type',
@ -152,8 +197,15 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
disabled: false disabled: false
} }
}, },
{
label: '规格型号',
field: 'specifications',
sort: 'custom',
isTable: true,
table: {
width: 150
},
},
{ {
label: '设备/模具编号', label: '设备/模具编号',
field: 'deviceNumber', field: 'deviceNumber',
@ -218,8 +270,6 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
precision: 2 precision: 2
} }
}, },
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',

24
src/views/eam/item/applicationRecord/index.vue

@ -170,10 +170,20 @@
} }
} }
//
const isShowCloseButton = (row) => {
if (row.status == 1) {
return false
} else {
return true
}
}
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.approveBtn({ hide: isShowMainButton(row, ['0']) ,hasPermi:'item:itemApplyMain:approve'}), // defaultButtons.approveBtn({ hide: isShowMainButton(row, ['0']) ,hasPermi:'item:itemApplyMain:approve'}), //
defaultButtons.mainListOrderCloBtn({ hide: isShowCloseButton(row) ,hasPermi:'item:itemApplyMain:close'}), //
// defaultButtons.mainListEditBtn(null), // // defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), // // defaultButtons.mainListDeleteBtn(null), //
] ]
@ -187,6 +197,8 @@
handleApprove(row, '单据号', row.number) handleApprove(row, '单据号', row.number)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if(val == 'mainOrderClo') { //
handleClose(row)
} }
} }
@ -301,6 +313,18 @@
getList() // getList() //
} }
const handleClose = async (row) => {
await message.confirm("您确认要关闭此工单嘛?","关闭工单")
ApplicationRecordMainApi.updateRequestStatus(row.number).then(res=>{
if(!res.flag){
message.error(res.message);
}else{
message.success("工单关闭成功!")
getList()
}
})
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

27
src/views/eam/item/itemAccounts/itemAccounts.data.ts

@ -50,15 +50,38 @@ export const ItemAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'specifications', field: 'specifications',
sort: 'custom', sort: 'custom',
}, },
{ {
label: '库存数量', label: '(账内或账外)库存数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 110 width: 110
}, },
}, },
{
label: '库存总数',
field: 'totalStockQty',
sort: 'custom',
table: {
width: 150
},
},
{
label: '已申请库存数量',
field: 'requestQty',
sort: 'custom',
table: {
width: 150
},
},
{
label: '可申请库存数量',
field: 'availableQty',
sort: 'custom',
table: {
width: 150
},
},
{ {
label: '单价', label: '单价',
field: 'singlePrice', field: 'singlePrice',

14
src/views/eam/item/itemApplyMain/index.vue

@ -97,6 +97,9 @@
row['isInAccount'] = val[0]['isInAccount'] row['isInAccount'] = val[0]['isInAccount']
row['currentQty'] = val[0]['qty'] row['currentQty'] = val[0]['qty']
row['available'] = val[0]['available'] row['available'] = val[0]['available']
row['totalStockQty'] = val[0]['totalStockQty']
row['requestQty'] = val[0]['requestQty']
row['availableQty'] = val[0]['availableQty']
} }
if (formField == 'deviceNumber') { if (formField == 'deviceNumber') {
row['deviceNumber'] = val[0]['number'] row['deviceNumber'] = val[0]['number']
@ -114,10 +117,13 @@
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if (formField == 'itemNumber') { if (formField == 'itemNumber') {
setV['itemNumber'] = val[0]['itemNumber'] setV['itemNumber'] = val[0]['itemNumber']
setV['isInAccount'] = val[0]['isInAccount'] setV['isInAccount'] = val[0]['isInAccount']
setV['currentQty'] = val[0]['qty'] setV['currentQty'] = val[0]['qty']
setV['available'] = val[0]['available'] setV['available'] = val[0]['available']
setV['totalStockQty'] = val[0]['totalStockQty']
setV['requestQty'] = val[0]['requestQty']
setV['availableQty'] = val[0]['availableQty']
} else if (formField == 'deviceNumber') { } else if (formField == 'deviceNumber') {
setV['deviceNumber'] = val[0]['number'] setV['deviceNumber'] = val[0]['number']
} }
@ -289,8 +295,8 @@
data.subList = tableData.value // data.subList = tableData.value //
try { try {
for (let item of tableData.value) { for (let item of tableData.value) {
if (item.qty > item.currentQty) { if (item.qty > item.availableQty) {
message.error('要货计划数量不得大于订单数量-已计划数量') message.error('要货计划数量不得大于订单可申请库存数量')
return false; return false;
} }
} }
@ -359,4 +365,4 @@
getList() getList()
importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate() importTemplateData.templateUrl = await ItemApplyMainApi.importTemplate()
}) })
</script> </script>

91
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -65,6 +65,27 @@ export const ItemApplyMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
}, },
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isTable: true,
table: {
width: 180,
},
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
},
{ {
label: '操作', label: '操作',
@ -156,6 +177,15 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '备件名称',
field: 'name',
sort: 'custom',
isTable: true,
table: {
width: 150
},
},
{ {
label: '类型', label: '类型',
field: 'type', field: 'type',
@ -172,6 +202,15 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
disabled: false disabled: false
} }
}, },
{
label: '规格型号',
field: 'specifications',
sort: 'custom',
isTable: true,
table: {
width: 150
},
},
{ {
label: '设备/模具编号', label: '设备/模具编号',
field: 'deviceNumber', field: 'deviceNumber',
@ -237,7 +276,7 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '库存数量', label: '(库内或库外)库存数量',
field: 'currentQty', field: 'currentQty',
sort: 'custom', sort: 'custom',
table: { table: {
@ -256,7 +295,55 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
type: 'InputNumber', type: 'InputNumber',
min: 0, min: 0,
precision: 2 precision: 2
} },
},
{
label: '库存总数',
field: 'totalStockQty',
sort: 'custom',
table: {
width: 150
},
isForm: false,
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 2
},
isTable:false,
},
{
label: '已申请库存数量',
field: 'requestQty',
sort: 'custom',
table: {
width: 150
},
isForm: false,
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 2
},
isTable:false,
},
{
label: '可申请库存数量',
field: 'availableQty',
sort: 'custom',
table: {
width: 150
},
isForm: false,
tableForm: {
disabled: true,
type: 'InputNumber',
min: 0,
precision: 2
},
isTable:false,
}, },
// { // {
// label: '是否账内库', // label: '是否账内库',

47
src/views/eam/item/itemInLocation/itemInLocation.data.ts

@ -1,4 +1,6 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as UserApi from '@/api/system/user'
const userListAll = await UserApi.getSimpleUserList()
// 表单校验 // 表单校验
export const ItemInLocationRules = reactive({ export const ItemInLocationRules = reactive({
@ -13,18 +15,45 @@ export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
}, },
{ {
label: '备件编号', label: '备件编号',
field: 'itemNumber', field: 'itemNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
},
{
label: '备件名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 180,
},
}, },
{ {
label: '库位编号', label: '库位编号',
field: 'locationNumber', field: 'locationNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 150
},
},
{
label: '规格型号',
field: 'specifications',
sort: 'custom',
isTable: true,
table: {
width: 150
},
}, },
{ {
label: '类型', label: '类型',
@ -33,6 +62,9 @@ export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
dictType: DICT_TYPE.ITEM_OUT_IN_TYPE, dictType: DICT_TYPE.ITEM_OUT_IN_TYPE,
dictClass: 'string', dictClass: 'string',
table: {
width: 150
},
form: { form: {
component: 'Select' component: 'Select'
}, },
@ -42,6 +74,21 @@ export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: {
width: 150
},
},
{
label: '创建人',
field: 'creator',
sort: 'custom',
isTable: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
table: {
width: 150
},
}, },
{ {
label: '操作', label: '操作',

41
src/views/eam/item/itemOutLocation/itemOutLocation.data.ts

@ -1,4 +1,5 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const ItemOutLocationRules = reactive({ export const ItemOutLocationRules = reactive({
@ -13,18 +14,36 @@ export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180,
},
},
{
label: '备件名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 180,
},
}, },
{ {
label: '备件编号', label: '出库编号',
field: 'itemNumber', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180,
},
}, },
{ {
label: '库位编号', label: '库位编号',
field: 'locationNumber', field: 'locationNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 180,
},
}, },
{ {
label: '类型', label: '类型',
@ -36,12 +55,30 @@ export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'Select' component: 'Select'
}, },
table: {
width: 180,
},
}, },
{ {
label: '数量', label: '数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: {
width: 180,
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isTable: true,
table: {
width: 180,
},
isForm: false
}, },
{ {
label: '操作', label: '操作',

107
src/views/eam/mold/moldmaintainjob/index.vue

@ -125,6 +125,33 @@
</Dialog> </Dialog>
<Dialog
title="照片上传"
v-model="dialogUploadVisible"
:width="600"
:maxHeight="900"
:style="{height:'600px'}"
:key="dialogFormKey"
>
<el-form ref="fileDialogUploadRef" :model="fileDialogUploadData" >
<el-form-item label="">
<UploadImgs v-model="fileDialogUploadData.filePathList" :limit="20" />
</el-form-item>
</el-form>
<el-button type="primary" @click="dialogUploadFile">提交</el-button>
</Dialog>
<Dialog
ref="basicFormViewRef"
v-model="showView"
:key="viewKey"
:closeOnClickModal="true"
:title="viewTitle"
>
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -142,6 +169,9 @@ import { useUserStore } from '@/store/modules/user'
import { selectAllFactoryArea } from '@/api/system/dept' import { selectAllFactoryArea } from '@/api/system/dept'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import * as uploadApi from '@/api/eam/upload'
import * as fileApi from '@/api/infra/file'
defineOptions({ name: 'MoldMaintainOrderMain' }) defineOptions({ name: 'MoldMaintainOrderMain' })
const message = useMessage() // const message = useMessage() //
@ -158,8 +188,18 @@ const tableData = ref([])
const updateFormValue = ref({ const updateFormValue = ref({
verifyContent:'' verifyContent:''
}) })
const dialogUploadVisible = ref(false)
const dialogVisible = ref(false) const dialogVisible = ref(false)
const dialogRowData = ref() const dialogRowData = ref()
const fileDialogUploadData = ref({
filePathList: []
})
const dialogUploadNumber = ref()
const dialogFormKey = ref(0)
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/940395429096013824?token=' + getAccessToken()) const src = ref(BASE_URL + '/jmreport/view/940395429096013824?token=' + getAccessToken())
// //
@ -281,7 +321,14 @@ const butttondata = (row) => {
defaultButtons.orderPrintBtn({ defaultButtons.orderPrintBtn({
hasPermi:'eam:mold-maintain-job-main:print', hasPermi:'eam:mold-maintain-job-main:print',
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED')) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED'))
}) // }), //
defaultButtons.uploadImgsBtn({
hasPermi: 'eam:evice-maintain-job-main:upload',
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}), //
defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0 && row.status != 'PECEIVED')
}) //
] ]
} }
const onChange = (field, cur, item) => { const onChange = (field, cur, item) => {
@ -315,6 +362,12 @@ const buttonTableClick = async (val, row) => {
finishOrder(row) finishOrder(row)
} else if (val == 'orderPrint') { } else if (val == 'orderPrint') {
orderPrint(row) orderPrint(row)
}else if (val == 'uploadImgs') {
openDialogUpload(row)
} else if (val == 'picture') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} }
} }
@ -642,6 +695,58 @@ const orderPrint = (row) => {
window.open(src.value + "&id=" + row.id) window.open(src.value + "&id=" + row.id)
} }
const openDialogUpload = (row) => {
dialogUploadNumber.value = row.number
uploadApi.getImage({
number: row.number,
funcCode: "maintenance"
})
.then((res) => {
fileApi.selectList().then(response=>{
fileDialogUploadData.value.filePathList = res.map(item=>{
response.forEach(element=>{
if(item.url == element.url){
item.name = element.name
}
})
return item
})
dialogUploadVisible.value = true
dialogFormKey.value += 1
})
})
}
function dialogUploadFile() {
let data = {
number: dialogUploadNumber.value,
fileInfoList: fileDialogUploadData.value.filePathList?fileDialogUploadData.value.filePathList:[],
funcCode: "maintenance",
}
uploadApi.uploadImage(data).then((res) => {
message.success(t('common.submitSuccess'))
})
}
const getImage = () => {
uploadApi.getImage({
number: dialogUploadNumber.value,
funcCode: "maintenance",
})
.then((res) => {
nextTick(() => {
fileDialogUploadData.value.filePathList = res
dialogFormKey.value += 1
})
})
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

11
src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

@ -228,6 +228,9 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname return userListAll.find((account) => account.id == cellValue)?.nickname
}, },
table: {
width: '150',
},
}, },
{ {
label: '审批人', label: '审批人',
@ -238,6 +241,9 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTable: false, isTable: false,
isTableForm: false, isTableForm: false,
table: {
width: '150',
},
}, },
{ {
label: '审批意见', label: '审批意见',
@ -246,6 +252,9 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isTableForm: false, isTableForm: false,
isForm: false, isForm: false,
table: {
width: '150',
},
}, },
// { // {
// label: '创建时间', // label: '创建时间',
@ -289,7 +298,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 200, width: 260,
fixed: 'right' fixed: 'right'
}, },
isDetail: false, isDetail: false,

Loading…
Cancel
Save