From a624b37159a26c8729f58ce57d114f3d8a2f4664 Mon Sep 17 00:00:00 2001
From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com>
Date: Thu, 6 Jun 2024 16:07:28 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91=E7=A5=A8?=
=?UTF-8?q?=E7=94=B3=E8=AF=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wms/supplierinvoiceRecordMain/index.ts | 4 +-
.../wms/supplierinvoiceRequestMain/index.ts | 16 +--
src/components/Detail/src/Detail.vue | 8 +-
.../supplierinvoiceRecordMain/index.vue | 52 +++++++-
.../supplierinvoiceRequestMain/index.vue | 113 +++++++++++++++---
.../supplierinvoiceRequestMain.data.ts | 36 +++++-
6 files changed, 196 insertions(+), 33 deletions(-)
diff --git a/src/api/wms/supplierinvoiceRecordMain/index.ts b/src/api/wms/supplierinvoiceRecordMain/index.ts
index 4f04bdeb2..9ffde26ba 100644
--- a/src/api/wms/supplierinvoiceRecordMain/index.ts
+++ b/src/api/wms/supplierinvoiceRecordMain/index.ts
@@ -53,8 +53,8 @@ export const deleteSupplierinvoiceRecordMain = async (id: number) => {
}
// 导出供应商发票记录主 Excel
-export const exportSupplierinvoiceRecordMain = async (params) => {
- return await request.download({ url: `/wms/supplierinvoice-record-main/export-excel`, params })
+export const exportSupplierinvoiceRecordMain = async (data) => {
+ return await request.downloadPost({ url: `/wms/supplierinvoice-record-main/export-excel`, data })
}
// 下载用户导入模板
diff --git a/src/api/wms/supplierinvoiceRequestMain/index.ts b/src/api/wms/supplierinvoiceRequestMain/index.ts
index 49298715f..9dd8e60e8 100644
--- a/src/api/wms/supplierinvoiceRequestMain/index.ts
+++ b/src/api/wms/supplierinvoiceRequestMain/index.ts
@@ -79,8 +79,8 @@ export const appSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/app?id=` + id })
}
// 采购--驳回供应商发货申请主
-export const rejSupplierinvoiceRequestMain = async (id: number) => {
- return await request.post({ url: `/wms/supplierinvoice-request-main/rej?id=` + id })
+export const rejSupplierinvoiceRequestMain = async (data) => {
+ return await request.post({ url: `/wms/supplierinvoice-request-main/rej`,data })
}
// 供应商--发票寄出
@@ -93,8 +93,8 @@ export const financeappSupplierinvoiceRequestMain = async (id: number) => {
return await request.post({ url: `/wms/supplierinvoice-request-main/financeApp?id=` + id })
}
// 财务--驳回供应商发货申请主
-export const financerejSupplierinvoiceRequestMain = async (id: number) => {
- return await request.post({ url: `/wms/supplierinvoice-request-main/financeRej?id=` + id })
+export const financerejSupplierinvoiceRequestMain = async (data) => {
+ return await request.post({ url: `/wms/supplierinvoice-request-main/financeRej`, data })
}
// 作废--供应商发货申请主
@@ -118,11 +118,11 @@ export const printSupplierRecordByMasterId = async (masterId:number) => {
}
// 导出供应商发票申请主 Excel
-export const exportSupplierinvoiceRequestMain = async (params) => {
- if(params.isSearch){
- return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel-senior`, params })
+export const exportSupplierinvoiceRequestMain = async (data) => {
+ if(data.isSearch){
+ return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel-senior`, data })
}else {
- return await request.download({ url: `/wms/supplierinvoice-request-main/export-excel`, params })
+ return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel`, data })
}
}
diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue
index af528c603..77ba581a2 100644
--- a/src/components/Detail/src/Detail.vue
+++ b/src/components/Detail/src/Detail.vue
@@ -72,8 +72,12 @@
v-model:currentPage="tableObjectRef.currentPage"
v-model:sort="tableObjectRef.sort"
>
-
- {{ item }}
+
+ {{ item }}
+
+
+
+
-
+
@@ -17,7 +17,9 @@
-
{{ row.number }}
+
+ {{ row.differencePrice }}
+
@@ -94,7 +100,11 @@
:detailAllSchemas="SupplierinvoiceRecordDetail.allSchemas"
:detailAllSchemasRules="SupplierinvoiceRecordDetailRules"
:apiPage="SupplierinvoiceRecordDetailApi.getSupplierinvoiceRecordDeatilPage"
- />
+ >
+
+ {{ row.differencePrice }}
+
+
+
\ No newline at end of file
diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
index 190f3d517..025c41c68 100644
--- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
+++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -18,15 +18,22 @@
-
+ v-model:sort="tableObject.sort"
+ @getSelectionRows="getSelectionRows"
+ >
{{ row.number }}
+
+ {{ row.differencePrice }}
+
@@ -146,7 +153,11 @@
:detailButtonIsShowAdd="false"
@buttonBaseClick="detailButtonBaseClick"
@tableFormButton="tableFormButton"
- />
+ >
+
+ {{ row.differencePrice }}
+
+
{
+ selectionRows.value = []
+ setSearchParams(model)
+}
+const selectionRows = ref([])
+const tableRef = ref()
+const getSelectionRows = (currentPage,currentPageSelectionRows) => {
+ console.log("getSelectionRows",currentPage,currentPageSelectionRows)
+ const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage)
+ if(currentRows){
+ currentRows.selectionRows = currentPageSelectionRows
+ }else{
+ selectionRows.value.push({
+ currentPage,
+ selectionRows:currentPageSelectionRows
+ })
+ }
+}
// 查询页面返回
const searchTableSuccess = (formField, searchField, val, searchFormRef, type, row) => {
@@ -386,13 +417,15 @@ const handleImport = () => {
} else if (val == 'purchase_mainPlanSub') { // 采购审批通过
handleApp(row.masterId)
} else if (val == 'purchase_mainPlanTur') { // 采购驳回按钮
- handleTur(row.masterId)
+ resonSubmit(val, row)
+ // handleTur(row.masterId)
} else if (val == 'invoice_sent_out') { // 发票寄出确认
handleInvoiceSentOut(row.masterId)
} else if(val == 'finance_mainPlanSub'){ // 财务审批通过
handleFinanceApp(row.masterId)
} else if(val == 'finance_mainPlanTur'){ //财务审批拒绝
- handleFinaceTur(row.masterId)
+ resonSubmit(val, row)
+ // handleFinaceTur(row.masterId)
} else if (val == 'genRecords') { // 处理
genRecords(row.masterId)
} else if (val == 'edit') { // 编辑
@@ -559,13 +592,16 @@ const handleImport = () => {
}
/** 驳回按钮操作 */
- const handleTur = async (id : number) => {
+ const handleTur = async (id : number,cause:string) => {
try {
// 驳回的二次确认
- await message.confirm(t('ts.是否驳回所选中数据?'))
+ // await message.confirm(t('ts.是否驳回所选中数据?'))
tableObject.loading = true
// 发起驳回
- await SupplierinvoiceRequestMainApi.rejSupplierinvoiceRequestMain(id)
+ await SupplierinvoiceRequestMainApi.rejSupplierinvoiceRequestMain({
+ id,
+ cause
+ })
message.success(t('ts.驳回成功!'))
tableObject.loading = false
// 刷新列表
@@ -592,14 +628,44 @@ const handleImport = () => {
}
}
+ const resonSubmit = async (val, row)=>{
+
+ ElMessageBox.prompt(t('ts.请输入驳回原因'), t('ts.提示'), {
+ confirmButtonText: t('common.ok'),
+ cancelButtonText: t('common.cancel'),
+ inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
+ inputErrorMessage: t(`ts.${'驳回原因不能为空,且不超过60字'}`),
+ inputType:'textarea',
+ inputValidator:(value)=>{
+ if(value.length>60||value.length==0){
+ return false
+ }else{
+ return true
+ }
+ }
+ }).then(({ value }) => {
+ // 驳回原因
+ if (val == 'purchase_mainPlanTur') { // 采购驳回按钮
+ handleTur(row.masterId,value)
+ }else if(val == 'finance_mainPlanTur'){ //财务审批拒绝
+ handleFinaceTur(row.masterId,value)
+ }
+ })
+ .catch(() => {
+ })
+ }
+
/** 驳回按钮操作 */
- const handleFinaceTur = async (id : number) => {
+ const handleFinaceTur = async (id : number,cause:string) => {
try {
// 驳回的二次确认
- await message.confirm(t('ts.是否驳回所选中数据?'))
+ // await message.confirm(t('ts.是否驳回所选中数据?'))
tableObject.loading = true
// 发起驳回
- await SupplierinvoiceRequestMainApi.financerejSupplierinvoiceRequestMain(id)
+ await SupplierinvoiceRequestMainApi.financerejSupplierinvoiceRequestMain({
+ id,
+ cause
+ })
message.success(t('ts.驳回成功!'))
tableObject.loading = false
// 刷新列表
@@ -629,12 +695,28 @@ const handleImport = () => {
/** 导出按钮操作 */
const exportLoading = ref(false) // 导出的加载中
const handleExport = async () => {
+ let rows:any = []
+ selectionRows.value.forEach(item=>{
+ rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
+ })
+
+ let paramsData =JSON.parse(JSON.stringify(tableObject.params))
+ if(tableObject.params&&tableObject.params.isSearch==true){
+ paramsData.filters.push({
+ action: "in",
+ column: "number",
+ value: rows.join(",")
+ })
+ }else{
+ paramsData = {...paramsData,checkNums:rows}
+ }
+ console.log('批量导出',paramsData)
try {
// 导出的二次确认
await message.exportConfirm()
// 发起导出
exportLoading.value = true
- const data = await SupplierinvoiceRequestMainApi.exportSupplierinvoiceRequestMain(tableObject.params)
+ const data = await SupplierinvoiceRequestMainApi.exportSupplierinvoiceRequestMain(paramsData)
download.excel(data, `${t('ts.供应商发票申请主')}.xlsx`)
} catch {
} finally {
@@ -802,6 +884,9 @@ const importSuccess = () => {
border-radius:var(--el-border-radius-base);
border:1px solid var(--el-color-danger);
box-shadow: 0 0 0 1px var(--el-color-danger) inset;
-
+}
+.red-text{
+ color:var(--el-color-danger);
+ font-weight:700;
}
diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
index eb15f29d3..642c6ac15 100644
--- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
+++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
@@ -580,6 +580,28 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive(
},
isForm: false,
},
+ {
+ label: '采购驳回原因',
+ field: 'purchaseRejectCause',
+ table: {
+ width: 180
+ },
+ isTable: true,
+ isSearch: false,
+ isForm: false,
+ isDetail:false,
+ },
+ {
+ label: '财务驳回原因',
+ field: 'financeRejectCause',
+ table: {
+ width: 180
+ },
+ isTable: true,
+ isSearch: false,
+ isForm: false,
+ isDetail:false,
+ },
{
label: '财务审批时间',
field: 'financialCreateTime',
@@ -1165,8 +1187,18 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive {
+ if (Number(value)>0) {
+ callback();
+ } else {
+ callback(new Error('请输入合同价格'));
+ }
+}
//表单校验
export const SupplierinvoiceRequestDetailRules = reactive({
-
+ singlePrice: [
+ { required: true, message: '请输入合同价格', trigger: 'change' },
+ { validator: validateSinglePrice, trigger: 'change' }
+ ],
})