陈薪名 1 year ago
parent
commit
5c27fdb8d6
  1. 16
      src/api/wms/purchaseMain/index.ts
  2. 27
      src/api/wms/purchasePlanMain/index.ts
  3. 146
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue
  4. 191
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  5. 34
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

16
src/api/wms/purchaseMain/index.ts

@ -54,6 +54,22 @@ export const deletePurchaseMain = async (id: number) => {
return await request.delete({ url: `/wms/purchase-main/delete?id=` + id })
}
// 关闭采购订单主
export const closePurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-main/close?id=` + id })
}
// 打开采购订单主
export const openPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-main/open?id=` + id })
}
// 发布采购订单主
export const publishPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-main/publish?id=` + id })
}
// 下架采购订单主
export const witPurchaseMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-main/wit?id=` + id })
}
// 导出采购订单主 Excel
export const exportPurchaseMain = async (params) => {
return await request.download({ url: `/wms/purchase-main/export-excel`, params })

27
src/api/wms/purchasePlanMain/index.ts

@ -49,6 +49,33 @@ export const deletePurchasePlanMain = async (id: number) => {
return await request.delete({ url: `/wms/purchase-plan-main/delete?id=` + id })
}
// 关闭要货计划主
export const closePurchasePlanMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-plan-main/close?id=` + id })
}
// 打开要货计划主
export const openPurchasePlanMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-plan-main/open?id=` + id })
}
// 发布要货计划主
export const publishPurchasePlanMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-plan-main/publish?id=` + id })
}
// 下架要货计划主
export const witPurchasePlanMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-plan-main/wit?id=` + id })
}
// 接受要货计划主
export const accPurchasePlanMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-plan-main/acc?id=` + id })
}
// 驳回要货计划主
export const rejPurchasePlanMain = async (id: number) => {
return await request.post({ url: `/wms/purchase-plan-main/rej?id=` + id })
}
// 导出要货计划主 Excel
export const exportPurchasePlanMain = async (params) => {
return await request.download({ url: `/wms/purchase-plan-main/export-excel`, params })

146
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

@ -5,28 +5,15 @@
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchaseMain.allSchemas"
/>
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="PurchaseMain.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,40 +26,22 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="PurchaseMainRules"
:formAllSchemas="PurchaseMain.allSchemas"
:tableAllSchemas="PurchaseDetail.allSchemas"
:tableFormRules="PurchaseDetailRules"
:tableData="tableData"
:apiUpdate="PurchaseMainApi.updatePurchaseMain"
:apiCreate="PurchaseMainApi.createPurchaseMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<BasicForm ref="formRef" @success="getList" :rules="PurchaseMainRules" :formAllSchemas="PurchaseMain.allSchemas"
:tableAllSchemas="PurchaseDetail.allSchemas" :tableFormRules="PurchaseDetailRules" :tableData="tableData"
:apiUpdate="PurchaseMainApi.updatePurchaseMain" :apiCreate="PurchaseMainApi.createPurchaseMain" :isBusiness="true"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" />
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PurchaseMain.allSchemas"
:detailAllSchemas="PurchaseDetail.allSchemas"
:detailAllSchemasRules="PurchaseDetailRules"
:apiCreate="PurchaseDetailApi.createPurchaseDetail"
:apiUpdate="PurchaseDetailApi.updatePurchaseDetail"
:apiPage="PurchaseDetailApi.getPurchaseDetailPage"
:apiDelete="PurchaseDetailApi.deletePurchaseDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
<Detail ref="detailRef" :isBasic="false" :allSchemas="PurchaseMain.allSchemas"
:detailAllSchemas="PurchaseDetail.allSchemas" :detailAllSchemasRules="PurchaseDetailRules"
:apiCreate="PurchaseDetailApi.createPurchaseDetail" :apiUpdate="PurchaseDetailApi.updatePurchaseDetail"
:apiPage="PurchaseDetailApi.getPurchaseDetailPage" :apiDelete="PurchaseDetailApi.deletePurchaseDetail" :Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData" @success="importSuccess" :isShowOut="true" />
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" />
</template>
<script setup lang="ts">
@ -87,7 +56,6 @@ defineOptions({ name: 'PurchaseMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
@ -178,32 +146,28 @@ const isShowMainButton = (row,val) => {
const butttondata = (row) => {
return [
defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListOrderPubBtn({hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListOrderOpeBtn({ hide: isShowMainButton(row, ['3']) }), //
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListOrderWitBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListEditBtn({ hasPermi: 'wms:purchase-main:update', hide: isShowMainButton(row, ['1']) }), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:purchase-main:delete',hide:isShowMainButton(row,['1'])}), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:purchase-main:delete', hide: isShowMainButton(row, ['1']) }), //
]
}
// -
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') { //
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'mainOrderClo') { //
handleClose(row.id)
} else if (val == 'mainOrderOpe') { //
handleOpen(row.id)
} else if (val == 'mainOrderPub') { //
handlePublish(row.id)
} else if (val == 'mainOrderWit') { //
handleWit(row.id)
}
}
@ -233,6 +197,58 @@ const handleDelete = async (id: number) => {
} catch { }
}
/** 关闭按钮操作 */
const handleClose = async (id : number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
//
await PurchaseMainApi.closePurchaseMain(id)
message.success(t('关闭成功!'))
//
await getList()
} catch { }
}
/** 打开按钮操作 */
const handleOpen = async (id : number) => {
try {
//
await message.confirm('是否打开所选中数据?')
//
await PurchaseMainApi.openPurchaseMain(id)
message.success(t('打开成功!'))
//
await getList()
} catch { }
}
/** 发布按钮操作 */
const handlePublish = async (id : number) => {
try {
//
await message.confirm('是否发布所选中数据?')
//
await PurchaseMainApi.publishPurchaseMain(id)
message.success(t('发布成功!'))
//
await getList()
} catch { }
}
/** 下架按钮操作 */
const handleWit = async (id : number) => {
try {
//
await message.confirm('是否下架所选中数据?')
//
await PurchaseMainApi.witPurchaseMain(id)
message.success(t('下架成功!'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
@ -242,7 +258,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await PurchaseMainApi.exportPurchaseMain(setSearchParams)
download.excel(data, '采购订单主.xlsx')
download.excel(data, '采购订单主.xls')
} catch {
} finally {
exportLoading.value = false

191
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -5,28 +5,16 @@
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PurchasePlanMain.allSchemas"
/>
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="PurchasePlanMain.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,40 +27,25 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="PurchasePlanMainRules"
:formAllSchemas="PurchasePlanMain.allSchemas"
:tableAllSchemas="PurchasePlanDetail.allSchemas"
:tableFormRules="PurchasePlanDetailRules"
:tableData="tableData"
:apiUpdate="PurchasePlanMainApi.updatePurchasePlanMain"
:apiCreate="PurchasePlanMainApi.createPurchasePlanMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<BasicForm ref="formRef" @success="getList" :rules="PurchasePlanMainRules"
:formAllSchemas="PurchasePlanMain.allSchemas" :tableAllSchemas="PurchasePlanDetail.allSchemas"
:tableFormRules="PurchasePlanDetailRules" :tableData="tableData"
:apiUpdate="PurchasePlanMainApi.updatePurchasePlanMain" :apiCreate="PurchasePlanMainApi.createPurchasePlanMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="PurchasePlanMain.allSchemas"
:detailAllSchemas="PurchasePlanDetail.allSchemas"
:detailAllSchemasRules="PurchasePlanDetailRules"
<Detail ref="detailRef" :isBasic="false" :allSchemas="PurchasePlanMain.allSchemas"
:detailAllSchemas="PurchasePlanDetail.allSchemas" :detailAllSchemasRules="PurchasePlanDetailRules"
:apiCreate="PurchasePlanDetailApi.createPurchasePlanDetail"
:apiUpdate="PurchasePlanDetailApi.updatePurchasePlanDetail"
:apiPage="PurchasePlanDetailApi.getPurchasePlanDetailPage"
:apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail"
/>
:apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail" :Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-plan-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/wms/purchase-plan-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
</template>
<script setup lang="ts">
@ -183,40 +156,35 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListPurchasePlanModBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_REJECTED'])}), //
defaultButtons.mainListPurchasePlanWitBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanRejBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanAccBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanPubBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), //
defaultButtons.mainListPurchasePlanCloBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), //
defaultButtons.mainListPurchasePlanOpeBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_CLOSED'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:delete'}), //
defaultButtons.mainListPurchasePlanWitBtn({ hide: isShowMainButton(row, ['3']) }), //
defaultButtons.mainListPurchasePlanRejBtn({ hide: isShowMainButton(row, ['3']) }), //
defaultButtons.mainListPurchasePlanAccBtn({ hide: isShowMainButton(row, ['3']) }), //
defaultButtons.mainListPurchasePlanPubBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPurchasePlanCloBtn({ hide: isShowMainButton(row, ['1']) }), //
defaultButtons.mainListPurchasePlanOpeBtn({ hide: isShowMainButton(row, ['2']) }), //
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchase-plan-main:update' }), //
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchase-plan-main:delete' }), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPurPlanOpe') { //
console.log('列表-操作按钮事件-打开')
} else if (val == 'mainPurPlanClo') { //
console.log('列表-操作按钮事件-关闭')
} else if (val == 'mainPurPlanPub') { //
console.log('列表-操作按钮事件-发布')
} else if (val == 'mainPurPlanAcc') { //
console.log('列表-操作按钮事件-接受')
} else if (val == 'mainPurPlanRej') { //
console.log('列表-操作按钮事件-不接受')
} else if (val == 'mainPurPlanWit') { //
console.log('列表-操作按钮事件-下架')
} else if (val == 'mainPurPlanMod') { //
console.log('列表-操作按钮事件-修改')
} else if (val == 'edit') { //
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'mainPurPlanClo') { //
handleClose(row.id)
} else if (val == 'mainPurPlanOpe') { //
handleOpen(row.id)
} else if (val == 'mainPurPlanPub') { //
handlePublish(row.id)
} else if (val == 'mainPurPlanWit') { //
handleWit(row.id)
} else if (val == 'mainPurPlanAcc') { //
handleAcc(row.id)
} else if (val == 'mainPurPlanRej') { //
handleWit(row.id)
}
}
@ -246,6 +214,85 @@ const handleDelete = async (id: number) => {
} catch { }
}
/** 关闭按钮操作 */
const handleClose = async (id : number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
//
await PurchasePlanMainApi.closePurchasePlanMain(id)
message.success(t('关闭成功!'))
//
await getList()
} catch { }
}
/** 打开按钮操作 */
const handleOpen = async (id : number) => {
try {
//
await message.confirm('是否打开所选中数据?')
//
await PurchasePlanMainApi.openPurchasePlanMain(id)
message.success(t('打开成功!'))
//
await getList()
} catch { }
}
/** 发布按钮操作 */
const handlePublish = async (id : number) => {
try {
//
await message.confirm('是否发布所选中数据?')
//
await PurchasePlanMainApi.publishPurchasePlanMain(id)
message.success(t('发布成功!'))
//
await getList()
} catch { }
}
/** 下架按钮操作 */
const handleWit = async (id : number) => {
try {
//
await message.confirm('是否下架所选中数据?')
//
await PurchasePlanMainApi.witPurchasePlanMain(id)
message.success(t('下架成功!'))
//
await getList()
} catch { }
}
/** 接受按钮操作 */
const handleAcc = async (id : number) => {
try {
//
await message.confirm('是否接受所选中数据?')
//
await PurchasePlanMainApi.accPurchasePlanMain(id)
message.success(t('接受成功!'))
//
await getList()
} catch { }
}
/** 驳回按钮操作 */
const handleRej = async (id : number) => {
try {
//
await message.confirm('是否驳回所选中数据?')
//
await PurchasePlanMainApi.rejPurchasePlanMain(id)
message.success(t('驳回成功!'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
@ -255,7 +302,7 @@ const handleExport = async () => {
//
exportLoading.value = true
const data = await PurchasePlanMainApi.exportPurchasePlanMain(setSearchParams)
download.excel(data, '要货计划主.xlsx')
download.excel(data, '要货计划主.xls')
} catch {
} finally {
exportLoading.value = false

34
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -98,7 +98,7 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
},
form: {
value: 'PLAN_PURCHASE_READY',
value: '1',
componentProps: {
disabled: true
}
@ -107,46 +107,18 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '开始时间',
field: 'beginTime',
isTable: true,
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',
}
width: 150
},
isForm: false,
},
{
label: '结束时间',
field: 'endTime',
isTable: true,
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',
}
width: 150
},
isForm: false,
},

Loading…
Cancel
Save