Browse Source

箱托规格

master_hella_20240701
张立 1 year ago
parent
commit
9085d23514
  1. 5
      src/api/wms/supplierdeliverRequestDetail/index.ts
  2. 16
      src/components/TableForm/src/TableForm.vue
  3. 310
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  4. 55
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

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

@ -45,9 +45,12 @@ export const getSupplierdeliverRequestDetailPage = async (params) => {
} }
// 查询供应商发货申请子列表 // 查询供应商发货申请子列表
export const getGenerateLabelList = async (params) => { export const getGenerateLabelList = async (params) => {
return await request.get({ url: `/wms/supplierdeliver-request-detail/generateLabelList`, params })
}
// 查询托规格列表
export const getGenerateLabelParentList = async (params) => {
return await request.get({ url: `/wms/supplierdeliver-request-detail/generateLabelParentList`, params }) return await request.get({ url: `/wms/supplierdeliver-request-detail/generateLabelParentList`, params })
} }
// 查询供应商发货申请子详情 // 查询供应商发货申请子详情
export const getSupplierdeliverRequestDetail = async (id: number) => { export const getSupplierdeliverRequestDetail = async (id: number) => {
return await request.get({ url: `/wms/supplierdeliver-request-detail/get?id=` + id }) return await request.get({ url: `/wms/supplierdeliver-request-detail/get?id=` + id })

16
src/components/TableForm/src/TableForm.vue

@ -166,7 +166,7 @@
@blur="tableFormSelectOnBlur(headerItem.field, $event, row, $index)" @blur="tableFormSelectOnBlur(headerItem.field, $event, row, $index)"
> >
<el-option <el-option
v-for="op in initSelectOptions(headerItem)" v-for="op in initSelectOptions(headerItem,row)"
:label="t(`ts.${op.label}`).replace('ts.', '')" :label="t(`ts.${op.label}`).replace('ts.', '')"
:value="op.value" :value="op.value"
:key="op.value" :key="op.value"
@ -196,7 +196,7 @@
@blur="tableFormSelectOnBlur(headerItem.field, $event, row, $index)" @blur="tableFormSelectOnBlur(headerItem.field, $event, row, $index)"
> >
<el-option-group <el-option-group
v-for="group in initSelectOptions(headerItem)" v-for="group in initSelectOptions(headerItem,row)"
:key="group.type" :key="group.type"
:label="t(`ts.${group.name}`).replace('ts.', '')" :label="t(`ts.${group.name}`).replace('ts.', '')"
> >
@ -302,7 +302,7 @@
:id="headerItem?.tableForm?.id" :id="headerItem?.tableForm?.id"
> >
<el-radio <el-radio
v-for="(item, index) in initSelectOptions(headerItem)" v-for="(item, index) in initSelectOptions(headerItem,row)"
:key="index" :key="index"
:label="t(`ts.${item.value}`).replace('ts.', '')" :label="t(`ts.${item.value}`).replace('ts.', '')"
:size="headerItem?.tableForm?.size" :size="headerItem?.tableForm?.size"
@ -326,7 +326,7 @@
:fill="headerItem?.tableForm?.fill" :fill="headerItem?.tableForm?.fill"
> >
<el-checkbox <el-checkbox
v-for="(item, index) in initSelectOptions(headerItem)" v-for="(item, index) in initSelectOptions(headerItem,row)"
:key="index" :key="index"
:label="t(`ts.${item.value}`).replace('ts.', '')" :label="t(`ts.${item.value}`).replace('ts.', '')"
:disabled="itemIsDisabled(headerItem, row)" :disabled="itemIsDisabled(headerItem, row)"
@ -520,8 +520,12 @@ const emit = defineEmits([
'batchAdd' 'batchAdd'
]) ])
// | type = radio | type = select // | type = radio | type = select
const initSelectOptions = (item) => { const initSelectOptions = (headerItem,row) => {
return item.dictType ? getStrDictOptions(item.dictType) : item.tableForm.initOptions if(row[headerItem.field+'InitOptions']){
return row[headerItem.field+'InitOptions']
}else{
return headerItem.dictType ? getStrDictOptions(headerItem.dictType) : headerItem.tableForm.initOptions
}
} }
// //
const formSelectChange = (field, val, row) => { const formSelectChange = (field, val, row) => {

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

@ -2,7 +2,10 @@
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search <Search
:schema="[...SupplierdeliverRequestMain.allSchemas.searchSchema,...SupplierdeliverRequestDetail.allSchemas.searchSchema]" :schema="[
...SupplierdeliverRequestMain.allSchemas.searchSchema,
...SupplierdeliverRequestDetail.allSchemas.searchSchema
]"
@search="setSearchParams" @search="setSearchParams"
@reset="setSearchParams" @reset="setSearchParams"
/> />
@ -21,7 +24,8 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -38,13 +42,19 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row, $index }"> <template #action="{ row, $index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event, row)" /> <ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<supplierdeliverBasicForm ref="supplierdeliverFormRef" @getList="getList" ></supplierdeliverBasicForm> <supplierdeliverBasicForm
ref="supplierdeliverFormRef"
@getList="getList"
></supplierdeliverBasicForm>
<!-- <BasicForm <!-- <BasicForm
ref="formRef" ref="formRef"
:isOpenSearchTable="true" :isOpenSearchTable="true"
@ -76,7 +86,8 @@
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
:annexTable="[{ :annexTable="[
{
label: '质检明细', label: '质检明细',
prop: 'uploadFile', prop: 'uploadFile',
tableName: 'SupplierdeliverInspectionDetail', tableName: 'SupplierdeliverInspectionDetail',
@ -86,18 +97,21 @@
align: 'left', align: 'left',
// //
subDetailTableData: { subDetailTableData: {
queryParams:[{ queryParams: [
{
queryField: 'masterId', queryField: 'masterId',
rowField: 'masterId' rowField: 'masterId'
}], // }
], //
getSubList: SupplierdeliverInspectionDetailApi.getSupplierdeliverInspectionDetailPage, // getSubList: SupplierdeliverInspectionDetailApi.getSupplierdeliverInspectionDetailPage, //
tableColumns: SupplierdeliverInspectionDetail.allSchemas.tableColumns, tableColumns: SupplierdeliverInspectionDetail.allSchemas.tableColumns,
tableList: [], // tableList: [], //
total: 1, total: 1,
pageSize: 10, pageSize: 10,
currentPage:1, currentPage: 1
} }
}]" }
]"
:isBasic="false" :isBasic="false"
:allSchemas="SupplierdeliverRequestMain.allSchemas" :allSchemas="SupplierdeliverRequestMain.allSchemas"
:detailAllSchemas="SupplierdeliverRequestDetail.allSchemas" :detailAllSchemas="SupplierdeliverRequestDetail.allSchemas"
@ -126,15 +140,16 @@
@success="getList" @success="getList"
:tableAllSchemas="SupplierdeliverRequestDetailLabel.allSchemas" :tableAllSchemas="SupplierdeliverRequestDetailLabel.allSchemas"
:tableFormRules="SupplierdeliverRequestDetailRules" :tableFormRules="SupplierdeliverRequestDetailRules"
:tableData="detatableData.tableList" :tableData="detatableData1"
:isBusiness="true" :isBusiness="true"
:isShowButton="false" :isShowButton="false"
@searchTableSuccess="searchTableSuccessLabel" @searchTableSuccess="searchTableSuccessLabel"
@submitForm="submitFormLabel" @submitForm="submitFormLabel"
:isShowReduceButton="false" :isShowReduceButton="false"
@clearInput='clearInput' @clearInput="clearInput"
:footButttondata="footButttondata" :footButttondata="footButttondata"
@footButtonClick='footButtonClick' @footButtonClick="footButtonClick"
@formSelectChange='formSelectChangeLabel'
/> />
<!-- 上传质量报告 --> <!-- 上传质量报告 -->
<BasicForm <BasicForm
@ -174,9 +189,12 @@ import {
SupplierdeliverRequestDetail, SupplierdeliverRequestDetail,
SupplierdeliverRequestDetailRules, SupplierdeliverRequestDetailRules,
SupplierdeliverRequestDetailLabel, SupplierdeliverRequestDetailLabel,
SupplierdeliverRequestPackage, SupplierdeliverRequestPackage
} from './supplierdeliverRequestMain.data' } from './supplierdeliverRequestMain.data'
import {   SupplierdeliverInspectionDetail,SupplierdeliverInspectionDetailRules} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data' import {
SupplierdeliverInspectionDetail,
SupplierdeliverInspectionDetailRules
} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data'
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -190,17 +208,21 @@ import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/su
import supplierdeliverBasicForm from './supplierdeliverBasicForm.vue' import supplierdeliverBasicForm from './supplierdeliverBasicForm.vue'
import labelForm from './labelForm.vue' import labelForm from './labelForm.vue'
import { getJmreportBaseUrl } from '@/utils/systemParam' import { getJmreportBaseUrl } from '@/utils/systemParam'
import { log } from 'console'
// //
defineOptions({ name: 'SupplierdeliverRequestMain' }) defineOptions({ name: 'SupplierdeliverRequestMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const genLabelId = ref(); const genLabelId = ref()
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref([...SupplierdeliverRequestMain.allSchemas.tableColumns,...SupplierdeliverRequestDetail.allSchemas.tableMainColumns]) const tableColumns = ref([
...SupplierdeliverRequestMain.allSchemas.tableColumns,
...SupplierdeliverRequestDetail.allSchemas.tableMainColumns
])
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
@ -211,8 +233,8 @@ const planArriveTimeStr = ref()
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
console.log("type:",type) console.log('type:', type)
console.log("formField:",formField) console.log('formField:', formField)
console.log(formField, searchField, val, formRef, type, row) console.log(formField, searchField, val, formRef, type, row)
if (type == 'tableForm') { if (type == 'tableForm') {
// //
@ -226,8 +248,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// } // }
//-- //--
const itemCodes = [] const itemCodes = []
val.forEach(item=>{ val.forEach((item) => {
if(tableData.value.find(item1=>item1['id'] == item['id'])) return if (tableData.value.find((item1) => item1['id'] == item['id'])) return
const newRow = { ...row } const newRow = { ...row }
newRow[formField] = item[searchField] newRow[formField] = item[searchField]
newRow['poNumber'] = item['poNumber'] newRow['poNumber'] = item['poNumber']
@ -243,7 +265,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
code: itemCodes.join(',') code: itemCodes.join(',')
}).then((res) => { }).then((res) => {
res.list.forEach((item, index) => { res.list.forEach((item, index) => {
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) const findItem = tableData.value.find((item1) => item1['itemCode'] == item['code'])
findItem['expireTime'] = findItem['expireTime'] findItem['expireTime'] = findItem['expireTime']
}) })
}) })
@ -257,8 +279,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// //
let beginTime = val[0]['endTime'] let beginTime = val[0]['endTime']
let deliveryDate = formatDate(val[0]['deliveryDate'], 'YYYY-MM-DD') let deliveryDate = formatDate(val[0]['deliveryDate'], 'YYYY-MM-DD')
planArriveTimeStr.value = deliveryDate + ' '+ beginTime+":00" planArriveTimeStr.value = deliveryDate + ' ' + beginTime + ':00'
setV['planArriveTime']= new Date(planArriveTimeStr.value).valueOf(); setV['planArriveTime'] = new Date(planArriveTimeStr.value).valueOf()
// //
tableData.value = [] tableData.value = []
} }
@ -274,10 +296,19 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// //
const onEnter = async (field, value) => { const onEnter = async (field, value) => {
console.log(field, value) console.log(field, value)
formRef.value.opensearchTable('supplierCode', 'code', '供应商信息', Supplier.allSchemas, SupplierApi.getSupplierPage,[{ formRef.value.opensearchTable(
'supplierCode',
'code',
'供应商信息',
Supplier.allSchemas,
SupplierApi.getSupplierPage,
[
{
key: 'code', key: 'code',
value: value value: value
}]) }
]
)
} }
const getSearchTableData = async (number, formField, searchField) => { const getSearchTableData = async (number, formField, searchField) => {
@ -294,7 +325,7 @@ const getSearchTableData = async (number,formField,searchField)=>{
}) })
tableData.value = [] tableData.value = []
const itemCodes = [] const itemCodes = []
tableObject.tableList.forEach(row=>{ tableObject.tableList.forEach((row) => {
const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...row })) const newRow = JSON.parse(JSON.stringify({ ...tableFormKeys, ...row }))
newRow[formField] = row[searchField] newRow[formField] = row[searchField]
newRow['poNumber'] = row['poNumber'] newRow['poNumber'] = row['poNumber']
@ -311,9 +342,8 @@ const getSearchTableData = async (number,formField,searchField)=>{
code: itemCodes.join(',') code: itemCodes.join(',')
}).then((res) => { }).then((res) => {
res.list.forEach((item, index) => { res.list.forEach((item, index) => {
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) const findItem = tableData.value.find((item1) => item1['itemCode'] == item['code'])
findItem['expireTime'] = findItem['expireTime'] findItem['expireTime'] = findItem['expireTime']
}) })
}) })
} }
@ -336,8 +366,8 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
// //
const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row) => { const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row) => {
nextTick(() => { nextTick(() => {
console.log("formField:",formField) console.log('formField:', formField)
console.log("val:",val) console.log('val:', val)
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
@ -355,8 +385,6 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row
}) })
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage // getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage //
}) })
@ -444,16 +472,33 @@ const isReGenLabelShowMainButtonLabel = (row, val) => {
// - // -
const butttondata = (row, $index) => { const butttondata = (row, $index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) { if (findIndex > -1 && findIndex < $index) {
return [] return []
} }
return [ return [
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['5']),hasPermi: 'wms:supplierdeliver-request-main:open' }), // defaultButtons.mainListPurchasePlanOpeBtn({
defaultButtons.mainListPlanUploadQualityReportBtn({ hide: isShowMainButton(row, ['1','2','3']),hasPermi: 'wms:supplierdeliver-request-main:uploadCheck'}), // hide: isShowMainButton(row, ['5']),
defaultButtons.mainListPlanSubBtn({ hide: isShowMainButton(row, ['1']),hasPermi: 'wms:supplierdeliver-request-main:sub' }), // hasPermi: 'wms:supplierdeliver-request-main:open'
defaultButtons.mainListPlanAppBtn({ hide: isShowMainButton(row, ['2']),hasPermi: 'wms:supplierdeliver-request-main:app' }), // }), //
defaultButtons.mainListPlanTurBtn({ hide: isShowMainButton(row, ['2']),hasPermi: 'wms:supplierdeliver-request-main:rej' }), // defaultButtons.mainListPlanUploadQualityReportBtn({
hide: isShowMainButton(row, ['1', '2', '3']),
hasPermi: 'wms:supplierdeliver-request-main:uploadCheck'
}), //
defaultButtons.mainListPlanSubBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:supplierdeliver-request-main:sub'
}), //
defaultButtons.mainListPlanAppBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'wms:supplierdeliver-request-main:app'
}), //
defaultButtons.mainListPlanTurBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'wms:supplierdeliver-request-main:rej'
}), //
defaultButtons.mainListEditBtn({ defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']), hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:supplierdeliver-request-main:update' hasPermi: 'wms:supplierdeliver-request-main:update'
@ -479,7 +524,10 @@ const butttondata = (row,$index) => {
hasPermi: 'wms:supplierdeliver-request-main:genLabels', hasPermi: 'wms:supplierdeliver-request-main:genLabels',
link: true // link: true //
}, },
defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3','8']),hasPermi: 'wms:supplierdeliver-request-main:printLabel' }), // defaultButtons.mainListPointBtn({
hide: isShowMainButton(row, ['3', '8']),
hasPermi: 'wms:supplierdeliver-request-main:printLabel'
}), //
//defaultButtons.mainListDocumentPrintBtn({ hide: isShowMainButton(row, ['3','8']) }), // //defaultButtons.mainListDocumentPrintBtn({ hide: isShowMainButton(row, ['3','8']) }), //
// //
{ {
@ -492,10 +540,14 @@ const butttondata = (row,$index) => {
hasPermi: 'wms:supplierdeliver-request-main:genRecords', hasPermi: 'wms:supplierdeliver-request-main:genRecords',
link: true // link: true //
}, },
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1', '2', '4','3']),hasPermi: 'wms:supplierdeliver-request-main:close' }), // defaultButtons.mainListPurchasePlanCloBtn({
hide: isShowMainButton(row, ['1', '2', '4', '3']),
hasPermi: 'wms:supplierdeliver-request-main:close'
}) //
] ]
} }
const detatableData1 = ref([])
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') { if (val == 'mainPurPlanOpe') {
@ -531,15 +583,34 @@ const buttonTableClick = async (val, row) => {
masterId: row.masterId masterId: row.masterId
} }
genLabelId.value = row.masterId genLabelId.value = row.masterId
await getDetailList() // await getDetailList()
const params1 = {
masterId: row.masterId,
pageSize: '500',
pageNo: '1',
sort: '',
by: 'ASC'
}
await SupplierdeliverRequestDetailApi.getGenerateLabelList(params1).then((res) => {
detatableData1.value = res
detatableData1.value.forEach((item) => {
console.log(item.boxPackaging)
if (item.boxPackaging?.length > 0) {
item.packUnitInitOptions = item.boxPackaging.map((cur) => {
return { label: cur.packName, value: cur.packUnit }
})
}
})
})
formLabelRef.value.open('create', row, null, 'createLabel') // createLabel formLabelRef.value.open('create', row, null, 'createLabel') // createLabel
} else if (val == 'ressbq') { } else if (val == 'ressbq') {
console.log("重新生成标签") console.log('重新生成标签')
ElMessageBox.confirm(t('ts.重新生成标签会删除上次生成的标签,是否确认继续?'), '提示', { ElMessageBox.confirm(t('ts.重新生成标签会删除上次生成的标签,是否确认继续?'), '提示', {
confirmButtonText: t('ts.确 认'), confirmButtonText: t('ts.确 认'),
cancelButtonText: t('ts.取 消') cancelButtonText: t('ts.取 消')
}).then(() => { })
SupplierdeliverRequestMainApi.deleteOldLabels(row.masterId).then(async res =>{ .then(() => {
SupplierdeliverRequestMainApi.deleteOldLabels(row.masterId).then(async (res) => {
if (res) { if (res) {
// //
detatableData.params = { detatableData.params = {
@ -550,7 +621,8 @@ const buttonTableClick = async (val, row) => {
formLabelRef.value.open('create', row, null, 'createLabel') // createLabel formLabelRef.value.open('create', row, null, 'createLabel') // createLabel
} }
}) })
}).catch(() => { })
.catch(() => {
console.info('操作取消') console.info('操作取消')
}) })
} else if (val == 'point') { } else if (val == 'point') {
@ -567,19 +639,36 @@ const footButttondata = ref([
]) ])
// //
const labelFormRef = ref() const labelFormRef = ref()
const footButtonClick = (val)=>{ const footButtonClick = async (val) => {
if (val == 'nextStep') { if (val == 'nextStep') {
labelFormRef.value.openLabel(detatableData.tableList) labelFormRef.value.openLabel(detatableData1)
} else if (val == 'close') { } else if (val == 'close') {
formLabelRef.value.dialogVisible = false formLabelRef.value.dialogVisible = false
} }
}
//
const formSelectChangeLabel =( field, val, row)=>{
if(field=='packUnit'){
let obj= row.boxPackaging.find(item=>item.packUnit ==val )
row.packQty = obj.packQty
//
const params1 = {
itemCode:row.itemCode,
packUnit:row.packUnit
}
SupplierdeliverRequestDetailApi.getGenerateLabelParentList(params1).then((res)=>{
})
}
} }
// //
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue, 'requestSupplierdeliverMain') detailRef.value.openDetail(row, titleName, titleValue, 'requestSupplierdeliverMain')
} }
@ -637,7 +726,8 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -653,7 +743,8 @@ const handleClo = async (id: number) => {
message.success(t('ts.关闭成功!')) message.success(t('ts.关闭成功!'))
// //
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -669,7 +760,8 @@ const handleOpe = async (id: number) => {
message.success(t('ts.打开成功!')) message.success(t('ts.打开成功!'))
// //
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -687,28 +779,37 @@ const handleAddQualityReport = ()=>{
const handleDeleteQualityReport = (row, index) => { const handleDeleteQualityReport = (row, index) => {
uploadQualityReportTableData.value.splice(index, 1) uploadQualityReportTableData.value.splice(index, 1)
console.log('handleDeleteQualityReport', row) console.log('handleDeleteQualityReport', row)
} }
/** 上传质量报告 */ /** 上传质量报告 */
const handleUploadQualityReport = async (row) => { const handleUploadQualityReport = async (row) => {
console.log('SupplierdeliverInspectionDetail', SupplierdeliverInspectionDetail.allSchemas) console.log('SupplierdeliverInspectionDetail', SupplierdeliverInspectionDetail.allSchemas)
const uploadFile = SupplierdeliverInspectionDetail.allSchemas.formSchema.find(item=>item.field=='uploadFile') const uploadFile = SupplierdeliverInspectionDetail.allSchemas.formSchema.find(
(item) => item.field == 'uploadFile'
)
if (uploadFile) { if (uploadFile) {
uploadFile['componentProps']['upData']['tableId'] = row.masterId uploadFile['componentProps']['upData']['tableId'] = row.masterId
} }
ploadQualityReportRef.value.open('create', null, {masterId:row.masterId},t('ts.上传质检报告'),t('ts.上传质检报告'))// createLabel ploadQualityReportRef.value.open(
'create',
null,
{ masterId: row.masterId },
t('ts.上传质检报告'),
t('ts.上传质检报告')
) // createLabel
const tableFormKeys = {} const tableFormKeys = {}
SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => { SupplierdeliverInspectionDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
await SupplierdeliverInspectionDetailApi.getSupplierdeliverDetailInfo(row.masterId).then(res => { await SupplierdeliverInspectionDetailApi.getSupplierdeliverDetailInfo(row.masterId).then(
(res) => {
if (res) { if (res) {
// console.log(":",res) // console.log(":",res)
uploadQualityReportTableData.value = res; uploadQualityReportTableData.value = res
} }
}) }
)
//uploadQualityReportTableData.value = [tableFormKeys] //uploadQualityReportTableData.value = [tableFormKeys]
} }
@ -737,7 +838,8 @@ const handleSub = async (id: number) => {
message.success(t('ts.提交审批成功!')) message.success(t('ts.提交审批成功!'))
// //
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -753,7 +855,8 @@ const handleApp = async (id: number) => {
message.success(t('ts.审批通过成功!')) message.success(t('ts.审批通过成功!'))
// //
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -769,7 +872,8 @@ const handleTur = async (id: number) => {
message.success(t('ts.驳回成功!')) message.success(t('ts.驳回成功!'))
// //
await getList() await getList()
} catch {}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -777,7 +881,8 @@ const handleTur = async (id: number) => {
/** 处理按钮操作 */ /** 处理按钮操作 */
const genRecords = async (id: number) => { const genRecords = async (id: number) => {
let getLoading = null let getLoading = null
await SupplierdeliverRequestMainApi.selfCheckReport(id).then(async res => { await SupplierdeliverRequestMainApi.selfCheckReport(id)
.then(async (res) => {
if (!res) { if (!res) {
message.warning(t('ts.请先上传自检报告!')) message.warning(t('ts.请先上传自检报告!'))
return return
@ -790,7 +895,8 @@ const genRecords = async (id: number) => {
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}) })
// //
SupplierdeliverRequestMainApi.genRecordsSupplierdeliverRequestMain(id).then(res => { SupplierdeliverRequestMainApi.genRecordsSupplierdeliverRequestMain(id)
.then((res) => {
message.success(t('ts.处理成功!')) message.success(t('ts.处理成功!'))
console.log('resresresresres', res) console.log('resresresresres', res)
// //
@ -800,16 +906,16 @@ const genRecords = async (id: number) => {
// //
handleDocumentPrint(res) handleDocumentPrint(res)
}).catch(err=>{ })
console.log("发起处理",err) .catch((err) => {
console.log('发起处理', err)
getLoading?.close() getLoading?.close()
}) })
} }
}).catch(err => { })
console.log("自检报告校验异常",err) .catch((err) => {
console.log('自检报告校验异常', err)
getLoading?.close() getLoading?.close()
}) })
} }
@ -835,12 +941,11 @@ const handleExport = async () => {
const isCreateLabel = ref(false) const isCreateLabel = ref(false)
const formLabelRef = ref() const formLabelRef = ref()
const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({ const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({
getListApi: SupplierdeliverRequestDetailApi.getGenerateLabelList getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage
}) })
detatableData.pageSize = 500 detatableData.pageSize = 500
const { getList: getDetailList } = detatableMethods const { getList: getDetailList } = detatableMethods
// //
const submitFormLabel = async (formType, submitData) => { const submitFormLabel = async (formType, submitData) => {
let data = { ...submitData } let data = { ...submitData }
@ -848,29 +953,32 @@ const submitFormLabel = async (formType, submitData) => {
data.id = data.masterId data.id = data.masterId
} }
try { try {
console.log("formType==",formType) console.log('formType==', formType)
console.log("data==",data) console.log('data==', data)
data.subList = detatableData.tableList data.subList = detatableData.tableList
if(detatableData.tableList.find(item=>item.secondPackUnit==item.packUnit)){ if (detatableData.tableList.find((item) => item.secondPackUnit == item.packUnit)) {
message.warning(t('ts.包装规格1和包装规格2不能相同')) message.warning(t('ts.包装规格1和包装规格2不能相同'))
return return
} }
// //
let flag = false; let flag = false
await SupplierdeliverRequestMainApi.checkPackQty(data).then(async res => { await SupplierdeliverRequestMainApi.checkPackQty(data).then(async (res) => {
if (res) { if (res) {
await message.confirm(t('ts.是否修改物料包装标包数量')+'?').then(()=>{ await message
flag = true; // .confirm(t('ts.是否修改物料包装标包数量') + '?')
}).catch(() =>{ .then(() => {
flag = true //
})
.catch(() => {
flag = false flag = false
}) })
} else { } else {
flag = true; // flag = true //
} }
}) })
console.log("返回结果",flag); console.log('返回结果', flag)
if (flag) { if (flag) {
console.log("detatableData",detatableData) console.log('detatableData', detatableData)
await message.confirm(t('ts.是否为此数据生成标签?')) await message.confirm(t('ts.是否为此数据生成标签?'))
await SupplierdeliverRequestMainApi.genLabel(data) await SupplierdeliverRequestMainApi.genLabel(data)
isCreateLabel.value = true isCreateLabel.value = true
@ -889,7 +997,6 @@ const clearInput = async (field,row,index) => {
SupplierdeliverRequestDetailRules.secondPackQty[0].required = false SupplierdeliverRequestDetailRules.secondPackQty[0].required = false
} }
const BASE_URL = getJmreportBaseUrl() const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage //
@ -898,7 +1005,7 @@ getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口
const searchTableRef = ref() const searchTableRef = ref()
const labelPrint = async (row) => { const labelPrint = async (row) => {
tableObject.loading = true tableObject.loading = true
const defaultParams = {'moduleName':'supplier','recordNumber':row.number} const defaultParams = { moduleName: 'supplier', recordNumber: row.number }
const { tableObject: tableObjectPrint, tableMethods } = useTable({ const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams, defaultParams,
getListApi: PackageApi.getLabelDetailPage // getListApi: PackageApi.getLabelDetailPage //
@ -916,9 +1023,7 @@ const labelPrint = async (row) => {
} }
// //
const printAllClick = ()=>{ const printAllClick = () => {}
}
// -- // --
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => {
@ -933,10 +1038,12 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r
} }
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(',')) // window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(','))
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { await PackageApi.batchPrintingLable(val.map((item1) => item1.number).join(','))
.then((res) => {
console.log(res) console.log(res)
window.open(src.value + '&asn_number=' + res) window.open(src.value + '&asn_number=' + res)
}).catch(err => { })
.catch((err) => {
console.log(err) console.log(err)
message.error(t('ts.创建标签失败')) message.error(t('ts.创建标签失败'))
}) })
@ -980,7 +1087,7 @@ const submitForm = async (formType, submitData) => {
} }
data.subList = tableData.value // data.subList = tableData.value //
let isHave = data.subList.some((item) => { let isHave = data.subList.some((item) => {
console.log("CCCCC",item.expireDate) console.log('CCCCC', item.expireDate)
if (item.expireDate != null) { if (item.expireDate != null) {
item.produceDate > item.expireDate item.produceDate > item.expireDate
} }
@ -992,27 +1099,30 @@ const submitForm = async (formType, submitData) => {
} }
try { try {
if (formType === 'create') { if (formType === 'create') {
let planArriveStr = formatDate(data.planArriveTime); let planArriveStr = formatDate(data.planArriveTime)
if (planArriveStr > planArriveTimeStr.value) { if (planArriveStr > planArriveTimeStr.value) {
let confirmFlag = false; let confirmFlag = false
await message.confirm(`${t('ts.计划到货时间大于')}${planArriveTimeStr.value}${t('ts.是否继续?')}`).then(() => { await message
console.log("选择了OK") .confirm(`${t('ts.计划到货时间大于')}${planArriveTimeStr.value}${t('ts.是否继续?')}`)
.then(() => {
console.log('选择了OK')
//OK //OK
}).catch(() => { })
.catch(() => {
// //
console.log("选择了cancel") console.log('选择了cancel')
confirmFlag = true; confirmFlag = true
formRef.value.formLoading = false formRef.value.formLoading = false
return; return
}) })
if (confirmFlag) { if (confirmFlag) {
return; return
} }
} }
if (tableData.value.length <= 0) { if (tableData.value.length <= 0) {
message.warning(t('ts.子表明细不能为空!')) message.warning(t('ts.子表明细不能为空!'))
formRef.value.formLoading = false formRef.value.formLoading = false
return; return
} }
await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data) await SupplierdeliverRequestMainApi.createSupplierdeliverRequestMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -1056,7 +1166,7 @@ const searchFormClick = (searchData) => {
const formFormDateChange = (field, val, row, index) => { const formFormDateChange = (field, val, row, index) => {
if (field == 'produceDate') { if (field == 'produceDate') {
let produceDateStr = formatDate(val,'YYYYMMDD'); let produceDateStr = formatDate(val, 'YYYYMMDD')
row.batch = produceDateStr row.batch = produceDateStr
row.supplierBatch = produceDateStr row.supplierBatch = produceDateStr
} }

55
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -1604,16 +1604,57 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
isTable: true, isTable: true,
sort: 'custom', sort: 'custom',
form: { form: {
value: userDept.id, },
component: 'Select', tableForm: {
api: () => userDeptArray, type: 'Select',
initOptions: [{
label: '',
value: ''
}]
}
},{
label: '箱规格数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: { componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
} }
},
tableForm: {
disabled:true
}
},
{
label: '托规格',
field: 'parentCode',
isTable: true,
sort: 'custom',
form: {
},
tableForm: {
type: 'Select',
initOptions: [{
label: '',
value: ''
}]
}
},
{
label: '托规格数量',
field: 'parentQty',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
} }
},
tableForm: {
disabled:true
} }
}, },

Loading…
Cancel
Save