Browse Source

BUG修改

master
叶佳兴 1 year ago
parent
commit
219b5c1795
  1. 189
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/supplierdeliverRecordMain.data.ts
  2. 289
      src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/index.vue

189
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/supplierdeliverRecordMain.data.ts

@ -391,57 +391,136 @@ export const SupplierdeliverRecordMainRules = reactive({
* @returns {Array} * @returns {Array}
*/ */
export const SupplierdeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierdeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '从包装号',
// field: 'fromPackingNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '到包装号',
// field: 'toPackingNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '从批次',
// field: 'fromBatch',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '到批次',
// field: 'toBatch',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '替代批次',
// field: 'altBatch',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '从器具号',
// field: 'fromContainerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '到器具号',
// field: 'toContainerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
},
{ {
label: '从包装号', label: '订单行',
field: 'fromPackingNumber', field: 'poLine',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '到包装号', label: '物品代码',
field: 'toPackingNumber', field: 'itemCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '从批次', label: '数量',
field: 'fromBatch', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: {
component: 'InputNumber',
}
}, },
{ {
label: '到批次', label: '标包数量',
field: 'toBatch', field: 'stdPackQty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: {
component: 'InputNumber',
}
}, },
{ {
label: '替代批次', label: '标包单位',
field: 'altBatch', field: 'stdPackUnit',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
}, },
{ {
label: '从器具号', label: '供应商计量数量',
field: 'fromContainerNumber', field: 'supplierQty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
form: {
component: 'InputNumber',
}
}, },
{ {
label: '到器具号', label: '供应商计量单位',
field: 'toContainerNumber', field: 'supplierUom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -507,66 +586,7 @@ export const SupplierdeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
} }
}, },
}, },
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
},
{
label: '标包数量',
field: 'stdPackQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '标包单位',
field: 'stdPackUnit',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '供应商计量数量',
field: 'supplierQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '供应商计量单位',
field: 'supplierUom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{ {
label: '从库位代码', label: '从库位代码',
field: 'fromLocationCode', field: 'fromLocationCode',
@ -631,14 +651,7 @@ export const SupplierdeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150 width: 150
}, },
}, },
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{ {
label: '物品名称', label: '物品名称',
field: 'itemName', field: 'itemName',
@ -671,17 +684,7 @@ export const SupplierdeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150 width: 150
}, },
}, },
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{ {
label: '计量单位', label: '计量单位',
field: 'uom', field: 'uom',

289
src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/index.vue

@ -7,19 +7,13 @@
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
:HeadButttondata="HeadButttondata" @updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
@button-base-click="buttonBaseClick" :allSchemas="PurchaseclaimRequestMain.allSchemas" />
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchaseclaimRequestMain.allSchemas"
/>
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" <Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
:loading="tableObject.loading" :pagination="{
total: tableObject.total total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage" }" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"> v-model:sort="tableObject.sort">
@ -35,36 +29,22 @@
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm ref="formRef" @success="getList" :rules="PurchaseclaimRequestMainRules"
ref="formRef" :formAllSchemas="PurchaseclaimRequestMain.allSchemas" :tableAllSchemas="PurchaseclaimRequestDetail.allSchemas"
@success="getList" :tableFormRules="PurchaseclaimRequestDetailRules" :tableData="tableData"
:rules="PurchaseclaimRequestMainRules"
:formAllSchemas="PurchaseclaimRequestMain.allSchemas"
:tableAllSchemas="PurchaseclaimRequestDetail.allSchemas"
:tableFormRules="PurchaseclaimRequestDetailRules"
:tableData="tableData"
:apiUpdate="PurchaseclaimRequestMainApi.updatePurchaseclaimRequestMain" :apiUpdate="PurchaseclaimRequestMainApi.updatePurchaseclaimRequestMain"
:apiCreate="PurchaseclaimRequestMainApi.createPurchaseclaimRequestMain" :apiCreate="PurchaseclaimRequestMainApi.createPurchaseclaimRequestMain" :isBusiness="true"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@handleAddTable="handleAddTable" @submitForm="submitForm" />
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail ref="detailRef" :isBasic="false" :allSchemas="PurchaseclaimRequestMain.allSchemas"
ref="detailRef" :detailAllSchemas="PurchaseclaimRequestDetail.allSchemas" :detailAllSchemasRules="PurchaseclaimRequestDetailRules"
:isBasic="false"
:allSchemas="PurchaseclaimRequestMain.allSchemas"
:detailAllSchemas="PurchaseclaimRequestDetail.allSchemas"
:detailAllSchemasRules="PurchaseclaimRequestDetailRules"
:apiCreate="PurchaseclaimRequestDetailApi.createPurchaseclaimRequestDetail" :apiCreate="PurchaseclaimRequestDetailApi.createPurchaseclaimRequestDetail"
:apiUpdate="PurchaseclaimRequestDetailApi.updatePurchaseclaimRequestDetail" :apiUpdate="PurchaseclaimRequestDetailApi.updatePurchaseclaimRequestDetail"
:apiPage="PurchaseclaimRequestDetailApi.getPurchaseclaimRequestDetailPage" :apiPage="PurchaseclaimRequestDetailApi.getPurchaseclaimRequestDetailPage"
:apiDelete="PurchaseclaimRequestDetailApi.deletePurchaseclaimRequestDetail" :apiDelete="PurchaseclaimRequestDetailApi.deletePurchaseclaimRequestDetail"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail" />
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchaseclaim-request-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/wms/purchaseclaim-request-main/import" :importTemplateData="importTemplateData"
@ -72,35 +52,37 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import download from '@/utils/download' import download from '@/utils/download'
import * as PurchaseclaimRequestMainApi from '@/api/wms/purchaseclaimRequestMain' import * as PurchaseclaimRequestMainApi from '@/api/wms/purchaseclaimRequestMain'
import * as PurchaseclaimRequestDetailApi from '@/api/wms/purchaseclaimRequestDetail' import * as PurchaseclaimRequestDetailApi from '@/api/wms/purchaseclaimRequestDetail'
import { PurchaseclaimRequestMain, PurchaseclaimRequestMainRules, PurchaseclaimRequestDetail, PurchaseclaimRequestDetailRules } from './purchaseclaimRequestMain.data' import { PurchaseclaimRequestMain, PurchaseclaimRequestMainRules, PurchaseclaimRequestDetail, PurchaseclaimRequestDetailRules } from './purchaseclaimRequestMain.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' import BasicForm from '@/components/BasicForm/src/BasicForm.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
// //
defineOptions({ name: 'PurchaseclaimRequestMain' }) defineOptions({ name: 'PurchaseclaimRequestMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(PurchaseclaimRequestMain.allSchemas.tableColumns) const tableColumns = ref(PurchaseclaimRequestMain.allSchemas.tableColumns)
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
row['poLine'] = val[0]['poLine'] row['poLine'] = val[0]['poLine']
@ -117,15 +99,36 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// //
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField=='asnNumber'){
// getBomDisassemble
PurchasePlanDetailApi.getPurchasePlanDetailList({
number: val[0]['asnNumber']}).then(res => {
if (res) tableData.value = res;
tableData.value.forEach(item=>{
item.batch = item.toBatch
item.qty = 1
})
}).catch(err => {
console.log(err)
})
}
setV['ppNumber'] = val[0]['ppNumber'] setV['ppNumber'] = val[0]['ppNumber']
setV['supplierCode'] = val[0]['supplierCode'] setV['supplierCode'] = val[0]['supplierCode']
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })
} }
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
console.log(456)
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
setV['poLine'] = val[0]['poLine'] setV['poLine'] = val[0]['poLine']
@ -140,17 +143,17 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
const exportLoading = ref(false) // const exportLoading = ref(false) //
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: PurchaseclaimRequestMainApi.getPurchaseclaimRequestMainPage // getListApi: PurchaseclaimRequestMainApi.getPurchaseclaimRequestMainPage //
}) })
// //
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'wms:purchaseclaim-request-main:create' }), // defaultButtons.defaultAddBtn({ hasPermi: 'wms:purchaseclaim-request-main:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:purchaseclaim-request-main:import' }), // defaultButtons.defaultImportBtn({ hasPermi: 'wms:purchaseclaim-request-main:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchaseclaim-request-main:export' }), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:purchaseclaim-request-main:export' }), //
@ -165,10 +168,10 @@ const HeadButttondata = [
// icon: 'Select', // icon: 'Select',
// color: '' // color: ''
// }, // },
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') { //
@ -181,33 +184,33 @@ const buttonBaseClick = (val, item) => {
} else { // } else { //
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// - // -
const buttondata = (row) => { const buttondata = (row) => {
return [ return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // defaultButtons.mainListCloseBtn({ hide: isShowMainButton(row, ['1', '2', '3', '4', '6']) }), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // defaultButtons.mainListReAddBtn({ hide: isShowMainButton(row, ['4', '5']) }), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // defaultButtons.mainListSubmitBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListTurnDownBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // defaultButtons.mainListApproveBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListEditBtn({ hide:isShowMainButton(row,['1']),hasPermi: 'wms:purchaseclaim-request-main:update' }), // defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchaseclaim-request-main:update' }), //
defaultButtons.mainListDeleteBtn({ hide:isShowMainButton(row,['1']),hasPermi: 'wms:purchaseclaim-request-main:delete' }), // defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchaseclaim-request-main:delete' }), //
defaultButtons.mainListPointBtn(null), // defaultButtons.mainListPointBtn(null), //
] ]
} }
// //
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
return false return false
} else { } else {
return true return true
} }
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { // if (val == 'mainClose') { //
console.log('列表-操作按钮事件-关闭') console.log('列表-操作按钮事件-关闭')
} else if (val == 'mainReAdd') { // } else if (val == 'mainReAdd') { //
@ -226,27 +229,27 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'point') { // } else if (val == 'point') { //
handlePoint(row.id) handlePoint(row.id)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm = async (type : string, row ?: number) => {
tableData.value = [] // tableData.value = [] //
//  if (row?.id) { //  if (row?.id) {
// const data= await PurchaseclaimRequestMainApi.getPurchaseclaimRequestMain(row.id) // const data= await PurchaseclaimRequestMainApi.getPurchaseclaimRequestMain(row.id)
// tableData.value = data.subList // tableData.value = data.subList
// } // }
formRef.value.open(type, row) formRef.value.open(type, row)
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue) detailRef.value.openDetail(row, titleName, titleValue)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id : number) => {
try { try {
// //
await message.delConfirm() await message.delConfirm()
@ -256,10 +259,10 @@ const handleDelete = async (id: number) => {
// //
await getList() await getList()
} catch { } } catch { }
} }
/** 导出按钮操作 */ /** 导出按钮操作 */
const handleExport = async () => { const handleExport = async () => {
try { try {
// //
await message.exportConfirm() await message.exportConfirm()
@ -271,35 +274,35 @@ const handleExport = async () => {
} finally { } finally {
exportLoading.value = false exportLoading.value = false
} }
} }
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/882550592342003712?token=' + getAccessToken()) const src = ref(BASE_URL + '/jmreport/view/882550592342003712?token=' + getAccessToken())
console.log(src) console.log(src)
// //
const handlePoint = async (id) => { const handlePoint = async (id) => {
window.open(src.value+'&id='+id) window.open(src.value + '&id=' + id)
} }
/** /**
* tableForm方法 * tableForm方法
*/ */
const tableFormKeys = {} const tableFormKeys = {}
PurchaseclaimRequestDetail.allSchemas.tableFormColumns.forEach(item => { PurchaseclaimRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
const tableData = ref([]) const tableData = ref([])
// //
const handleAddTable = () => { const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
} }
// //
const handleDeleteTable = (item, index) => { const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1) tableData.value.splice(index, 1)
} }
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //
try { try {
if (formType === 'create') { if (formType === 'create') {
@ -314,37 +317,35 @@ const submitForm = async (formType, data) => {
getList() getList()
} finally { } finally {
formRef.value.formLoading = false formRef.value.formLoading = false
}
} }
} /** 导入 */
const importFormRef = ref()
/** 导入 */ const handleImport = () => {
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open() importFormRef.value.open()
} }
// //
const importTemplateData = reactive({ const importTemplateData = reactive({
templateUrl: '', templateUrl: '',
templateTitle: '采购索赔申请信息导入模版.xlsx' templateTitle: '采购索赔申请信息导入模版.xlsx'
}) })
// //
const importSuccess = () => { const importSuccess = () => {
getList() getList()
} }
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters
} }
getList() // getList() //
} }
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await PurchaseclaimRequestMainApi.importTemplate() importTemplateData.templateUrl = await PurchaseclaimRequestMainApi.importTemplate()
}) })
</script> </script>

Loading…
Cancel
Save