98lxh 8 tháng trước cách đây
mục cha
commit
e2bdf37472

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 415 - 294
pnpm-lock.yaml


+ 18 - 4
src/api/serviceParam/grossProfit/index.ts

@@ -9,16 +9,30 @@ interface ResponseType extends Promise<any> {
   message?: string;
 }
 
-export const httpList = (data:object = {}): ResponseType => {
+export const httpList = (data: object = {}): ResponseType => {
   return http.request("post", `${yewuApi}scpList`, { data });
 };
-export const httpStatus = (data:object = {}): ResponseType => {
+
+
+export const httpPlatformList = (data: object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}spcpList`, { data });
+};
+
+export const httpPlatform = (data: object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}getPlatformListByUid`, { data });
+};
+export const httpStatus = (data: object = {}): ResponseType => {
   return http.request("post", `${yewuApi}scpStatus`, { data });
 };
-export const httpCreate = (data:object = {}): ResponseType => {
+export const httpCreate = (data: object = {}): ResponseType => {
   return http.request("post", `${yewuApi}excluadd`, { data });
 };
-export const httpUpdate = (data:object = {}): ResponseType => {
+export const httpUpdate = (data: object = {}): ResponseType => {
   return http.request("post", `${yewuApi}scpSet`, { data });
 }
 
+export const httpPlatformUpdate = (data: object = {}): ResponseType => {
+  return http.request("post", `${yewuApi}spcpSet`, { data });
+}
+
+

+ 9 - 10
src/components/PageContent/src/page-content.tsx

@@ -105,8 +105,8 @@ const PageContent = defineComponent({
       const showPay = showPayTagFn ? showPayTagFn(row, powers) : true;
       const showReturn = showReturnTagFn ? showReturnTagFn(row, powers) : true;
 
-      const showUnPay = showUnPayTagFn ? showUnPayTagFn(row,powers) && Number(row.pay_tag_id) !== 0 : false;
-      const showUnReturn = showUnReturnTagFn ? showUnReturnTagFn(row, powers)  && Number(row.inv_tag_id) !== 0 : false;
+      const showUnPay = showUnPayTagFn ? showUnPayTagFn(row, powers) && Number(row.pay_tag_id) !== 0 : false;
+      const showUnReturn = showUnReturnTagFn ? showUnReturnTagFn(row, powers) && Number(row.inv_tag_id) !== 0 : false;
 
       const _showStatus = showStatus
         ? showStatus(isSuperUser.value)
@@ -115,7 +115,6 @@ const PageContent = defineComponent({
         ((powers.some(i => i == "003") && row[statusListProp || 'status'] + "" === "0") ||
           (powers.some(i => i == "004") && row[statusListProp || 'status'] + "" === "1"));
 
-
       return (
         <>
           {!notPreview && view && noPerview && powers.some(i => i == "007") && (
@@ -135,7 +134,7 @@ const PageContent = defineComponent({
             />
           )}
 
-          {payProps && noAction && showPay  && (
+          {payProps && noAction && showPay && (
             <Operation.Tag
               row={row}
               tagProps={payProps}
@@ -144,9 +143,9 @@ const PageContent = defineComponent({
             />
           )}
 
-{
+          {
             returnProps && showUnReturn && (
-              <Operation.UnTag 
+              <Operation.UnTag
                 row={row}
                 tagProps={returnProps}
                 onReload={() => onSearch()}
@@ -156,7 +155,7 @@ const PageContent = defineComponent({
 
           {
             payProps && showUnPay && (
-              <Operation.UnTag 
+              <Operation.UnTag
                 row={row}
                 isPay
                 tagProps={payProps}
@@ -201,7 +200,7 @@ const PageContent = defineComponent({
       const { contentConfig, powers } = props;
       const { superUserNoAction, showCreate } = contentConfig;
 
-      if (((superUserNoAction && isSuperUser.value) ||(showCreate && !showCreate(isSuperUser.value)))) {
+      if (((superUserNoAction && isSuperUser.value) || (showCreate && !showCreate(isSuperUser.value)))) {
         return null;
       }
 
@@ -299,7 +298,7 @@ const PageContent = defineComponent({
 
     function renderPureTable(size, checkList) {
       const { contentConfig } = props;
-      const { treeProps, rowKey, isTree,maxHeight,tableRowClassName } = contentConfig;
+      const { treeProps, rowKey, isTree, maxHeight, tableRowClassName } = contentConfig;
 
       return (
         <PureTable
@@ -316,7 +315,7 @@ const PageContent = defineComponent({
           treeProps={treeProps}
           data={dataList.value}
           checkList={checkList}
-          maxHeight={ maxHeight ? maxHeight : '660px'}
+          maxHeight={maxHeight ? maxHeight : '660px'}
           paginationSmall={
             size === "small" ? true : false
           }

+ 23 - 54
src/views/serviceParam/platformGrossProfit/cpns/category-tree.vue

@@ -1,10 +1,9 @@
 <script setup lang="ts">
-import { ref, shallowRef,  watch } from "vue";
+import { ref, shallowRef, watch } from "vue";
 import { useAsync, useResponseHandle } from "/@/hooks/core/useAsync";
-import { httpList, httpStatus } from "/@/api/serviceParam/grossProfit";
+import { httpPlatformList, httpStatus } from "/@/api/serviceParam/grossProfit";
 import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
-import { statusOptions, khOptions } from "../_options";
-import { ElMessageBox, ElMessage } from "element-plus"
+import { ElMessage } from "element-plus"
 import Modal from "./modal.vue"
 import { useCompany } from "/@/hooks/core/useCompany";
 const { currentCompany } = useCompany()
@@ -28,44 +27,36 @@ function toNextNode(depart: any) {
 }
 
 function requestCategorylist() {
-  if(!currentCompany.value.companyNo){
+  if (!currentCompany.value.companyNo) {
     ElMessage.warning('请在右上角选择一家业务公司!')
     loading.value = false
     data.value = []
     return
   }
 
-  const params = { 
-    ...props.otherParms, 
-    ...(pid.value ? { pid: pid.value } : { pid : 0 }), 
+  if (!props.otherParms.platform_id) {
+    ElMessage.warning('请选择平台!')
+    loading.value = false
+    data.value = []
+    return
+  }
+
+  const params = {
+    ...props.otherParms,
+    ...(pid.value ? { pid: pid.value } : { pid: 0 }),
     size: 1000,
-    companyNo: currentCompany.value.companyNo 
+    companyNo: currentCompany.value.companyNo
   }
 
 
-  run(httpList(params));
+  run(httpPlatformList(params));
 }
 
 const initialData = () => requestCategorylist()
-function onDelete(id: string) {
-  ElMessageBox.confirm('确认要删除?', { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }).then(async () => {
-    const model = { id }
-    const res = await httpDelete(model)
-    if (res.code === 0) {
-      ElMessage.success('删除成功')
-      requestCategorylist()
-    } else {
-      ElMessage.warning('删除失败')
-    }
-  })
-}
-
 
 function onEdit(row: any = {}) {
-  console.log(row)
-
-  const { cat_id, cat_name, order_rate , sale_rate , rate , low_rate } = row;
-  dataSource.value = { id: cat_id, cat_name , order_rate : order_rate || 0, sale_rate : sale_rate || 0, rate : rate || 0, low_rate: low_rate || 0 }
+  const { cat_id, cat_name, order_rate, sale_rate, rate, low_rate } = row;
+  dataSource.value = { id: cat_id, cat_name, order_rate: order_rate || 0, sale_rate: sale_rate || 0, rate: rate || 0, low_rate: low_rate || 0 }
   visible.value = true
 }
 
@@ -91,43 +82,21 @@ defineExpose({ changePid: (id: string) => (pid.value = id), onSearch: () => requ
   <ul class="mt-[10px]" v-loading="loading">
     <ElTable :data="data" border size="small" max-height="calc(100vh - 160px)">
       <ElTableColumn label="分类名称" prop="cat_name" min-width="160px" show-overflow-tooltip />
-      <ElTableColumn label="状态" prop="status" min-width="70px">
-        <template #="{ row }">
-          <ElTag :type="String(row.status) === '0' ? 'warning' : ''">{{ statusOptions.find(({ value }) => value === String(row.status))?.label || '--' }}</ElTag>
-        </template>
-      </ElTableColumn>
-
       <ElTableColumn label="分类等级" prop="level" min-width="80px" />
-
       <ElTableColumn label="操作" width="140px">
         <template #="{ row }">
           <el-tooltip effect="dark" content="编辑专属分类" placement="top">
             <ElButton link class="reset-margin" type="primary" :icon="useRenderIcon('edits')" @click="onEdit(row)" />
           </el-tooltip>
-
-          <el-popconfirm :title=" String(row.status) === '1' ? '改为禁用?' : '改为启用?'" @confirm="handleStatus(row)"  >
-              <template #reference>
-                <el-button
-                  class="reset-margin"
-                  link
-                  type="primary"
-                  size="small"
-                  :icon=" useRenderIcon(String(row.status) === '1' ? 'close-circle-line' : 'checkbox-circle-line')" />
-                </template>
-              </el-popconfirm>
-              <el-tooltip effect="dark" content="下一级" placement="top">
-            <ElButton link class="reset-margin" type="primary" :icon="useRenderIcon('arrow-right-s-line')"  @click="toNextNode(row)" />
+          <el-tooltip effect="dark" content="下一级" placement="top">
+            <ElButton link class="reset-margin" type="primary" :icon="useRenderIcon('arrow-right-s-line')"
+              @click="toNextNode(row)" />
           </el-tooltip>
         </template>
       </ElTableColumn>
     </ElTable>
 
-    <Modal 
-      :pid="pid" 
-      v-model:data="dataSource" 
-      v-model:visible="visible" 
-      :breadcrumb="breadcrumb"  
-      @refresh="requestCategorylist" 
-    />
+    <Modal :pid="pid" v-model:data="dataSource" v-model:visible="visible" :breadcrumb="breadcrumb"
+      @refresh="requestCategorylist" :platform_id="otherParms.platform_id" />
   </ul>
 </template>

+ 24 - 23
src/views/serviceParam/platformGrossProfit/cpns/modal.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { httpUpdate } from "/@/api/serviceParam/grossProfit";
+import { httpPlatformUpdate } from "/@/api/serviceParam/grossProfit";
 import { computed, ref, shallowRef } from "vue";
 import { useVModel } from "@vueuse/core"
 import { ElMessage, ElForm } from "element-plus";
@@ -8,13 +8,13 @@ import { rules } from "./../_options"
 import { useCompany } from "/@/hooks/core/useCompany";
 const { currentCompany } = useCompany()
 
-const initialData = { pid: '', name: '', id: '' , companyNo: ''}
+const initialData = { pid: '', name: '', id: '', companyNo: '' }
 const emit = defineEmits(['refresh'])
 
 
 const props = withDefaults(
-  defineProps<{ data: any; pid: string; visible: boolean, breadcrumb: any[] }>(), 
-  { data: {  } }
+  defineProps<{ data: any; pid: string; visible: boolean, breadcrumb: any[], platform_id: string }>(),
+  { data: {} }
 )
 
 const data = useVModel(props, 'data')
@@ -25,20 +25,21 @@ const prefix = computed(() => { const { breadcrumb = [] } = props; return breadc
 const loading = shallowRef(false)
 const formRef = ref<any | null>(null)
 
-function handleClose(){
+function handleClose() {
   data.value = { ...initialData }
   visible.value = false
 }
 
-async function onSubmit(){
+async function onSubmit() {
   try {
     await formRef.value.validate();
     loading.value = true
-    
-    const res = await httpUpdate({
+
+    const res = await httpPlatformUpdate({
       money_rate: 0,
       ...data.value,
       cat_id: data.value.id,
+      platform_id: props.platform_id,
       companyNo: currentCompany.value.companyNo
     })
 
@@ -60,44 +61,44 @@ async function onSubmit(){
 <template>
   <ElDialog v-model="visible" :title="title" center @close="handleClose">
     <ElForm :model="data" :rules="rules" size="small" ref="formRef" label-width="100px">
-      <ElFormItem label="分类名称" prop="cat_name" >
+      <ElFormItem label="分类名称" prop="cat_name">
         <ElInput v-model="data.cat_name" placeholder="分类名称" :disabled="data.id" />
       </ElFormItem>
 
-      <ElFormItem  label="预算→成本" prop="order_rate">
+      <ElFormItem label="预算→成本" prop="order_rate">
         <div class="flex w-full">
-          <ElInputNumber placeholder="预算→成本" style="width:100%" :min="0" :max="100" controls-position="right" v-model="data.order_rate" disbaled  precision="2" />
+          <ElInputNumber placeholder="预算→成本" style="width:100%" :min="0" :max="100" controls-position="right"
+            v-model="data.order_rate" disbaled precision="2" />
           <p class="ml-[10px]">%</p>
         </div>
       </ElFormItem>
-      
-      <ElFormItem  label="成本→售价" prop="sale_rate">
+
+      <ElFormItem label="成本→售价" prop="sale_rate">
         <div class="flex w-full">
-          <ElInputNumber  placeholder="成本→售价" style="width:100%"  :min="0" :max="100" controls-position="right" v-model="data.sale_rate" disbaled  precision="2" />
+          <ElInputNumber placeholder="成本→售价" style="width:100%" :min="0" :max="100" controls-position="right"
+            v-model="data.sale_rate" disbaled precision="2" />
           <p class="ml-[10px]">%</p>
         </div>
       </ElFormItem>
 
-      <ElFormItem  label="主管利率" prop="rate">
+      <ElFormItem label="主管利率" prop="rate">
         <div class="flex w-full">
-          <ElInputNumber placeholder="主管利率" style="width:100%"  :min="0" :max="100" controls-position="right" v-model="data.rate" disbaled  precision="2" />
+          <ElInputNumber placeholder="主管利率" style="width:100%" :min="0" :max="100" controls-position="right"
+            v-model="data.rate" disbaled precision="2" />
           <p class="ml-[10px]">%</p>
         </div>
       </ElFormItem>
 
-      <ElFormItem  label="项目最低毛利" prop="low_rate">
+      <ElFormItem label="项目最低毛利" prop="low_rate">
         <div class="flex w-full">
-          <ElInputNumber placeholder="项目最低毛利" style="width:100%"  :min="0" :max="100" controls-position="right" v-model="data.low_rate" disbaled  precision="2" />
+          <ElInputNumber placeholder="项目最低毛利" style="width:100%" :min="0" :max="100" controls-position="right"
+            v-model="data.low_rate" disbaled precision="2" />
           <p class="ml-[10px]">%</p>
         </div>
       </ElFormItem>
 
       <div class="w-full flex justify-end">
-        <ElButton 
-          type="primary" 
-          :loading="loading" 
-          @click="onSubmit"
-        >保存</ElButton>
+        <ElButton type="primary" :loading="loading" @click="onSubmit">保存</ElButton>
       </div>
     </ElForm>
   </ElDialog>

+ 25 - 36
src/views/serviceParam/platformGrossProfit/index.vue

@@ -1,22 +1,25 @@
 <script setup lang="ts">
 import { ref, shallowRef, watch } from "vue";
-import { httpCreate } from "/@/api/interest/organize";
 import { statusOptions } from "./_options"
-import { ElMessage, ElOption } from "element-plus"
+import { ElOption } from "element-plus"
 import Modal from "./cpns/modal.vue"
 
 import CategoryTree from "./cpns/category-tree.vue"
 
+import { httpPlatform } from "/@/api/serviceParam/grossProfit";
+import { onMounted } from "vue";
+
 const pageName = "grossProfit";
 
 const parent = ref(null)
+const platforms = ref<any[]>([])
 const data = ref<any>({})
 const breadcrumb = ref<any[]>([]);
 const visible = shallowRef(false)
-const params = ref<Record<string, string>>({ status: "", cat_name: "", company_name: '' });
+const params = ref<Record<string, string>>({ platform_id: "", cat_name: "", company_name: '' });
 const categoryTreeRef = ref<InstanceType<typeof CategoryTree> | null>(null);
 
-function handleChange (depart: any){
+function handleChange(depart: any) {
   breadcrumb.value.push(depart)
 }
 
@@ -29,6 +32,11 @@ function handleCategoryTreeSearch(index?: number) {
   breadcrumb.value['splice'](index + 1);
 }
 
+async function requestPlatformlist() {
+  const { data } = await httpPlatform({ size: 1000, is_show: '0' })
+  platforms.value = data.list
+}
+
 watch(
   () => breadcrumb.value,
   () => {
@@ -38,12 +46,15 @@ watch(
   },
   { immediate: true, deep: true }
 )
+
+onMounted(requestPlatformlist)
 </script>
 
 <template>
   <PageAuth class="px-[10px] h-[calc(100vh-60px)] bg-white" :pageName="pageName" :margin="false">
     <ul class="flex cursor-pointer">
-      <li @click="() => handleCategoryTreeSearch()">全部专属一级分类 <span v-if="breadcrumb.length > 0" class="mx-[5px]">/</span> </li>
+      <li @click="() => handleCategoryTreeSearch()">全部专属一级分类 <span v-if="breadcrumb.length > 0"
+          class="mx-[5px]">/</span> </li>
       <li v-for="(item, index) in breadcrumb" :key="item.id"
         :class="{ 'cursor-pointer': true, 'text-[#ccc]': index === breadcrumb.length - 1 }"
         @click="() => handleCategoryTreeSearch(index)">
@@ -54,26 +65,13 @@ watch(
 
     <div class="flex justify-between pt-[20px]">
       <div class="flex gap-1">
-        <ElSelect 
-          v-model="params.status" 
-          placeholder="分类状态"
-          style="width: 100%" >
-          <ElOption 
-            v-for="opt in statusOptions" 
-            :key="opt.value" 
-            :value="opt.value" 
-            :label="opt.label" 
-          />
+        <ElSelect v-model="params.platform_id" placeholder="平台名称" style="width: 100%" clearable
+          @change="categoryTreeRef!.onSearch()">
+          <ElOption v-for="opt in platforms" :key="opt.id" :value="opt.id" :label="opt.platform_name" />
         </ElSelect>
 
-
-        <ElInput 
-          @change="() => categoryTreeRef!.onSearch()" 
-          v-model="params.cat_name" 
-          placeholder="分类名称" 
-          size="small" 
-          clearable
-        />
+        <ElInput @change="() => categoryTreeRef!.onSearch()" v-model="params.cat_name" placeholder="分类名称" size="small"
+          clearable />
       </div>
       <div class="flex">
         <ElButton size="small" @click="() => categoryTreeRef!.onSearch()">刷新</ElButton>
@@ -82,20 +80,11 @@ watch(
 
     <!-- 树节点 -->
     <div class="flex-1">
-      <CategoryTree 
-        ref="categoryTreeRef" 
-        :otherParms="params" 
-        :breadcrumb="breadcrumb"
-        @breadcrumbChange="handleChange" 
-      />
+      <CategoryTree ref="categoryTreeRef" :otherParms="params" :breadcrumb="breadcrumb"
+        @breadcrumbChange="handleChange" />
     </div>
 
-    <Modal 
-      :pid="data.pid" 
-      v-model:data="data" 
-      v-model:visible="visible"
-      :breadcrumb="breadcrumb" 
-      @refresh="categoryTreeRef!.onSearch()" 
-    />
+    <Modal :pid="data.pid" v-model:data="data" v-model:visible="visible" :breadcrumb="breadcrumb"
+      @refresh="categoryTreeRef!.onSearch()" />
   </PageAuth>
 </template>

+ 4 - 2
src/views/serviceParam/purchaseSetting/config/content.config.ts

@@ -41,11 +41,13 @@ const columns = [
 ];
 
 const contentConfig: ContentConfig = {
-  title: "商品分类查询",
+  title: "采购单修改设置",
   columns,
+  statusProp: 'is_cgd',
+  statusListProp: 'is_cgd',
   apis: {
     httpStatus,
-    httpList:(params = {} as any) => {
+    httpList: (params = {} as any) => {
       const { is_cgd, ...rest } = params
       return httpList({ is_cgd: is_cgd || '', ...rest })
     }

+ 3 - 8
src/views/serviceParam/unit/index.vue

@@ -41,7 +41,7 @@ const events: PageEvents = {
 };
 
 async function onSubmit() {
-  const { id, unit} = data.value;
+  const { id, unit } = data.value;
   const isCreate = id === undefined || !id
   const params = { id, unit }
   if (isCreate) delete params['id']
@@ -59,13 +59,8 @@ async function onSubmit() {
 
 <template>
   <PageAuth :pageName="PageName">
-    <PageContainer 
-      :hooks="hooks" 
-      :events="events" 
-      :contentConfig="contentConfig" 
-      :search-config="searchConfig"
-      :get-content-ref="ref => (instance = ref)" 
-    />
+    <PageContainer :hooks="hooks" :events="events" :contentConfig="contentConfig" :search-config="searchConfig"
+      :get-content-ref="ref => (instance = ref)" />
     <Modal v-model:visible="visible" v-model:data="data" :disabled="disabled" @submit="onSubmit" />
   </PageAuth>
 </template>

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác