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) {
return __defaultBtnOption(option,{
label: '二维码',
name: 'selectQrCode',
name: 'qrCode',
hide: false,
type: 'primary',
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){

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

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

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

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

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

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

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

@ -33,7 +33,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: '150',
},
isSearch: true,
isSearch: false,
isForm: false,
},
{
@ -44,7 +44,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
width: '150',
},
isForm: false,
isSearch: true,
isSearch: false,
isTable: true,
},
@ -60,8 +60,8 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
return deviceList.find((account) => account.number == cellValue)?.name
},
search: {
show: true,
component: 'Select',
show: false,
component: 'Input',
api: () => deviceList,
componentProps: {
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)
}), //
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 = [
defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //

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

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

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

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

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

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

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

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

Loading…
Cancel
Save