|
@@ -6,6 +6,8 @@ import {
|
|
Loading
|
|
Loading
|
|
} from "vant"
|
|
} from "vant"
|
|
|
|
|
|
|
|
+import { ElSelect, ElOption } from "element-plus"
|
|
|
|
+
|
|
import { requestSeeklist, requestSeekstatus, requestCompanyCategores, requestBusinessInfo, requestSupplierInfo } from "~/service/modules/home"
|
|
import { requestSeeklist, requestSeekstatus, requestCompanyCategores, requestBusinessInfo, requestSupplierInfo } from "~/service/modules/home"
|
|
import axios from "axios"
|
|
import axios from "axios"
|
|
|
|
|
|
@@ -15,6 +17,7 @@ const mapSpuCode = ref<string[]>([])
|
|
const selection = ref<Record<string, any>>([])
|
|
const selection = ref<Record<string, any>>([])
|
|
|
|
|
|
const state = reactive({
|
|
const state = reactive({
|
|
|
|
+ taxs: [],
|
|
skuOrName: '',
|
|
skuOrName: '',
|
|
isIndeterminate: false,
|
|
isIndeterminate: false,
|
|
isCheckAll: false,
|
|
isCheckAll: false,
|
|
@@ -139,40 +142,59 @@ async function handleSubmit(item = ({} as any)){
|
|
|
|
|
|
approvalVisible.value = true;
|
|
approvalVisible.value = true;
|
|
currentItem.value = item;
|
|
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;
|
|
const { in_info } = item;
|
|
if(in_info.merge_code){
|
|
if(in_info.merge_code){
|
|
const result = await requestCompanyCategores({ companyNo: item.companyNo, output_status: '1', cat_code: in_info.merge_code })
|
|
const result = await requestCompanyCategores({ companyNo: item.companyNo, output_status: '1', cat_code: in_info.merge_code })
|
|
if(result.code == 0){
|
|
if(result.code == 0){
|
|
if(result.data.list.length === 0){
|
|
if(result.data.list.length === 0){
|
|
|
|
+ state.approvalLoading = false
|
|
currentItem.value.isOk = false
|
|
currentItem.value.isOk = false
|
|
|
|
+ return
|
|
} else {
|
|
} else {
|
|
const { merge_code } = result.data.list[0]
|
|
const { merge_code } = result.data.list[0]
|
|
if(merge_code !== in_info.merge_code){
|
|
if(merge_code !== in_info.merge_code){
|
|
|
|
+ state.approvalLoading = false
|
|
currentItem.value.isOk = false
|
|
currentItem.value.isOk = false
|
|
|
|
+ return
|
|
} else {
|
|
} else {
|
|
currentItem.value.isOk = true
|
|
currentItem.value.isOk = true
|
|
|
|
+
|
|
|
|
+ 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
|
|
|
|
+ const item = result.data.list[0]
|
|
|
|
+ state.taxs = item.tax
|
|
|
|
+ if(state.taxs.length > 1 || state.taxs.length === 0){
|
|
|
|
+ currentItem.value.tax = ''
|
|
|
|
+ } else if(state.taxs.length === 1){
|
|
|
|
+ currentItem.value.tax = state.taxs[0]
|
|
|
|
+
|
|
|
|
+ console.log(state.taxs)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ currentItem.value.isLegalerOk = true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|
|
|
|
+ state.approvalLoading = false
|
|
currentItem.value.isOk = false
|
|
currentItem.value.isOk = false
|
|
|
|
+ return
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ state.approvalLoading = false
|
|
currentItem.value.isOk = false
|
|
currentItem.value.isOk = false
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
state.approvalLoading = false
|
|
state.approvalLoading = false
|
|
}catch(err){
|
|
}catch(err){
|
|
state.approvalLoading = false
|
|
state.approvalLoading = false
|
|
@@ -191,17 +213,29 @@ function handleClose(){
|
|
}
|
|
}
|
|
|
|
|
|
function handleOkStatus(){
|
|
function handleOkStatus(){
|
|
|
|
+ if(!currentItem.value.tax){
|
|
|
|
+ visible.value = true
|
|
|
|
+ showFailToast('请选择销项税目!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
showConfirmDialog({ title: '提示', message: '是否确认通过?' })
|
|
showConfirmDialog({ title: '提示', message: '是否确认通过?' })
|
|
.then(async () => {
|
|
.then(async () => {
|
|
showLoadingToast({ message: '审核中...', forbidClick: true })
|
|
showLoadingToast({ message: '审核中...', forbidClick: true })
|
|
- const { code } = await requestSeekstatus({
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ const parameter = {
|
|
"status": '1',
|
|
"status": '1',
|
|
- "out_tax": currentItem.value.tax + '%',
|
|
|
|
|
|
+ "out_tax": currentItem.value.tax,
|
|
"out_tax_id": currentItem.value.in_info.id,
|
|
"out_tax_id": currentItem.value.in_info.id,
|
|
"remark": '',
|
|
"remark": '',
|
|
"bidNo": currentItem.value.bidNo,
|
|
"bidNo": currentItem.value.bidNo,
|
|
"goodCombind": []
|
|
"goodCombind": []
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(parameter.out_tax.indexOf('%') === -1) parameter.out_tax += '%'
|
|
|
|
+
|
|
|
|
+ const { code } = await requestSeekstatus(parameter)
|
|
|
|
|
|
if(code == 0){
|
|
if(code == 0){
|
|
console.log('joined')
|
|
console.log('joined')
|
|
@@ -410,7 +444,7 @@ const isApproval = (item) => item.tax_status == '0'
|
|
<p>{{ currentItem.in_info.cat_name }}</p>
|
|
<p>{{ currentItem.in_info.cat_name }}</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="flex">
|
|
|
|
|
|
+ <div class="flex" v-if="currentItem.isLegalerOk">
|
|
<p class="w-[85px] text-right pr-[5px]">{{ currentItem.isOk && currentItem.isLegalerOk ? '进项税率:' : '预计进项税率:' }}</p>
|
|
<p class="w-[85px] text-right pr-[5px]">{{ currentItem.isOk && currentItem.isLegalerOk ? '进项税率:' : '预计进项税率:' }}</p>
|
|
<p>{{ currentItem.tax }}%</p>
|
|
<p>{{ currentItem.tax }}%</p>
|
|
</div>
|
|
</div>
|
|
@@ -420,15 +454,17 @@ const isApproval = (item) => item.tax_status == '0'
|
|
<p>{{ currentItem.cost_desc }}</p>
|
|
<p>{{ currentItem.cost_desc }}</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <p
|
|
|
|
- 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>
|
|
|
|
|
|
+ <p class="text-center w-full flex" v-if="!currentItem.isLegalerOk">
|
|
|
|
+ <p class="w-[125px] text-right pr-[5px]">销项税率:</p>
|
|
|
|
+
|
|
|
|
+ <ElSelect size="small" placeholder="请选择销项税率" v-model="currentItem.tax">
|
|
|
|
+ <ElOption
|
|
|
|
+ v-for="tax in state.taxs"
|
|
|
|
+ :value="tax"
|
|
|
|
+ :label="tax"
|
|
|
|
+ />
|
|
|
|
+ </ElSelect>
|
|
|
|
+ </p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@@ -443,7 +479,7 @@ const isApproval = (item) => item.tax_status == '0'
|
|
>驳回</Button>
|
|
>驳回</Button>
|
|
|
|
|
|
<Button
|
|
<Button
|
|
- v-if="currentItem.isOk && currentItem.isLegalerOk"
|
|
|
|
|
|
+ v-if="currentItem.isOk"
|
|
style="border-radius: 0px"
|
|
style="border-radius: 0px"
|
|
@click="handleOkStatus"
|
|
@click="handleOkStatus"
|
|
class="flex-1"
|
|
class="flex-1"
|