|
@@ -1,8 +1,12 @@
|
|
|
<script setup lang="ts">
|
|
|
import { reactive, onMounted, ref } from "vue"
|
|
|
|
|
|
-import { Tabs, Tab, List, Image, showLoadingToast, closeToast, Button, showImagePreview, showFailToast, Dialog, Search, Field, showSuccessToast } from "vant"
|
|
|
-import { requestSeeklist, requestSeekstatus, requestCompanyCategores } from "~/service/modules/home"
|
|
|
+import {
|
|
|
+ Tabs, Tab, List, Image, showLoadingToast, closeToast, Button, showImagePreview, showFailToast, Dialog, Search, Field, showSuccessToast, showConfirmDialog,
|
|
|
+ Loading
|
|
|
+} from "vant"
|
|
|
+
|
|
|
+import { requestSeeklist, requestSeekstatus, requestCompanyCategores, requestBusinessInfo, requestSupplierInfo } from "~/service/modules/home"
|
|
|
import axios from "axios"
|
|
|
|
|
|
const CancelToken = axios.CancelToken
|
|
@@ -15,7 +19,8 @@ const state = reactive({
|
|
|
isIndeterminate: false,
|
|
|
isCheckAll: false,
|
|
|
finished: false,
|
|
|
- loading: false,
|
|
|
+ loading: false,
|
|
|
+ approvalLoading: false,
|
|
|
isInit: true,
|
|
|
status: 0,
|
|
|
total: 0,
|
|
@@ -39,6 +44,7 @@ const tabList = [
|
|
|
|
|
|
let source:any = null;
|
|
|
async function onSearch(bidNo?: string, isReset?: boolean){
|
|
|
+ // if( state.finished) return
|
|
|
if(state.isInit || isReset){ showLoadingToast({ message: '加载中...', forbidClick: true }) }
|
|
|
|
|
|
if(!bidNo){ state.page += 1 }
|
|
@@ -57,8 +63,8 @@ async function onSearch(bidNo?: string, isReset?: boolean){
|
|
|
skuOrName: state.skuOrName,
|
|
|
info_status: ['2', '7'],
|
|
|
bidNo: bidNo || '',
|
|
|
- // platform_id: 76,
|
|
|
- // is_combind: 0
|
|
|
+ platform_id: 76,
|
|
|
+ is_combind: 0
|
|
|
},
|
|
|
source.token
|
|
|
)
|
|
@@ -66,7 +72,13 @@ async function onSearch(bidNo?: string, isReset?: boolean){
|
|
|
if(code == 0){
|
|
|
if(bidNo){
|
|
|
const sourceIndex = list.value.findIndex(item => item.bidNo === bidNo)
|
|
|
- list.value[sourceIndex] = data.list[0]
|
|
|
+
|
|
|
+ if(String(state.status) === ''){
|
|
|
+ list.value[sourceIndex] = data.list[0]
|
|
|
+ } else {
|
|
|
+ list.value.splice(sourceIndex, 1)
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
list.value = [...list.value, ...data.list]
|
|
|
state.finished = data.list.length < 10;
|
|
@@ -118,22 +130,52 @@ async function handleNoStatus(){
|
|
|
}
|
|
|
|
|
|
async function handleSubmit(item = ({} as any)){
|
|
|
- approvalVisible.value = true;
|
|
|
- currentItem.value = item;
|
|
|
+ // showLoadingToast({ message: '加载中...', forbidClick: true })
|
|
|
+ try{
|
|
|
+ state.approvalLoading = true
|
|
|
+
|
|
|
+ currentItem.value.isOk = true
|
|
|
+ currentItem.value.isLegalerOk = true
|
|
|
|
|
|
- const { in_info } = item;
|
|
|
- if(in_info.merge_code){
|
|
|
+ approvalVisible.value = true;
|
|
|
+ currentItem.value = item;
|
|
|
+
|
|
|
+ const company = await requestBusinessInfo({ companyNo: item.companyNo })
|
|
|
+ const supplier = await requestSupplierInfo({ code: item.supplierNo })
|
|
|
+
|
|
|
+ if((company.data || {}).legaler_type != (supplier.data || {}).legaler_type){
|
|
|
+ currentItem.value.isLegalerOk = false
|
|
|
+ currentItem.value.isOk = true
|
|
|
+ state.approvalLoading = false
|
|
|
+ return
|
|
|
+ }else {
|
|
|
+ currentItem.value.isLegalerOk = true
|
|
|
+ }
|
|
|
+
|
|
|
+ const { in_info } = item;
|
|
|
+ if(in_info.merge_code){
|
|
|
const result = await requestCompanyCategores({ companyNo: item.companyNo, output_status: '1', cat_code: in_info.merge_code })
|
|
|
- if(result.data.code == 0){
|
|
|
- if(result.data.length === 0){
|
|
|
+ if(result.code == 0){
|
|
|
+ if(result.data.list.length === 0){
|
|
|
currentItem.value.isOk = false
|
|
|
} else {
|
|
|
+ const { merge_code } = result.data.list[0]
|
|
|
+ if(merge_code !== in_info.merge_code){
|
|
|
+ currentItem.value.isOk = false
|
|
|
+ } else {
|
|
|
+ currentItem.value.isOk = true
|
|
|
+ }
|
|
|
}
|
|
|
}else {
|
|
|
currentItem.value.isOk = false
|
|
|
}
|
|
|
- } else {
|
|
|
- console.log('TODO..')
|
|
|
+ } else {
|
|
|
+ currentItem.value.isOk = false
|
|
|
+ }
|
|
|
+
|
|
|
+ state.approvalLoading = false
|
|
|
+ }catch(err){
|
|
|
+ state.approvalLoading = false
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -143,9 +185,35 @@ function handleApprovalResult(){
|
|
|
remark.value = ''
|
|
|
}
|
|
|
|
|
|
-const isApproval = (item) => item.tax_status == '0'
|
|
|
+function handleClose(){
|
|
|
+ currentItem.value.isOk = true
|
|
|
+ currentItem.value.isLegalerOk = true
|
|
|
+}
|
|
|
+
|
|
|
+function handleOkStatus(){
|
|
|
+ showConfirmDialog({ title: '提示', message: '是否确认通过?' })
|
|
|
+ .then(async () => {
|
|
|
+ showLoadingToast({ message: '审核中...', forbidClick: true })
|
|
|
+ const { code } = await requestSeekstatus({
|
|
|
+ "status": '1',
|
|
|
+ "out_tax": currentItem.value.tax + '%',
|
|
|
+ "out_tax_id": currentItem.value.in_info.id,
|
|
|
+ "remark": '',
|
|
|
+ "bidNo": currentItem.value.bidNo,
|
|
|
+ "goodCombind": []
|
|
|
+ })
|
|
|
+
|
|
|
+ if(code == 0){
|
|
|
+ console.log('joined')
|
|
|
+ showSuccessToast('审核成功')
|
|
|
+ approvalVisible.value = false
|
|
|
+ visible.value = false
|
|
|
+ onSearch(currentItem.value.bidNo)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
-onMounted(onSearch)
|
|
|
+const isApproval = (item) => item.tax_status == '0'
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -162,6 +230,7 @@ onMounted(onSearch)
|
|
|
class="flex-1"
|
|
|
v-model="state.skuOrName"
|
|
|
placeholder="SKU编号/商品名称"
|
|
|
+ @clear="onSearch('', true)"
|
|
|
/>
|
|
|
|
|
|
<Button
|
|
@@ -206,18 +275,39 @@ onMounted(onSearch)
|
|
|
<p>{{ item.spuCode }}</p>
|
|
|
</div>
|
|
|
|
|
|
- <div class="flex">
|
|
|
- <p class="w-[65px] text-right pr-[5px]">类目编码:</p>
|
|
|
- <p>{{ item.in_info.merge_code }}</p>
|
|
|
- </div>
|
|
|
+ <template v-if="item.tax_status != 1">
|
|
|
+ <div class="flex">
|
|
|
+ <p class="w-[65px] text-right pr-[5px]">类目编码:</p>
|
|
|
+ <p>{{ item.in_info.merge_code }}</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex">
|
|
|
+ <p class="w-[65px] text-right pr-[5px]">类目名称:</p>
|
|
|
+ <p>{{ item.in_info.cat_name }}</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <div class="flex">
|
|
|
+ <p class="w-[65px] text-right pr-[5px]">类目编码:</p>
|
|
|
+ <p>{{ item.out_info.merge_code }}</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex">
|
|
|
+ <p class="w-[65px] text-right pr-[5px]">类目名称:</p>
|
|
|
+ <p>{{ item.out_info.cat_name }}</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex">
|
|
|
+ <p class="w-[65px] text-right pr-[5px]">销项税率:</p>
|
|
|
+ <p>{{ item.out_tax }}%</p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
|
|
|
- <div class="flex">
|
|
|
- <p class="w-[65px] text-right pr-[5px]">类目名称:</p>
|
|
|
- <p>{{ item.in_info.cat_name }}</p>
|
|
|
- </div>
|
|
|
|
|
|
<div class="flex">
|
|
|
- <p class="w-[65px] text-right pr-[5px]">工艺材质:</p>
|
|
|
+ <p class="w-[65px] text-right pr-[5px]">工艺材质:</p>
|
|
|
<p>{{ item.cost_desc }}</p>
|
|
|
</div>
|
|
|
|
|
@@ -249,7 +339,7 @@ onMounted(onSearch)
|
|
|
</div>
|
|
|
</List>
|
|
|
|
|
|
- <Dialog v-model:show="visible" title="驳回原因">
|
|
|
+ <Dialog v-model:show="visible" title="驳回原因" @close="remark = ''">
|
|
|
<Field
|
|
|
v-model="remark"
|
|
|
placeholder="驳回原因"
|
|
@@ -259,8 +349,19 @@ onMounted(onSearch)
|
|
|
|
|
|
<template #footer>
|
|
|
<div class="flex">
|
|
|
- <Button class="flex-1" @click="visible = false; remark = ''">取消</Button>
|
|
|
- <Button class="flex-1" type="warning" @click="handleNoStatus">保存</Button>
|
|
|
+ <Button
|
|
|
+ class="flex-1"
|
|
|
+ @click="visible = false; remark = ''"
|
|
|
+ style="border-radius: 0px"
|
|
|
+ >取消</Button>
|
|
|
+
|
|
|
+
|
|
|
+ <Button
|
|
|
+ class="flex-1"
|
|
|
+ type="warning"
|
|
|
+ @click="handleNoStatus"
|
|
|
+ style="border-radius: 0px"
|
|
|
+ >提交</Button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</Dialog>
|
|
@@ -269,8 +370,15 @@ onMounted(onSearch)
|
|
|
v-model:show="approvalVisible"
|
|
|
title="提交审核结果"
|
|
|
:closeOnClickOverlay="true"
|
|
|
+ @close="handleClose"
|
|
|
>
|
|
|
- <div class="flex flex-col ml-[10px] p-[10px]" style="line-height:22px">
|
|
|
+
|
|
|
+
|
|
|
+ <div class="w-full flex justify-center my-[10px]" v-if="state.approvalLoading">
|
|
|
+ <Loading size="24px" color="#ed6a0c" vertical>加载中...</Loading>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-else class="flex flex-col ml-[10px] p-[10px]" style="line-height:22px">
|
|
|
<div class="color-[#0f0f0f] flex items-start">
|
|
|
<Image
|
|
|
style="height:28px;width:28px;min-height:28px;min-width:28px;margin-right: 10px;border-radius:2px;border:1px solid #dcdfe6;overflow:hidden"
|
|
@@ -293,15 +401,20 @@ onMounted(onSearch)
|
|
|
</div>
|
|
|
|
|
|
<div class="flex">
|
|
|
- <p class="w-[85px] text-right pr-[5px]">{{ currentItem.isOk ? '类目编码:' : '预计类目编码:' }}</p>
|
|
|
+ <p class="w-[85px] text-right pr-[5px]">{{ currentItem.isOk && currentItem.isLegalerOk ? '类目编码:' : '预计类目编码:' }}</p>
|
|
|
<p>{{ currentItem.in_info.merge_code }}</p>
|
|
|
</div>
|
|
|
|
|
|
<div class="flex">
|
|
|
- <p class="w-[85px] text-right pr-[5px]">{{ currentItem.isOk ? '类目名称:' : '预计类目名称:' }}</p>
|
|
|
+ <p class="w-[85px] text-right pr-[5px]">{{ currentItem.isOk && currentItem.isLegalerOk ? '类目名称:' : '预计类目名称:' }}</p>
|
|
|
<p>{{ currentItem.in_info.cat_name }}</p>
|
|
|
</div>
|
|
|
|
|
|
+ <div class="flex">
|
|
|
+ <p class="w-[85px] text-right pr-[5px]">{{ currentItem.isOk && currentItem.isLegalerOk ? '进项税率:' : '预计进项税率:' }}</p>
|
|
|
+ <p>{{ currentItem.tax }}%</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="flex">
|
|
|
<p class="w-[85px] text-right pr-[5px]">工艺材质:</p>
|
|
|
<p>{{ currentItem.cost_desc }}</p>
|
|
@@ -311,19 +424,28 @@ onMounted(onSearch)
|
|
|
class="text-center w-full my-[10px] color-red"
|
|
|
v-if="!currentItem.isOk"
|
|
|
>当前业务公司销项没有该类目,请驳回</p>
|
|
|
+
|
|
|
+ <p
|
|
|
+ class="text-center w-full my-[10px] color-red"
|
|
|
+ v-if="!currentItem.isLegalerOk"
|
|
|
+ >供应商资质不一致,请驳回</p>
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
<template #footer>
|
|
|
- <div class="flex">
|
|
|
+ <div class="flex" v-if="!state.approvalLoading">
|
|
|
<Button
|
|
|
class="flex-1"
|
|
|
@click="handleApprovalResult"
|
|
|
+ style="border-radius: 0px"
|
|
|
>驳回</Button>
|
|
|
|
|
|
<Button
|
|
|
- v-if="currentItem.isOk"
|
|
|
- @click="handleNoStatus"
|
|
|
+ v-if="currentItem.isOk && currentItem.isLegalerOk"
|
|
|
+ style="border-radius: 0px"
|
|
|
+ @click="handleOkStatus"
|
|
|
class="flex-1"
|
|
|
type="warning"
|
|
|
>通过</Button>
|