chenfang 11 months ago
parent
commit
6ee3908dac
  1. 5
      src/api/wms/itembasic/index.ts
  2. 5
      src/api/wms/owner/index.ts
  3. 9
      src/components/BasicForm/src/BasicForm.vue
  4. 11
      src/components/TableForm/src/TableForm.vue
  5. 351
      src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts
  6. 370
      src/views/wms/countManage/count/countPlanMain/index.vue
  7. 848
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

5
src/api/wms/itembasic/index.ts

@ -38,7 +38,10 @@ export const getItembasicPage = async (params) => {
return await request.get({ url: `/wms/itembasic/page`, params })
}
}
// 查询物品基本信息列表
export const getItembasicList = async (params) => {
return await request.get({ url: `/wms/itembasic/list`, params })
}
// 查询物品基本信息详情
export const getItembasic = async (id: number) => {
return await request.get({ url: `/wms/itembasic/get?id=` + id })

5
src/api/wms/owner/index.ts

@ -31,7 +31,10 @@ export const getOwnerPage = async (params) => {
return await request.get({ url: `/wms/owner/page`, params })
}
}
// 查询所有货主列表
export const getOwnerList = async (params) => {
return await request.get({ url: `/wms/owner/list`, params })
}
// 查询货主详情
export const getOwner = async (id: number) => {
return await request.get({ url: `/wms/owner/get?id=` + id })

9
src/components/BasicForm/src/BasicForm.vue

@ -35,6 +35,7 @@
@tableSelectionChange="tableSelectionChange"
@extendedButtonsClick="extendedButtonsClick"
@formSelectChange="formSelectChange"
@formSelectvVisibleChange = 'formSelectvVisibleChange'
@tableSortChange="tableSortChange"
@selectCallback="selectCallback"
@handleTableSelect="handleTableSelect"
@ -337,6 +338,7 @@ const emit = defineEmits([
'tableSelectionChange',
'extendedButtonsClick',
'formSelectChange',
'formSelectvVisibleChange',
'tableSortChange',
'selectCallback',
'handleTableSelect',
@ -349,8 +351,11 @@ const emit = defineEmits([
'selectChange'
])
//
const formSelectChange = (field, val) => {
emit('formSelectChange', field, val)
const formSelectChange = (field, val,row) => {
emit('formSelectChange', field, val,row)
}
const formSelectvVisibleChange = (field, val,row) => {
emit('formSelectvVisibleChange', field, val,row)
}
// selection
const tableSelectionChange = (val) => {

11
src/components/TableForm/src/TableForm.vue

@ -112,7 +112,8 @@
:allow-create="headerItem?.tableForm.allowCreate"
style="width: 100%"
:placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label"
@change="formSelectChange(headerItem.field, $event)">
@change="formSelectChange(headerItem.field, $event,row)"
@visible-change="formSelectvVisibleChange(headerItem.field, $event,row)">
<el-option
v-for="op in initSelectOptions(headerItem)"
:label="op.label"
@ -325,6 +326,7 @@ const emit = defineEmits([
'tableSelectionChange',
'extendedButtonsClick',
'formSelectChange',
'formSelectvVisibleChange',
'tableSortChange',
'selectCallback',
'handleTableSelect',
@ -337,8 +339,11 @@ const initSelectOptions = (item) => {
return item.dictType ? getStrDictOptions(item.dictType) : item.tableForm.initOptions
}
//
const formSelectChange = (field, val) => {
emit('formSelectChange', field, val)
const formSelectChange = (field, val,row) => {
emit('formSelectChange', field, val,row)
}
const formSelectvVisibleChange = (field, val,row) => {
emit('formSelectvVisibleChange', field, val,row)
}
// selection
const tableSelectionChange = (val) => {

351
src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts

@ -434,179 +434,222 @@ export const CountPlanMainRules = reactive({
/**
* @returns {Array}
*/
// export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
// {
// label: '盘点范围类型',
// field: 'type',
// dictType: DICT_TYPE.COUNT_TYPE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select'
// }
// },
// {
// label: '盘点范围值',
// field: 'value',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '单据号',
// field: 'number',
// sort: 'custom',
// table: {
// width: 150,
// },
// isTableForm: false,
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '物品代码',
// field: 'itemCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '备注',
// field: 'remark',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '创建者',
// field: 'creator',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '创建时间',
// field: 'createTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '最后更新时间',
// field: 'updateTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '最后更新者',
// field: 'updater',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '计划数量',
// field: 'planQty',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// precision: 6
// }
// },
// tableForm: {
// type: 'InputNumber',
// min: 1,
// precision: 6
// }
// },
// {
// label: '计量单位',
// field: 'uom',
// dictType: DICT_TYPE.UOM,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select'
// }
// },
// {
// label: '是否可用',
// field: 'available',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isTable: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// },
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select'
// }
// },
// {
// label: '操作',
// field: 'action',
// isDetail: false,
// isForm: false ,
// table: {
// width: 150,
// fixed: 'right'
// },
// isTableForm:false,
// }
// ]))
//表单校验
export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
{
label: '盘点范围类型',
field: 'type',
dictType: DICT_TYPE.COUNT_TYPE,
dictType: DICT_TYPE.COUNT_SCOPE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
width: 300
},
tableForm: {
type: 'Select'
type: 'Select',
width: '300'
}
},
{
label: '盘点范围值',
field: 'value',
sort: 'custom',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false,
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
width: 300
},
tableForm: {
type: 'Select'
type: 'InputString',
width: '300',
}
},
{
@ -621,8 +664,6 @@ export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
isTableForm:false,
}
]))
//表单校验
export const CountPlanDetailRules = reactive({
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }

370
src/views/wms/countManage/count/countPlanMain/index.vue

@ -37,7 +37,10 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -53,13 +56,13 @@
:tableData="tableData"
:apiUpdate="CountPlanMainApi.updateCountPlanMain"
:apiCreate="CountPlanMainApi.createCountPlanMain"
:isBusiness="false"
fromeWhere="countPlan"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@formSelectChange="formSelectChange"
@formSelectvVisibleChange="formSelectvVisibleChange"
@selectChange="selectChange"
/>
@ -89,12 +92,26 @@
<script setup lang="ts">
import download from '@/utils/download'
import { CountPlanMain,CountPlanMainRules,CountPlanDetail,CountPlanDetailRules } from './countPlanMain.data'
import {
CountPlanMain,
CountPlanMainRules,
CountPlanDetail,
CountPlanDetailRules
} from './countPlanMain.data'
import * as CountPlanMainApi from '@/api/wms/countPlanMain'
import * as CountPlanDetailApi from '@/api/wms/countPlanDetail'
import * as OwnerApi from '@/api/wms/owner'
import * as SupplierApi from '@/api/wms/supplier'
import * as CustomerApi from '@/api/wms/customer'
import * as WarehouseApi from '@/api/wms/warehouse'
import * as AreaApi from '@/api/wms/areabasic'
import * as LocationgroupApi from '@/api/wms/locationgroup'
import * as LocationpApi from '@/api/wms/location'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
//
defineOptions({ name: 'CountPlanMain' })
@ -114,18 +131,17 @@ const updataTableColumns = (val) => {
//
const searchTableParams = ref([
{
formField: 'productItemCode',
searchTableTitle: '物料信息',
searchTableAllSchemas: Itembasic.allSchemas,
searchTablePage: ItembasicApi.getItembasicPage
}
{
formField: 'productItemCode',
searchTableTitle: '物料信息',
searchTableAllSchemas: Itembasic.allSchemas,
searchTablePage: ItembasicApi.getItembasicPage
}
])
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
//
//row[formField] = val[0][searchField]
@ -142,14 +158,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} else {
const setV = {}
// setV[formField] = val[0][searchField]
setV[formField] = val.map(item=>item.code).join(',')
setV[formField] = val.map((item) => item.code).join(',')
formRef.setValues(setV)
}
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: CountPlanMainApi.getCountPlanMainPage //
@ -160,12 +176,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:count-plan-main:create'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'wms:count-plan-main:create' }), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:count-plan-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:count-plan-main:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-plan-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -178,22 +194,28 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -203,89 +225,82 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:count-plan-main:open'}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:count-plan-main:close'}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-plan-main:submit'}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-plan-main:reject'}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-plan-main:agree'}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:count-plan-main:publish'}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:count-plan-main:resetting'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-plan-main:update'}), //
]
return [
defaultButtons.mainListPlanOpeBtn({
hide: isShowMainButton(row, ['5']),
hasPermi: 'wms:count-plan-main:open'
}), //
defaultButtons.mainListPlanCloBtn({
hide: isShowMainButton(row, ['1', '2', '3', '4']),
hasPermi: 'wms:count-plan-main:close'
}), //
defaultButtons.mainListPlanSubBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:count-plan-main:submit'
}), //
defaultButtons.mainListPlanTurBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'wms:count-plan-main:reject'
}), //
defaultButtons.mainListPlanAppBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'wms:count-plan-main:agree'
}), //
defaultButtons.mainListPlanPubBtn({
hide: isShowMainButton(row, ['3']),
hasPermi: 'wms:count-plan-main:publish'
}), //
defaultButtons.mainListPlanResBtn({
hide: isShowMainButton(row, ['4']),
hasPermi: 'wms:count-plan-main:resetting'
}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:count-plan-main:update'
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { //
CountPlanMainApi.open(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanClo') { //
await message.confirm('确认要关闭吗?')
CountPlanMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanSub') { //
await message.confirm('确认要提交审批吗?')
CountPlanMainApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanTur') { //
await message.confirm('确认要驳回吗?')
CountPlanMainApi.reject(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanApp') { //
await message.confirm('确认要审批通过吗?')
CountPlanMainApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?')
CountPlanMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
CountPlanMainApi.resetting(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'edit') { //
if (val == 'mainClose') {
//
console.log('列表-操作按钮事件-关闭')
} else if (val == 'mainReAdd') {
//
console.log('列表-操作按钮事件-重新添加')
} else if (val == 'mainSubmit') {
//
console.log('列表-操作按钮事件-提交审批')
} else if (val == 'mainTurnDown') {
//
console.log('列表-操作按钮事件-驳回')
} else if (val == 'mainApprove') {
//
console.log('列表-操作按钮事件-审批通过')
} else if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
getOwnerAllList()
getSupplierAllList()
getCustomerAllList()
getItembasicAllList()
getWarehouseAllList()
getAreaAllList()
getLocationgroupAllList()
getLocationAllList()
}
/** 详情操作 */
@ -324,16 +339,18 @@ const handleExport = async () => {
}
/**
* tableForm方法
*/
* tableForm方法
*/
const tableFormKeys = {}
CountPlanDetail.allSchemas.tableFormColumns.forEach(item => {
CountPlanDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
console.log(tableFormKeys)
tableFormKeys.formType = 'Select'
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
@ -386,25 +403,176 @@ const searchFormClick = (searchData) => {
getList() //
}
//
const selectChange = (field,val)=>{
const selectChange = (field, val) => {
console.log(val)
if(field == 'type'){
if(val =='DYNAMIC'){
if (field == 'type') {
if (val == 'DYNAMIC') {
CountPlanMain.allSchemas.formSchema[3].label = '限值(%)'
CountPlanMain.allSchemas.formSchema[3].componentProps.min = 0
CountPlanMain.allSchemas.formSchema[3].componentProps.max = 100
CountPlanMain.allSchemas.formSchema[3].componentProps.disabled = false
}else if(val =='LOW' || val =='RANDOM'){
} else if (val == 'LOW' || val == 'RANDOM') {
CountPlanMain.allSchemas.formSchema[3].label = '限值'
CountPlanMain.allSchemas.formSchema[3].componentProps.min = 0
CountPlanMain.allSchemas.formSchema[3].componentProps.max = Infinity
CountPlanMain.allSchemas.formSchema[3].componentProps.disabled = false
}else{
} else {
CountPlanMain.allSchemas.formSchema[3].componentProps.disabled = true
}
}
}
let valueList = []
//
const formSelectChange = async (field, val, row) => {
console.log(row[field])
console.log(field)
console.log(val)
if (field == 'type') {
row.value = ''
if (row.type == 'OWNER' || row.type == 'SUPPLIER'|| row.type == 'CUSTOMER'|| row.type == 'ABC'|| row.type == 'ITEMS_TYPE'|| row.type == 'ITEMS_GROUP'||row.type == 'ITEMS_CODE'||row.type == 'WAREHOUSE_CODE'||row.type == 'AREABASIC_CODE'||row.type == 'LOCATIONGROUP_CODE'||row.type == 'LOCATION_CODE') {
row.formType = 'InputString'
// row.initOptions = valueList
}else if(row.type == 'PROJECT'){
// row = {
// type: 'InputString',
// width: '300',
// initOptions: valueList
// }
}
}
}
const formSelectvVisibleChange = async (field, val, row) => {
console.log(getStrDictOptions(DICT_TYPE.ABC_CLASS))
switch (row.type) {
case 'OWNER':
valueList = ownerAllList.value
break;
case 'SUPPLIER':
valueList = supplierAllList.value
break;
case 'CUSTOMER':
valueList = customerAllList.value
break;
case 'ABC':
valueList = getStrDictOptions(DICT_TYPE.ABC_CLASS)
break;
case 'ITEMS_TYPE':
valueList = getStrDictOptions(DICT_TYPE.ITEM_TYPE)
break;
case 'ITEMS_GROUP':
valueList = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break;
case 'ITEMS_CODE':
valueList = itembasicAllList.value
break;
case 'WAREHOUSE_CODE':
valueList = warehouseAllList.value
break
case 'AREABASIC_CODE':
valueList = areaAllList.value
break
case 'LOCATIONGROUP_CODE':
valueList = locationgroupAllList.value
break
case 'LOCATION_CODE':
valueList = locationAllList.value
break
}
CountPlanDetail.allSchemas.tableFormColumns[1].tableForm = {
type: 'Select',
width: '300',
initOptions: valueList
}
}
const ownerAllList = ref()
const supplierAllList = ref()
const customerAllList = ref()
const itembasicAllList = ref()
const warehouseAllList = ref()
const areaAllList = ref()
const locationgroupAllList = ref()
const locationAllList = ref()
//
const getOwnerAllList = async () => {
await OwnerApi.getOwnerList().then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
ownerAllList.value = res
})
}
//
const getSupplierAllList = async () => {
await SupplierApi.getSupplierList().then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
supplierAllList.value = res
})
}
//
const getCustomerAllList = async () => {
await CustomerApi.getCustomerList().then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
customerAllList.value = res
})
}
//
const getItembasicAllList = async () => {
await ItembasicApi.getItembasicList().then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
itembasicAllList.value = res
})
}
//
const getWarehouseAllList = async () => {
await WarehouseApi.getWarehouseList({available:'TRUE'}).then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
warehouseAllList.value = res
})
}
//
const getAreaAllList = async () => {
await AreaApi.getAreaList({available:'TRUE'}).then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
areaAllList.value = res
})
}
//
const getLocationgroupAllList = async () => {
await LocationgroupApi.getLocationgroupList({available:'TRUE'}).then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
locationgroupAllList.value = res
})
}
//
const getLocationAllList = async () => {
await LocationpApi.getLocationList({available:'TRUE'}).then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
locationAllList.value = res
})
}
/** 初始化 **/
onMounted(async () => {
getList()

848
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -1,32 +1,21 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="SupplierdeliverRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="SupplierdeliverRequestMain.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverRequestMain.allSchemas"
/>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="SupplierdeliverRequestMain.allSchemas" />
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort">
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
@ -39,55 +28,36 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas"
:tableAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:tableFormRules="SupplierdeliverRequestDetailRules"
:tableData="tableData"
<BasicForm ref="formRef" @success="getList" :rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" :tableAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:tableFormRules="SupplierdeliverRequestDetailRules" :tableData="tableData"
:apiUpdate="SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain"
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
:apiCreate="SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain" :isBusiness="true"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" />
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SupplierdeliverRequestMain.allSchemas"
<Detail ref="detailRef" :isBasic="false" :allSchemas="SupplierdeliverRequestMain.allSchemas"
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas"
:detailAllSchemasRules="SupplierdeliverRequestDetailRules"
:apiCreate="SupplierdeliverRequestDetailApi.createSupplierdeliverRequestDetail"
:apiUpdate="SupplierdeliverRequestDetailApi.updateSupplierdeliverRequestDetail"
:apiPage="SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage"
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
:apiDelete="SupplierdeliverRequestDetailApi.deleteSupplierdeliverRequestDetail" :Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<ImportForm ref="importFormRef" url="/wms/supplierdeliver-request-main/import"
:importTemplateData="importTemplateData" @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true"
:mode="2" />
<!-- 打印 -->
<el-dialog v-model="dialogVisible " :title="dialogTitle" width="60%" >
<Table
:columns="detailListTableColumns"
:data="detatableData.tableList"
:loading="detatableData.loading"
<el-dialog v-model="dialogVisible " :title="dialogTitle" width="60%">
<Table :columns="detailListTableColumns" :data="detatableData.tableList" :loading="detatableData.loading"
:pagination="{
total: detatableData.total
}"
v-model:pageSize="detatableData.pageSize"
v-model:currentPage="detatableData.currentPage"
v-model:sort="detatableData.sort"
>
}" v-model:pageSize="detatableData.pageSize" v-model:currentPage="detatableData.currentPage"
v-model:sort="detatableData.sort">
<template #batch="{row}">
<el-input v-model="row.batch">{{ row.batch }}</el-input>
</template>
@ -98,370 +68,438 @@
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import { SupplierdeliverRequestMain,SupplierdeliverRequestMainRules,SupplierdeliverRequestDetail,SupplierdeliverRequestDetailRules } from './supplierdeliverRequestMain.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import * as PackageApi from '@/api/wms/package'
// import * as BarbasicApi from '@/api/wms/barbasic'
//
defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
} else {
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import { SupplierdeliverRequestMain, SupplierdeliverRequestMainRules, SupplierdeliverRequestDetail, SupplierdeliverRequestDetailRules } from './supplierdeliverRequestMain.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import * as PackageApi from '@/api/wms/package'
// import * as BarbasicApi from '@/api/wms/barbasic'
//
defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SupplierdeliverRequestMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:supplierdeliver-request-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:supplierdeliver-request-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:supplierdeliver-request-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:supplierdeliver-request-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:supplierdeliver-request-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:supplierdeliver-request-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
}
// -
const butttondata = (row) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:supplierdeliver-request-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplierdeliver-request-main:delete'}), //
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListDocumentPrintBtn(null), //
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']) }), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['6']) }), //
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['6']) }), //
defaultButtons.mainListEditBtn({ hasPermi: 'wms:supplierdeliver-request-main:update' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:supplierdeliver-request-main:delete' }), //
// defaultButtons.mainListPointBtn(null), //
// defaultButtons.mainListDocumentPrintBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭')
} else if (val == 'mainReAdd') { //
console.log('列表-操作按钮事件-重新添加')
} else if (val == 'mainSubmit') { //
console.log('列表-操作按钮事件-提交审批')
} else if (val == 'mainTurnDown') { //
console.log('列表-操作按钮事件-驳回')
} else if (val == 'mainApprove') { //
console.log('列表-操作按钮事件-审批通过')
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row)
} else if (val == 'documentPrint') { //
handleDocumentPrint(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SupplierdeliverRequestMainApi.deleteSupplierdeliverRequestMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(setSearchParams)
download.excel(data, '供应商发货申请主.xls')
} catch {
} finally {
exportLoading.value = false
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') { //
handleOpe(row.id)
} else if (val == 'mainPurPlanClo') {//
handleClo(row.id)
} else if (val == 'mainPlanSub') { //
handleSub(row.id)
} else if (val == 'mainPlanApp') { //
handleApp(row.id)
} else if (val == 'mainPlanTur') { //
handleTur(row.id)
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row)
} else if (val == 'documentPrint') { //
handleDocumentPrint(row.id)
}
}
}
//
const {tableObject: detatableData,tableMethods: detatableMethods} =useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage
})
const { getList:getDetailList } = detatableMethods
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns)
const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作'&& item.label != '创建者'&&item.label != '创建时间'&&item.label != '最后更新者'&&item.label != '最后更新时间')
const dialogVisible = ref(false)
const isShow = ref(false)
const dialogTitle = ref('')
const closeDialog = () =>{
dialogVisible.value =false
isShow.value = false
}
const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
//
const handlePoint = async (row) => {
tableObject.params = {
masterId: row.id,
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
await getDetailList()
dialogVisible.value = true
dialogTitle.value = row.number + '单据号'
}
const print = async() => {
//
// const packageArray:any= ref([])
// let packageObject = {
// itemCode: '',
// itemName: '',
// itemDesc1: '',
// itemDesc2: '',
// batch: '',
// altBatch: '',
// produceDate: '',
// validityDays: '',
// expireDate: '',
// uom: '',
// qty: '',
// altUom: '',
// altQty: '',
// convertRate: '',
// stdPackQty: '',
// stdPackUnit: '',
// toWarehouseCode: '',
// toDockCode: '',
// toLocationCode: '',
// supplierCode: '',
// supplierItemCode: '',
// poNumber: '',
// poLine: '',
// rpNumber: '',
// asnNumber: '',
// }
// //
// await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({
// number: detatableData.tableList[0].number
// }).then(res => {
// detatableData.tableList.forEach(item => {
// packageObject.itemCode=item.itemCode
// packageObject.itemName=item.itemName
// packageObject.itemDesc1=item.itemDesc1
// packageObject.itemDesc2=item.itemDesc2
// packageObject.batch=item.batch
// packageObject.altBatch=item.altBatch
// packageObject.produceDate=item.produceDate
// packageObject.expireDate=item.expireDate
// packageObject.uom=item.uom
// packageObject.qty=item.qty
// packageObject.stdPackQty=item.stdPackQty
// packageObject.stdPackUnit=item.stdPackUnit
// packageObject.convertRate=item.convertRate
// packageObject.poNumber=item.poNumber
// packageObject.poLine=item.poLine
// packageObject.supplierCode=res.list[0].supplierCode
// packageObject.rpNumber=res.list[0].ppNumber
// packageArray.value.push(packageObject)
// })
// })
// const barBasicArray:any =ref([])
// let barBasicObject = {
// type: '',
// template: '',
// status: '',
// relateNumber: '',
// barcodeString: '',
// printTimes: '',
// lastPrintTime: '',
// lastPrintUserId: '',
// lastPrintUserName: '',
// }
// //
// await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => {
// res.list.forEach(item => {
// barBasicObject.type = 'PurchaseLabel'
// barBasicObject.relateNumber = item.number
// barBasicObject.status = 'NEW'
// barBasicArray.value.push(barBasicObject)
// })
// })
// await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value)))
window.open(src.value+'&number='+detatableData.tableList[0].number)
}
//
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value+'&id='+id)
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain(data)
message.success(t('common.updateSuccess'))
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue)
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await SupplierdeliverRequestMainApi.deleteSupplierdeliverRequestMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 关闭按钮操作 */
const handleClo = async (id : number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
//
await SupplierdeliverRequestMainApi.cloSupplierdeliverRequestMain(id)
message.success(t('关闭成功!'))
//
await getList()
} catch { }
}
/** 打开按钮操作 */
const handleOpe = async (id : number) => {
try {
//
await message.confirm('是否打开所选中数据?')
//
await SupplierdeliverRequestMainApi.opeSupplierdeliverRequestMain(id)
message.success(t('打开成功!'))
//
await getList()
} catch { }
}
/** 提交审批按钮操作 */
const handleSub = async (id : number) => {
try {
//
await message.confirm('是否提交审批所选中数据?')
//
await SupplierdeliverRequestMainApi.subSupplierdeliverRequestMain(id)
message.success(t('提交审批成功!'))
//
await getList()
} catch { }
}
/** 审批通过按钮操作 */
const handleApp = async (id : number) => {
try {
//
await message.confirm('是否审批通过所选中数据?')
//
await SupplierdeliverRequestMainApi.appSupplierdeliverRequestMain(id)
message.success(t('审批通过成功!'))
//
await getList()
} catch { }
}
/** 驳回按钮操作 */
const handleTur = async (id : number) => {
try {
//
await message.confirm('是否驳回所选中数据?')
//
await SupplierdeliverRequestMainApi.rejSupplierdeliverRequestMain(id)
message.success(t('驳回成功!'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SupplierdeliverRequestMainApi.exportSupplierdeliverRequestMain(setSearchParams)
download.excel(data, '供应商发货申请主.xls')
} catch {
} finally {
exportLoading.value = false
}
}
//
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage
})
const { getList: getDetailList } = detatableMethods
const detailTableColumns = ref(SupplierdeliverRequestDetail.allSchemas.tableColumns)
const detailListTableColumns = detailTableColumns.value.filter(item => item.label != '操作' && item.label != '创建者' && item.label != '创建时间' && item.label != '最后更新者' && item.label != '最后更新时间')
const dialogVisible = ref(false)
const isShow = ref(false)
const dialogTitle = ref('')
const closeDialog = () => {
dialogVisible.value = false
isShow.value = false
}
const BASE_URL = 'http://dev.ccwin-in.com:25110'
const src = ref(BASE_URL + '/jmreport/view/881303562245316608?token=' + getAccessToken())
//
const handlePoint = async (row) => {
tableObject.params = {
masterId: row.id,
}
formRef.value.dialogVisible = false
//
await getDetailList()
dialogVisible.value = true
dialogTitle.value = row.number + '单据号'
}
const print = async () => {
//
// const packageArray:any= ref([])
// let packageObject = {
// itemCode: '',
// itemName: '',
// itemDesc1: '',
// itemDesc2: '',
// batch: '',
// altBatch: '',
// produceDate: '',
// validityDays: '',
// expireDate: '',
// uom: '',
// qty: '',
// altUom: '',
// altQty: '',
// convertRate: '',
// stdPackQty: '',
// stdPackUnit: '',
// toWarehouseCode: '',
// toDockCode: '',
// toLocationCode: '',
// supplierCode: '',
// supplierItemCode: '',
// poNumber: '',
// poLine: '',
// rpNumber: '',
// asnNumber: '',
// }
// //
// await SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage({
// number: detatableData.tableList[0].number
// }).then(res => {
// detatableData.tableList.forEach(item => {
// packageObject.itemCode=item.itemCode
// packageObject.itemName=item.itemName
// packageObject.itemDesc1=item.itemDesc1
// packageObject.itemDesc2=item.itemDesc2
// packageObject.batch=item.batch
// packageObject.altBatch=item.altBatch
// packageObject.produceDate=item.produceDate
// packageObject.expireDate=item.expireDate
// packageObject.uom=item.uom
// packageObject.qty=item.qty
// packageObject.stdPackQty=item.stdPackQty
// packageObject.stdPackUnit=item.stdPackUnit
// packageObject.convertRate=item.convertRate
// packageObject.poNumber=item.poNumber
// packageObject.poLine=item.poLine
// packageObject.supplierCode=res.list[0].supplierCode
// packageObject.rpNumber=res.list[0].ppNumber
// packageArray.value.push(packageObject)
// })
// })
// const barBasicArray:any =ref([])
// let barBasicObject = {
// type: '',
// template: '',
// status: '',
// relateNumber: '',
// barcodeString: '',
// printTimes: '',
// lastPrintTime: '',
// lastPrintUserId: '',
// lastPrintUserName: '',
// }
// //
// await PackageApi.createPackage(JSON.parse(JSON.stringify(packageArray.value))).then(res => {
// res.list.forEach(item => {
// barBasicObject.type = 'PurchaseLabel'
// barBasicObject.relateNumber = item.number
// barBasicObject.status = 'NEW'
// barBasicArray.value.push(barBasicObject)
// })
// })
// await BarbasicApi.createBarbasic(JSON.parse(JSON.stringify(barBasicArray.value)))
window.open(src.value + '&number=' + detatableData.tableList[0].number)
}
//
const documentSrc = ref(BASE_URL + '/jmreport/view/884680688168280064?token=' + getAccessToken())
const handleDocumentPrint = async (id) => {
window.open(documentSrc.value + '&id=' + id)
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SupplierdeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data)
message.success(t('common.createSuccess'))
} else {
await SupplierdeliverRequestMainApi.updateSupplierdeliverRequestMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
//
const importSuccess = () => {
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '供应商发货申请主导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
})
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SupplierdeliverRequestMainApi.importTemplate()
})
</script>
Loading…
Cancel
Save