diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue index ed11f7e..026fd77 100644 --- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue +++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue @@ -87,7 +87,7 @@ { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '附件说明', value: 'appendixDescn', align: 'center' }, { text: '外观', value: 'appearance', align: 'center' }, - { text: '检定要求', value: 'measureRequire', align: 'center' }, + { text: '检定要求', value: 'specialRequire', align: 'center' }, ]) // 签章查询数据 @@ -238,6 +238,10 @@ // ------------------------样品----------------------------- // 点击批量增加 const multiAdd = () => { + if (!dataForm.value.customerNo) { + ElMessage.warning('请先选择委托方') + return + } sampleVisible.value = true } // 修改委托方对话框显隐 @@ -318,6 +322,11 @@ getAutographList() } +// 表格双击行 +const rowDblclick = (row: ISampleList) => { + row.isEdit = true +} + onMounted(async () => { if (pageType.value === 'add') { dataForm.value.deliverTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') // 交接时间 @@ -592,7 +601,7 @@ - + @@ -642,6 +651,7 @@ style="width: 100%;" max-height="600" @selection-change="handleSelectionChange" + @row-dblclick="rowDblclick" > @@ -653,7 +663,17 @@ :width="item.width" show-overflow-tooltip align="center" - /> + > + + diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue index ed11f7e..026fd77 100644 --- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue +++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue @@ -87,7 +87,7 @@ { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '附件说明', value: 'appendixDescn', align: 'center' }, { text: '外观', value: 'appearance', align: 'center' }, - { text: '检定要求', value: 'measureRequire', align: 'center' }, + { text: '检定要求', value: 'specialRequire', align: 'center' }, ]) // 签章查询数据 @@ -238,6 +238,10 @@ // ------------------------样品----------------------------- // 点击批量增加 const multiAdd = () => { + if (!dataForm.value.customerNo) { + ElMessage.warning('请先选择委托方') + return + } sampleVisible.value = true } // 修改委托方对话框显隐 @@ -318,6 +322,11 @@ getAutographList() } +// 表格双击行 +const rowDblclick = (row: ISampleList) => { + row.isEdit = true +} + onMounted(async () => { if (pageType.value === 'add') { dataForm.value.deliverTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') // 交接时间 @@ -592,7 +601,7 @@ - + @@ -642,6 +651,7 @@ style="width: 100%;" max-height="600" @selection-change="handleSelectionChange" + @row-dblclick="rowDblclick" > @@ -653,7 +663,17 @@ :width="item.width" show-overflow-tooltip align="center" - /> + > + + diff --git a/src/views/business/schedule/interchangeReceipt/receiptList-interface.ts b/src/views/business/schedule/interchangeReceipt/receiptList-interface.ts index 3decec5..2d1c1ff 100644 --- a/src/views/business/schedule/interchangeReceipt/receiptList-interface.ts +++ b/src/views/business/schedule/interchangeReceipt/receiptList-interface.ts @@ -60,6 +60,7 @@ appendixDescn: string // 附件说明 appearance: string // 外观 measureRequire: string // 检定要求 + isEdit?: boolean // 是否可编辑 } // 字典 diff --git a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue index ed11f7e..026fd77 100644 --- a/src/views/business/schedule/interchangeReceipt/receiptEdit.vue +++ b/src/views/business/schedule/interchangeReceipt/receiptEdit.vue @@ -87,7 +87,7 @@ { text: '出厂编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '附件说明', value: 'appendixDescn', align: 'center' }, { text: '外观', value: 'appearance', align: 'center' }, - { text: '检定要求', value: 'measureRequire', align: 'center' }, + { text: '检定要求', value: 'specialRequire', align: 'center' }, ]) // 签章查询数据 @@ -238,6 +238,10 @@ // ------------------------样品----------------------------- // 点击批量增加 const multiAdd = () => { + if (!dataForm.value.customerNo) { + ElMessage.warning('请先选择委托方') + return + } sampleVisible.value = true } // 修改委托方对话框显隐 @@ -318,6 +322,11 @@ getAutographList() } +// 表格双击行 +const rowDblclick = (row: ISampleList) => { + row.isEdit = true +} + onMounted(async () => { if (pageType.value === 'add') { dataForm.value.deliverTime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss') // 交接时间 @@ -592,7 +601,7 @@ - + @@ -642,6 +651,7 @@ style="width: 100%;" max-height="600" @selection-change="handleSelectionChange" + @row-dblclick="rowDblclick" > @@ -653,7 +663,17 @@ :width="item.width" show-overflow-tooltip align="center" - /> + > + + diff --git a/src/views/business/schedule/interchangeReceipt/receiptList-interface.ts b/src/views/business/schedule/interchangeReceipt/receiptList-interface.ts index 3decec5..2d1c1ff 100644 --- a/src/views/business/schedule/interchangeReceipt/receiptList-interface.ts +++ b/src/views/business/schedule/interchangeReceipt/receiptList-interface.ts @@ -60,6 +60,7 @@ appendixDescn: string // 附件说明 appearance: string // 外观 measureRequire: string // 检定要求 + isEdit?: boolean // 是否可编辑 } // 字典 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 612b3b4..71c8ed8 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -4,8 +4,7 @@ import type { DateModelType } from 'element-plus' import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import { useRouter } from 'vue-router' -import type { IMenu } from '../receive' -import type { IlistQuery, IlistType } from '@/views/device/receive/receive' +import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' import ButtonBox from '@/components/buttonBox/buttonBox.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { exportFile } from '@/utils/exportUtils' @@ -24,24 +23,19 @@ import type { userType } from '@/views/system/user/user-interface' import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getUserList } from '@/api/system/user' +import { getDictByCode } from '@/api/system/dict' +import type { IMenu } from '@/components/buttonBox/buttonBox' +const { proxy } = getCurrentInstance() as any const loadingTable = ref(false) // 表格loading const active = ref('') // 选中的按钮 +const activeTitle = ref('') // active对应的审批状态名字 const approvalDialog = ref() // 审批对话框显隐 const useDeptList = ref([]) // 部门列表 const usePersonList = ref([]) // 申请人列表(用户) const usePersonOptions = ref([]) // 申请人列表(用户)--模糊搜索数据 const applyPersonLoading = ref(false) // 申请人模糊搜索框loading - -const menu = ref([ - { name: '全部', id: '0' }, - { name: '草稿箱', id: '1' }, - { name: '待审批', id: '2' }, - { name: '审批中', id: '3' }, - { name: '已通过', id: '4' }, - { name: '未通过', id: '5' }, - { name: '已取消', id: '6' }, -]) +const menu = ref([]) // 右上角审批状态按钮组合 // 查询条件 const listQuery: Ref = ref({ applyNo: '', // 申请编号 @@ -60,40 +54,17 @@ offset: 1, limit: 20, }) -// 审批状态字典 -const approvalStatusMap: { [key: string]: string } = { - 1: '草稿箱', - 2: '待审批', - 3: '审批中', - 4: '已通过', - 5: '未通过', - 6: '已取消', - 7: '非草稿', - 8: '未通过-驳回', -} -// 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - '草稿箱': '1', - '待审批': '2', - '审批中': '3', - '已通过': '4', - '未通过': '5', - '已取消': '6', - '非草稿': '7', - '未通过-驳回': '8', -} -// 表格数据 -const list = ref([]) -const { proxy } = getCurrentInstance() as any -// 总数 -const total = ref(20) +const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1} +const list = ref([])// 表格数据 +const total = ref(20)// 页码总数 // 表头 const columns = ref([ - { text: '申请编号', value: 'applyNo', align: 'center' }, + { text: '申请编号', value: 'applyNo', align: 'center', width: '180' }, { text: '申请名称', value: 'applyName', align: 'center' }, { text: '申请部门', value: 'applyUnitName', align: 'center' }, { text: '申请人', value: 'applyPersonName', align: 'center' }, - { text: '领用时间', value: 'time', align: 'center' }, + { text: '领用时间', value: 'time', align: 'center', width: '160' }, { text: '申请说明', value: 'applyDesc', align: 'center' }, { text: '审批状态', value: 'approvalStatus', align: 'center' }, ]) @@ -102,6 +73,33 @@ // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) +// 获取字典值 +async function getDict() { + // 审批状态 + const res = await getDictByCode('approvalStatus') + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + + // 制作右上角的菜单 + res.data.forEach((item: dictType) => { + if (item.name === '全部' || item.name === '草稿箱' + || item.name === '待审批' || item.name === '审批中' + || item.name === '已通过' || item.name === '未通过' + || item.name === '已取消') { + menu.value.push({ + name: item.name, + id: `${item.value}`, + }) + } + }) +} // 数据查询 function fetchData(isNowPage = false) { loadingTable.value = true @@ -116,7 +114,7 @@ list.value = response.data.rows.map((item: IlistType) => { return { ...item, - approvalStatus: approvalStatusMap[item.approvalStatus], + approvalStatus: approvalStatusMap.value[item.approvalStatus], } }) total.value = parseInt(response.data.total) @@ -317,9 +315,11 @@ }) } } + // 按钮切换 const changeCurrentButton = (val: string) => { active.value = val + activeTitle.value = menu.value.find(item => item.id === val)!.name window.sessionStorage.setItem('buttonBoxActive', val) clearList() } @@ -362,20 +362,24 @@ }) } -onMounted(() => { - if (window.sessionStorage.getItem('buttonBoxActive')) { +onMounted(async () => { + await getDict() // 获取字典-审批状态 + if (window.sessionStorage.getItem('buttonBoxActive') !== 'undefined' && window.sessionStorage.getItem('buttonBoxActive') !== '') { active.value = window.sessionStorage.getItem('buttonBoxActive')! } else { - active.value = '0' // 全部 + active.value = menu.value.find(item => item.name === '全部')!.id // 全部 + activeTitle.value === '全部' } nextTick(() => { fetchData(true) // 获取表格数据 - // 获取使用部门 fetchDeptTreeList() // 获取使用部门 fetchUserList() // 获取人员列表 }) }) +onUnmounted(() => { + window.sessionStorage.setItem('buttonBoxActive', '') // 清除 +})