Browse Source

添加二维码批量生成

master
ljlong_2630 9 months ago
parent
commit
fe29b3913b
  1. 14
      src/utils/disposition/defaultButtons.ts
  2. 55
      src/views/eam/basic/fixedAssets/fixedAssets.data.ts
  3. 8
      src/views/eam/basic/fixedAssets/index.vue
  4. 26
      src/views/eam/device/deviceAccounts/index.vue
  5. 2
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  6. 8
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  7. 3
      src/views/eam/device/devicemaintenancejob/index.vue
  8. 4
      src/views/eam/mold/moldAccounts/index.vue
  9. 2
      src/views/eam/mold/moldAccounts/moldAccounts.data.ts
  10. 4
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  11. 4
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts
  12. 27
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

14
src/utils/disposition/defaultButtons.ts

@ -807,7 +807,7 @@ export function selectDeviceBtn(option:any) {
export function selectQrCodeBtn(option:any) { export function selectQrCodeBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{
label: '二维码', label: '二维码',
name: 'selectQrCode', name: 'qrCode',
hide: false, hide: false,
type: 'primary', type: 'primary',
color: '', color: '',
@ -1026,6 +1026,18 @@ export function pictureBtn(option:any) {
}) })
} }
// 主列表-二维码
export function selectQrCodeBatchBtn(option:any) {
return __defaultBtnOption(option,{
label: '批量生成标签',
name: 'qrCodeBatch',
hide: false,
type: 'primary',
color: '',
link: false, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则 // 默认按钮规则
function __defaultBtnOption(option:any,specific:any){ function __defaultBtnOption(option:any,specific:any){

55
src/views/eam/basic/fixedAssets/fixedAssets.data.ts

@ -15,6 +15,9 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
label: '编号唯一标识', label: '编号唯一标识',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
isSearch: true, isSearch: true,
isForm: false, isForm: false,
}, },
@ -22,28 +25,43 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
label: '资产名称', label: '资产名称',
field: 'name', field: 'name',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
isSearch: true, isSearch: true,
}, },
{ {
label: '会计单位', label: '会计单位',
field: 'accountingUnit', field: 'accountingUnit',
sort: 'custom' sort: 'custom',
table: {
width: '150',
},
}, },
{ {
label: '规格型号', label: '规格型号',
field: 'specifications', field: 'specifications',
sort: 'custom' sort: 'custom',
table: {
width: '150',
},
}, },
{ {
label: '库位编号', label: '库位编号',
field: 'locationNumber', field: 'locationNumber',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
isSearch: true isSearch: true
}, },
{ {
label: '购买时间', label: '购买时间',
field: 'purchaseDate', field: 'purchaseDate',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -56,17 +74,26 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '采购部门', label: '采购部门',
field: 'purchaseDept', field: 'purchaseDept',
sort: 'custom' sort: 'custom',
table: {
width: '150',
},
}, },
{ {
label: '供应商编号', label: '供应商编号',
field: 'supplierNumber', field: 'supplierNumber',
sort: 'custom' sort: 'custom',
table: {
width: '150',
},
}, },
{ {
label: '出厂日期', label: '出厂日期',
field: 'productionDate', field: 'productionDate',
sort: 'custom', sort: 'custom',
table: {
width: '150',
},
formatter: dateFormatter, formatter: dateFormatter,
form: { form: {
component: 'DatePicker', component: 'DatePicker',
@ -79,22 +106,34 @@ export const FixedAssets = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '购买价格', label: '购买价格',
field: 'purchasePrice', field: 'purchasePrice',
sort: 'custom' sort: 'custom',
table: {
width: '150',
},
}, },
{ {
label: '管理部门', label: '管理部门',
field: 'manageDept', field: 'manageDept',
sort: 'custom' sort: 'custom',
table: {
width: '150',
},
}, },
{ {
label: '单位', label: '单位',
field: 'unit', field: 'unit',
sort: 'custom' sort: 'custom',
table: {
width: '150',
},
}, },
{ {
label: '数量', label: '数量',
field: 'qty', field: 'qty',
sort: 'custom' sort: 'custom',
table: {
width: '150',
},
}, },
{ {
label: '操作', label: '操作',

8
src/views/eam/basic/fixedAssets/index.vue

@ -100,8 +100,8 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), // // defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), // // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:fixedAssets:update'}), // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:fixedAssets:delete'}), // defaultButtons.mainListDeleteBtn(null), //
] ]
// - // -

26
src/views/eam/device/deviceAccounts/index.vue

@ -107,6 +107,7 @@ import * as DeviceMaintainOrderMainApi from '@/api/eam/device/deviceMaintainOrde
import * as DeviceMaintainOrderDetailApi from '@/api/eam/device/deviceMaintainOrderDetail' import * as DeviceMaintainOrderDetailApi from '@/api/eam/device/deviceMaintainOrderDetail'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
import * as deviceMaintenanceDetailApi from '@/api/eam/device/deviceMaintenanceDetail' import * as deviceMaintenanceDetailApi from '@/api/eam/device/deviceMaintenanceDetail'
import { getAccessToken } from '@/utils/auth'
import { import {
DeviceMaintainOrderMain, DeviceMaintainOrderMain,
@ -162,8 +163,9 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), // defaultButtons.selectQrCodeBatchBtn(null), //
defaultButtons.defaultExportBtn(null), // // defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) // defaultButtons.defaultSetBtn(null) //
@ -185,6 +187,9 @@ const buttonBaseClick = (val, item) => {
} else if (val == 'import') { } else if (val == 'import') {
// //
handleImport() handleImport()
} else if (val == 'qrCodeBatch') {
//
qrCodeBatch(val, item)
} else if (val == 'export') { } else if (val == 'export') {
// //
handleExport() handleExport()
@ -207,6 +212,10 @@ const butttondata = [
defaultButtons.selectItemBtn(null) // defaultButtons.selectItemBtn(null) //
] ]
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/924818618605031424?token=' + getAccessToken())
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { if (val == 'edit') {
@ -217,9 +226,17 @@ const buttonTableClick = async (val, row) => {
openQrCode(row.number) openQrCode(row.number)
} else if (val == 'selectItem') { } else if (val == 'selectItem') {
openItem(row.number) openItem(row.number)
} else if (val == 'qrCode') {
window.open(src.value + "&number='" + row.number + "'")
} else {
//
console.log('其他按钮', val, row)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = (type: string, row?: any) => {
@ -475,4 +492,9 @@ const getDeviceItemBindData = async (params) => {
return response?.data; return response?.data;
} }
const qrCodeBatch = async (val,item) => {
const qrCodeList = tableObject.tableList.map(item => `'${item?.number}'`).join(', ')
window.open(src.value + "&number=" + qrCodeList)
}
</script> </script>

2
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -41,7 +41,7 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isSearch: true, isSearch: false,
isForm: false isForm: false
}, },
{ {

8
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -33,7 +33,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isSearch: true, isSearch: false,
isForm: false, isForm: false,
}, },
{ {
@ -44,7 +44,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150', width: '150',
}, },
isForm: false, isForm: false,
isSearch: true, isSearch: false,
isTable: true, isTable: true,
}, },
@ -60,8 +60,8 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
return deviceList.find((account) => account.number == cellValue)?.name return deviceList.find((account) => account.number == cellValue)?.name
}, },
search: { search: {
show: true, show: false,
component: 'Select', component: 'Input',
api: () => deviceList, api: () => deviceList,
componentProps: { componentProps: {
optionsAlias: { optionsAlias: {

3
src/views/eam/device/devicemaintenancejob/index.vue

@ -257,7 +257,8 @@ const butttondata = (row) => {
hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id)
}), // }), //
defaultButtons.pictureBtn({ defaultButtons.pictureBtn({
hide: !(row.filePathList != null && row.filePathList.length > 0) hide: !(row.filePathList != null && row.filePathList.length > 0 &&
userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker'))
}) // }) //
] ]
} }

4
src/views/eam/mold/moldAccounts/index.vue

@ -174,8 +174,8 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), // // defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), // // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) // defaultButtons.defaultSetBtn(null) //

2
src/views/eam/mold/moldAccounts/moldAccounts.data.ts

@ -37,7 +37,7 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([
label: '模具类型', label: '模具类型',
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
form: { form: {
component: 'Select' component: 'Select'
} }

4
src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

@ -34,7 +34,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isSearch: true, isSearch: false,
isForm: false, isForm: false,
}, },
{ {
@ -49,7 +49,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
// return repairList.find((account) => account.number == cellValue)?.name // return repairList.find((account) => account.number == cellValue)?.name
// }, // },
search: { search: {
show: true, show: false,
component: 'Select', component: 'Select',
api: () => repairList, api: () => repairList,
componentProps: { componentProps: {

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

@ -25,7 +25,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '保养单号', label: '保养单号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
table: { table: {
width: '150', width: '150',
}, },
@ -34,7 +34,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '保养计划单号', label: '保养计划单号',
field: 'planNumber', field: 'planNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: false,
table: { table: {
width: '150', width: '150',
}, },

27
src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

@ -30,7 +30,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isSearch: true, isSearch: false,
isForm: false, isForm: false,
}, },
{ {
@ -41,7 +41,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150', width: '150',
}, },
isForm: false, isForm: false,
isSearch: true, isSearch: false,
isTable: true, isTable: true,
}, },
@ -58,14 +58,14 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
search: { search: {
show: true, show: true,
component: 'Select', component: 'Input',
api: () => moldList, // api: () => moldList,
componentProps: { // componentProps: {
optionsAlias: { // optionsAlias: {
labelField: 'name', // labelField: 'name',
valueField: 'number' // valueField: 'number'
} // }
} // }
}, },
form: { form: {
component: 'Select', component: 'Select',
@ -117,6 +117,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isSearch: true,
form: { form: {
component: 'Select', component: 'Select',
api: () => userList, api: () => userList,
@ -137,7 +138,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isSearch: false, isSearch: true,
isForm: true, isForm: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string', dictClass: 'string',
@ -158,7 +159,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isSearch: true, isSearch: false,
dictType: DICT_TYPE.MAINTENANCE_SHIFT, dictType: DICT_TYPE.MAINTENANCE_SHIFT,
dictClass: 'number', dictClass: 'number',
form: { form: {
@ -172,7 +173,7 @@ export const MoldMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isSearch: true, isSearch: false,
dictType: DICT_TYPE.FAULT_TYPE, dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string', dictClass: 'string',
form: { form: {

Loading…
Cancel
Save