snow преди 5 месеца
родител
ревизия
2de33f0446

+ 0 - 1
dist/assets/_plugin-vue_export-helper-DlAUqK2U.js

@@ -1 +0,0 @@
-const s=(t,r)=>{const o=t.__vccOpts||t;for(const[c,e]of r)o[c]=e;return o};export{s as _};

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/assets/baseUrl-CEnR8jFP.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/assets/cost-detail-GJzf_lNW.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/assets/index-B-YkmKcw.js


+ 0 - 1
dist/assets/index-BRd2ZnA2.js

@@ -1 +0,0 @@
-import{_ as e}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{c,o}from"./index-QfepO29L.js";const r={};function t(n,s){return o(),c("div",null,"Test")}const f=e(r,[["render",t]]);export{f as default};

+ 1 - 0
dist/assets/index-BRiF7qcI.js

@@ -0,0 +1 @@
+import{U as S,V as g,W as M,r as v,X as O,Y as R,Z as T,u as W,_ as y,$ as w,a0 as b,z as _}from"./index-oRjfHbF4.js";function k(e){return R()?(T(e),!0):!1}function m(e){return typeof e=="function"?e():W(e)}const h=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const C=e=>e!=null,U=()=>{};function B(e){return e||y()}function D(...e){if(e.length!==1)return S(...e);const t=e[0];return typeof t=="function"?g(M(()=>({get:t,set:U}))):v(t)}function $(e,t){B(t)&&O(e,t)}function z(e){var t;const i=m(e);return(t=i==null?void 0:i.$el)!=null?t:i}const A=h?window:void 0,E=h?window.document:void 0;function G(){const e=v(!1),t=y();return t&&_(()=>{e.value=!0},t),e}function L(e){const t=G();return b(()=>(t.value,!!e()))}function V(e,t,i={}){const{window:s=A,...c}=i;let n;const l=L(()=>s&&"MutationObserver"in s),a=()=>{n&&(n.disconnect(),n=void 0)},r=b(()=>{const u=m(e),p=(Array.isArray(u)?u:[u]).map(z).filter(C);return new Set(p)}),d=w(()=>r.value,u=>{a(),l.value&&s&&u.size&&(n=new MutationObserver(t),u.forEach(p=>n.observe(p,c)))},{immediate:!0,flush:"post"}),f=()=>n==null?void 0:n.takeRecords(),o=()=>{a(),d()};return k(o),{isSupported:l,stop:o,takeRecords:f}}function x(e=null,t={}){var i,s,c;const{document:n=E,restoreOnUnmount:l=o=>o}=t,a=(i=n==null?void 0:n.title)!=null?i:"",r=D((s=e??(n==null?void 0:n.title))!=null?s:null),d=e&&typeof e=="function";function f(o){if(!("titleTemplate"in t))return o;const u=t.titleTemplate||"%s";return typeof u=="function"?u(o):m(u).replace(/%s/g,o)}return w(r,(o,u)=>{o!==u&&n&&(n.title=f(typeof o=="string"?o:""))},{immediate:!0}),t.observe&&!t.titleTemplate&&n&&!d&&V((c=n.head)==null?void 0:c.querySelector("title"),()=>{n&&n.title!==r.value&&(r.value=f(n.title))},{childList:!0}),$(()=>{if(l){const o=l(a,r.value||"");o!=null&&n&&(n.title=o)}}),r}export{x as u};

+ 1 - 0
dist/assets/index-Ckpf801C.js

@@ -0,0 +1 @@
+import{H as l,J as i,K as c,M as p,b as m,O as d,P as f}from"./index-oRjfHbF4.js";import{s as t,o,n as a}from"./baseUrl-CEnR8jFP.js";let r;const C={title:"",width:"",theme:null,message:"",overlay:!0,callback:null,teleport:"body",className:"",allowHtml:!1,lockScroll:!0,transition:void 0,beforeClose:null,overlayClass:"",overlayStyle:void 0,messageAlign:"",cancelButtonText:"",cancelButtonColor:null,cancelButtonDisabled:!1,confirmButtonText:"",confirmButtonColor:null,confirmButtonDisabled:!1,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!0,closeOnClickOverlay:!1};let g=l({},C);function B(){({instance:r}=c({setup(){const{state:s,toggle:n}=p();return()=>m(f,d(s,{"onUpdate:show":n}),null)}}))}function b(e){return i?new Promise((s,n)=>{r||B(),r.open(l({},g,e,{callback:u=>{(u==="confirm"?s:n)(u)}}))}):Promise.resolve(void 0)}const y=e=>b(l({showCancelButton:!0},e)),q=(e,s)=>t.post({url:o+"/admin/consultbidlist",data:e,cancelToken:s}),v=e=>t.post({url:o+"/admin/consultfeadinfo",data:e}),k=e=>t.post({url:o+"/admin/bidscheck",data:e}),S=(e,s)=>t.post({url:a+"/admin/good/list",data:e,cancelToken:s}),O=e=>t.post({url:o+"/admin/goodupinfo",data:e}),P=e=>t.post({url:o+"/admin/goodexam",data:e}),x=e=>t.post({url:a+"user/TaxCategory/listByCompany",data:e}),D=e=>t.post({url:a+"user/supplier/info",data:e}),T=e=>t.post({url:o+"admin/businesssinfo",data:e});export{k as a,T as b,D as c,x as d,S as e,v as f,O as g,P as h,q as r,y as s};

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/assets/index-CnNQATmS.js


+ 1 - 0
dist/assets/index-DLjZDpX2.js

@@ -0,0 +1 @@
+import{s as c,o as f}from"./baseUrl-CEnR8jFP.js";import{d as g,a as _,c as h,b as e,u as a,N as w,w as o,Q as V,A as b,m as k,R as x,n as d,o as y,C,E as u,j as i,B as v,h as B}from"./index-oRjfHbF4.js";import{u as T}from"./index-BRiF7qcI.js";const N=n=>c.post({url:f+"/admin/login",data:n}),A={class:"w-full h-full"},L=g({__name:"index",setup(n){const m=b(),t=_({username:"",password:""});async function p(){try{k({message:"登录中...",forbidClick:!0});const{code:l,data:s}=await N(t);l==0&&(x(s.token),m.push("/home")),d()}catch(l){console.log(l),d()}}return T("登录"),(l,s)=>(y(),h("div",A,[e(a(w),{title:"登录"}),e(a(V),{onSubmit:p},{default:o(()=>[e(a(C),null,{default:o(()=>[e(a(u),null,{default:o(()=>[e(a(i),{modelValue:t.username,"onUpdate:modelValue":s[0]||(s[0]=r=>t.username=r),label:"用户名",placeholder:"请输入用户名",rules:[{required:!0,message:"请填写用户名",trigger:"change"}]},null,8,["modelValue"])]),_:1}),e(a(u),null,{default:o(()=>[e(a(i),{modelValue:t.password,"onUpdate:modelValue":s[1]||(s[1]=r=>t.password=r),label:"密码",placeholder:"请输入密码",type:"password",rules:[{required:!0,message:"请填写用户名",trigger:"change"}]},null,8,["modelValue"])]),_:1}),e(a(u),{class:"mt-[16px]"},{default:o(()=>[e(a(v),{block:"",type:"primary","native-type":"submit"},{default:o(()=>[B("登录")]),_:1})]),_:1})]),_:1})]),_:1})]))}});export{L as default};

+ 0 - 1
dist/assets/index-DV7ktpDb.css

@@ -1 +0,0 @@
-.scrollbar[data-v-59688cb1]::-webkit-scrollbar{width:20px;height:20px}.scrollbar[data-v-59688cb1]::-webkit-scrollbar-track{border-radius:100vh;background:#f7f4ed}.scrollbar[data-v-59688cb1]::-webkit-scrollbar-thumb{background:#e0cbcb;border-radius:100vh;border:3px solid #f6f7ed}.scrollbar[data-v-59688cb1]::-webkit-scrollbar-thumb:hover{background:#c0a0b9}[data-v-59688cb1]::view-transition-old(root),[data-v-59688cb1]::view-transition-new(root){animation:none;mix-blend-mode:normal}[data-v-59688cb1]::view-transition-old(root){z-index:999}[data-v-59688cb1]::view-transition-new(root){z-index:1}

Файловите разлики са ограничени, защото са твърде много
+ 0 - 10
dist/assets/index-QfepO29L.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/assets/index-ccu0q1l3.css


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/assets/index-eCK407UH.css


Файловите разлики са ограничени, защото са твърде много
+ 10 - 0
dist/assets/index-oRjfHbF4.js


Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/assets/seek-detail-CJP6glOW.js


BIN
dist/favicon.ico


+ 4 - 4
dist/index.html

@@ -2,12 +2,12 @@
 <html lang="en">
   <head>
     <meta charset="UTF-8" />
-    <link rel="icon" href="/favicon.ico" />
+    <link rel="icon" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>Vite App</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
     <meta name="description" content="Vite Starter Template By Kirk Lin" />
-    <script type="module" crossorigin src="/assets/index-QfepO29L.js"></script>
-    <link rel="stylesheet" crossorigin href="/assets/index-ccu0q1l3.css">
+    <script type="module" crossorigin src="/assets/index-oRjfHbF4.js"></script>
+    <link rel="stylesheet" crossorigin href="/assets/index-eCK407UH.css">
   <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
   <body>
     <div id="app">

+ 1 - 1
dist/sw.js

@@ -1 +1 @@
-if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,r)=>{const l=e||("document"in self?document.currentScript.src:"")||location.href;if(s[l])return;let t={};const o=e=>i(e,l),c={module:{uri:l},exports:t,require:o};s[l]=Promise.all(n.map((e=>c[e]||o(e)))).then((e=>(r(...e),t)))}}define(["./workbox-aca2a06f"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/_plugin-vue_export-helper-DlAUqK2U.js",revision:null},{url:"assets/index-B-YkmKcw.js",revision:null},{url:"assets/index-BRd2ZnA2.js",revision:null},{url:"assets/index-ccu0q1l3.css",revision:null},{url:"assets/index-DV7ktpDb.css",revision:null},{url:"assets/index-QfepO29L.js",revision:null},{url:"index.html",revision:"a1ff21297616026feb7876b01cd6e144"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"favicon.ico",revision:"b8a7a99922ad65e467f4d4c72edf5ec1"},{url:"pwa-192x192.png",revision:"f388f89cd644482d0cc1609469ca8f74"},{url:"pwa-512x512.png",revision:"7afda480bbadb46f3b0abc6cb0b47b78"},{url:"manifest.webmanifest",revision:"a0cb89bdb09cbab9b830ee23eab86720"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));
+if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,r)=>{const l=e||("document"in self?document.currentScript.src:"")||location.href;if(s[l])return;let t={};const o=e=>i(e,l),d={module:{uri:l},exports:t,require:o};s[l]=Promise.all(n.map((e=>d[e]||o(e)))).then((e=>(r(...e),t)))}}define(["./workbox-aca2a06f"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/baseUrl-CEnR8jFP.js",revision:null},{url:"assets/cost-detail-GJzf_lNW.js",revision:null},{url:"assets/index-BRiF7qcI.js",revision:null},{url:"assets/index-Ckpf801C.js",revision:null},{url:"assets/index-CnNQATmS.js",revision:null},{url:"assets/index-DLjZDpX2.js",revision:null},{url:"assets/index-eCK407UH.css",revision:null},{url:"assets/index-oRjfHbF4.js",revision:null},{url:"assets/seek-detail-CJP6glOW.js",revision:null},{url:"index.html",revision:"0e924e816dd99483e839be48d14fc7e6"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"favicon.ico",revision:"67d34b0decfd4d725d1c1f2eeadc4756"},{url:"pwa-192x192.png",revision:"f388f89cd644482d0cc1609469ca8f74"},{url:"pwa-512x512.png",revision:"7afda480bbadb46f3b0abc6cb0b47b78"},{url:"manifest.webmanifest",revision:"a0cb89bdb09cbab9b830ee23eab86720"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8" />
     <link rel="icon" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title></title>
+    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
     <meta name="description" content="Vite Starter Template By Kirk Lin" />
   </head>
   <body>

+ 154 - 44
src/pages/home/components/cost-product.vue

@@ -1,58 +1,98 @@
 <script setup lang="ts">
 import { reactive, onMounted, ref } from "vue"
-import { Tabs, Tab, List, Tag, Image, showLoadingToast, closeToast } from "vant"
-import { requestCostlist } from "~/service/modules/home"
-import { useRouter } from "vue-router"
-import axios from "axios"
 
+import { Tabs, Tab, List, Image, showLoadingToast, closeToast, Button, showImagePreview, showFailToast, Dialog, Search, Field, showSuccessToast, showConfirmDialog } from "vant"
+import { requestCostlist, requestSeekstatus, requestCompanyCategores, requestBusinessInfo, requestSupplierInfo } from "~/service/modules/home"
+import axios from "axios"
 
 const CancelToken = axios.CancelToken
 
-const router = useRouter()
+const mapSpuCode = ref<string[]>([])
+const selection = ref<Record<string, any>>([])
+
+const state = reactive({
+  skuOrName: '',
+  isIndeterminate: false,
+  isCheckAll: false,
+  finished: false, 
+  loading: false, 
+  isInit: true,
+  status: 0,
+  total: 0,
+  page: 0
+})
 
-const state = reactive({ status: '', loading: false, finished: false, isInit: true })
 const list = ref<Record<string, any>[]>([])
 
 const tabList = [
-  { value: "", label: "全部", type: "primary" },
+  { value: "9", label: "待审核", type: "primary" },
+  { value: "10",label: "审核驳回", type: "danger" },
+  { value: "1", label: "审核通过", type: "danger" },
+  { value: 'other', label: '其他', type: 'warning' },
+  { value: '',  label: '全部'  }
+]
+
+const mapValueToStatus = {
+  '9': '9',
+  '10': '10',
+  '1': '1',
+  'other': ['0', '2', '3', '4', '5', '10', '6', '7', '8']
+}
+
+const tabListAll = [
+  // { value: "", label: "全部", type: "primary" },
   { value: "0", label: "新建待审核", type: "primary" },
-  { value: "9", label: "待财务审核", type: "primary" },
+  { value: "9", label: "待审核", type: "primary" },
   { value: "1", label: "审核通过", type: "success" },
   { value: "2", label: "基础修改待审核", type: "primary" },
   { value: "3", label: "成本修改待审核", type: "primary" },
   { value: "4", label: "基础修改驳回", type: "danger" },
   { value: "5", label: "成本修改驳回", type: "danger" },
-  { value: "10",label: "财务审核驳回", type: "danger" },
+  { value: "10",label: "审核驳回", type: "danger" },
   { value: "6", label: "新建审核驳回", type: "danger" },
   { value: "7", label: "复制商品待编辑", type: "primary" },
   { value: "8", label: "竞价商品待编辑", type: "primary" }
 ]
 
-
 let source:any = null;
-async function onSearch(){
-  if(state.isInit){
-    showLoadingToast({ message: '加载中...', forbidClick: true })
+async function onSearch(bidNo?: string, isReset?: boolean){
+  if(state.isInit || isReset){ showLoadingToast({ message: '加载中...', forbidClick: true }) }
+  
+  if(!bidNo){  state.page += 1 }
+
+  if(isReset){
+    list.value = []
+    state.page = 1
   }
 
   state.loading = true
   source = CancelToken.source()
+
   const { code, data } = await requestCostlist({ 
-    status: state.status
+    page: bidNo ? 1 : state.page,
+    spucode: state.skuOrName,
+    bidNo: bidNo || '',
+    status: mapValueToStatus[state.status],
+    companyNo: ['GS2304031312553746', 'GS2302231323386950', 'GS2302231124114965', 'GS2401181650538135', 'GS2302231125079621']
   }, 
     source.token
   )
-
   state.loading = false
   if(code == 0){
-    list.value = [
-      ...list.value,
-      ...data.list
-    ]
-    state.finished = data.list.length < 10;
+    if(bidNo){
+      const sourceIndex = list.value.findIndex(item => item.bidNo === bidNo)
+
+      
+
+      list.value[sourceIndex] = data.list[0]
+    } else {
+      list.value = [...list.value, ...data.list]
+      state.finished = data.list.length < 10;
+    }
+    state.total = data.count
   }
 
-  if(state.isInit){
+  if(state.isInit || isReset){
     closeToast()
     state.isInit = false
   }
@@ -60,13 +100,18 @@ async function onSearch(){
 
 function handleTabChange(){
   source && source.cancel()
+  state.skuOrName = ''
+  state.isCheckAll = false
+  state.isIndeterminate = false
+  mapSpuCode.value = []
+  selection.value = []
+  state.page = 0
   state.finished = false
   state.loading = false
   list.value = [];
   onSearch()
 }
-
-onMounted(onSearch)
+// onMounted(onSearch)
 </script>
 
 <template>
@@ -75,33 +120,98 @@ onMounted(onSearch)
       <Tab v-for="tab in tabList" :title="tab.label" :key="tab.value" :name="tab.value" />
     </Tabs>
 
-    <List 
-      class="mt-[44px]" 
-      v-model:loading="state.loading" 
-      :finished="state.finished" 
-      finished-text="没有更多了" 
-      @load="onSearch"
+    <div 
+      class="w-full flex bg-[#fff] fixed top-[43px] left-0 items-center" 
+      style="z-index:1000; border-bottom: 1px solid #f5f5f5" 
     >
-       <div class="bg-[#fff] p-[10px] mb-[1px]" v-for="item in list" :key="item.id">
-         <Tag class="mb-[5px]" size="large" :name="item.value" :type="tabList.find(({ value }) => item.status == value)?.type">
-          {{ tabList.find(({ value }) => item.status == value)?.label || '--' }}
-         </Tag>
-
-         <div class="flex items-start" @click="router.push('/costDetail?id=' + item.spuCode)">
-           <Image style="min-width:130px;min-height:130px;height:130px;width:130px" :src="item.good_info_img" />
+      <Search 
+        class="flex-1"
+        v-model="state.skuOrName"
+        placeholder="SKU编号"
+        @clear="onSearch('', true)"
+      />
+      
+      <Button 
+        class="mr-[15px] ml-[-10px]" 
+        type="warning"
+        size="small"
+        @click="onSearch('', true)"
+      >搜索</Button>
+    </div>
+    
+    <List class="mt-[95px] w-full" v-model:loading="state.loading" :finished="state.finished" finished-text="没有更多了" @load="onSearch">
+       <div :show="true" class="bg-[#fff] my-[3px] border-[#f5f5f5]" v-for="item in list" :key="item.id">
+        <div class="p-[15px] flex items-start">
+          <div class="float-right items-start w-full">
            <div class="flex flex-col ml-[10px]" style="line-height:22px">
-             <p class="font-[16px] font-700 color-[#0f0f0f]">{{ item.good_name }}</p>
-             <div class="flex flex-col color-[#b4b4b4] font-500 font-[12px]">
-               <p class="nobreak">SKU:  {{ item.spuCode }}</p>
-               <p class="nobreak">进项类目编码: {{ item.tax_info.in_tax_merge }}</p>
-               <p class="nobreak">进项类目名称: {{ item.tax_info.in_tax_name }}</p>
-               <p class="nobreak">进项税率: {{ item.tax }}%</p>
-               <p class="nobreak">工艺说明: {{ item.cost_desc }}</p>
+             <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
+                  " 
+                  @click="showImagePreview([item.good_info_img])"
+                  :src="item.good_info_img"
+                />
+                <p class="font-[16px] font-700 py-[5px]">{{ item.good_name }}</p>
+             </div>
+             
+            <div class="flex flex-col color-[#34495e] font-500" style="font-size: 13px">
+              <div class="flex">
+                <p  class="w-[65px] text-right pr-[5px]">审核状态:</p>
+                <p>{{ tabListAll.find(({ value }) => item.status == value)?.label || '--' }}</p>
+              </div>
+
+              <div class="flex">
+                <p class="w-[65px]  text-right pr-[5px]">SKU编号:</p>
+                <p>{{ item.spuCode }}</p>
+              </div>
+
+              <template v-if="item.status != '1'">
+                <div class="flex">
+                  <p class="w-[65px]  text-right pr-[5px]">类目编码:</p>
+                  <p>{{ item.in_tax_merge_code }}</p>
+                </div>
+
+                <div class="flex">
+                  <p  class="w-[65px]  text-right pr-[5px]">类目名称:</p>
+                  <p>{{ item.in_tax_name }}</p>
+                </div>
+              </template>
+
+              <template v-else>
+                <div class="flex">
+                  <p class="w-[65px]  text-right pr-[5px]">类目编码:</p>
+                  <p>{{ item.out_tax_merge_code }}</p>
+                </div>
+
+                <div class="flex">
+                  <p  class="w-[65px]  text-right pr-[5px]">类目名称:</p>
+                  <p>{{ item.out_tax_name }}</p>
+                </div>
+
+                
+                <div class="flex">
+                  <p  class="w-[65px]  text-right pr-[5px]">销项税率:</p>
+                  <p>{{ String(item.out_tax).includes('%')  ? item.out_tax :  item.out_tax + '%'}}</p>
+                </div>
+              </template>
+
+              <div class="flex">
+                <p  class="w-[65px]  text-right pr-[5px]">工艺材质:</p>
+                <p>{{ item.cost_desc }}</p>
+              </div>
              </div>
            </div>
          </div>
+        </div>
        </div>
     </List>
-    
   </div>
 </template>

+ 156 - 34
src/pages/home/components/seek-product.vue

@@ -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>

+ 0 - 3
src/pages/home/seek-detail.vue

@@ -92,9 +92,6 @@ function handleOkStatus(){
       requestDetail()
     }
   })
-  .catch(() => {
-
-  })
 }
 
 onMounted(requestDetail)

+ 6 - 0
src/service/modules/baseUrl.ts

@@ -0,0 +1,6 @@
+// export const newApi = 'http://project.test241.wanyuhengtong.com/'
+// export const oldApi = 'http://stocknew.test241.wanyuhengtong.com/'
+
+
+export const newApi = 'http://work.api.caixiao365.com/'
+export const oldApi = 'http://stock.api.caixiao365.com/'

+ 19 - 7
src/service/modules/home/index.ts

@@ -1,5 +1,7 @@
 import service from "~/service";
 
+import { newApi, oldApi } from "./../baseUrl"
+
 enum HomeAPI {
   seek = "/admin/consultbidlist",
   seekDetail = "/admin/consultfeadinfo",
@@ -12,31 +14,41 @@ enum HomeAPI {
   categories = '/user/TaxCategory/listByCompany'
 }
 
+
 export const requestSeeklist = (data: any, cancelToken) => {
-  return service.post<any>({ url: HomeAPI.seek, data , cancelToken});
+  return service.post<any>({ url: oldApi + HomeAPI.seek, data , cancelToken});
 };
 
 export const requestSeekdetail = (data: any) => {
-  return service.post<any>({ url: HomeAPI.seekDetail, data});
+  return service.post<any>({ url: oldApi + HomeAPI.seekDetail, data});
 };
 
 export const requestSeekstatus = (data: any) => {
-  return service.post<any>({ url: HomeAPI.seekStatus, data});
+  return service.post<any>({ url: oldApi + HomeAPI.seekStatus, data});
 };
 
 
 export const requestCostlist = (data: any, cancelToken) => {
-  return service.post<any>({ url: HomeAPI.cost, data , cancelToken});
+  return service.post<any>({ url: newApi + '/admin/good/list', data , cancelToken});
 };
 
 export const requestCostdetail = (data: any) => {
-  return service.post<any>({ url: HomeAPI.costDetail, data });
+  return service.post<any>({ url: oldApi + HomeAPI.costDetail, data });
 };
 
 export const requestCoststatus = (data: any) => {
-  return service.post<any>({ url: HomeAPI.costStatus, data });
+  return service.post<any>({ url: oldApi + HomeAPI.costStatus, data });
 };
 
 export const requestCompanyCategores = (data: any) => {
-  return service.post<any>({ url: 'http://project.test241.wanyuhengtong.com/user/TaxCategory/listByCompany', data })
+  return service.post<any>({ url: newApi + 'user/TaxCategory/listByCompany', data })
+}
+
+export const requestSupplierInfo = (data: any) => {
+  return service.post<any>({ url: newApi + 'user/supplier/info', data })
 }
+
+export const requestBusinessInfo = (data: any) => {
+  return service.post<any>({ url: oldApi + 'admin/businesssinfo', data })
+}
+

+ 3 - 5
src/service/modules/login/index.ts

@@ -1,10 +1,8 @@
 import service from "~/service";
+import { oldApi } from "./../baseUrl"
 
-enum UserAPI {
-  login = "/admin/login",
-}
+enum UserAPI { login = "/admin/login" }
 
 export const login = (data: any) => {
-  console.log(data)
-  return service.post<any>({ url: UserAPI.login, data });
+  return service.post<any>({ url: oldApi +  UserAPI.login, data });
 };

+ 0 - 1
types/components.d.ts

@@ -9,6 +9,5 @@ declare module 'vue' {
   export interface GlobalComponents {
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
-    UnoCSSIconButton: typeof import('./../src/components/Icon/UnoCSSIconButton.vue')['default']
   }
 }

Някои файлове не бяха показани, защото твърде много файлове са промени