Browse Source

供应商评级

jingbb 6 hours ago
parent
commit
9ab55cb9ae

+ 2 - 2
.env.development

@@ -6,10 +6,10 @@ VITE_PUBLIC_PATH = /
 
 
 # 跨域代理,您可以配置多个 ,请注意,没有换行符
-VITE_PROXY = [["/jeecgboot","http://localhost:8080/global-srm"],["/upload","http://localhost:3300/upload"]]
+VITE_PROXY = [["/jeecgboot","http://10.0.0.34:8080/global-srm"],["/upload","http://10.0.0.34:8080/upload"]]
 
 #后台接口全路径地址(必填)
-VITE_GLOB_DOMAIN_URL=http://localhost:8080/global-srm
+VITE_GLOB_DOMAIN_URL=http://10.0.0.34:8080/global-srm
 
 #后台接口父地址(必填)
 VITE_GLOB_API_URL=/jeecgboot

+ 1 - 1
.env.production

@@ -16,7 +16,7 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
 VITE_GLOB_API_URL=/jeecgboot
 
 #后台接口全路径地址(必填)
-VITE_GLOB_DOMAIN_URL=http://jeecg-boot-system:8080/jeecg-boot
+VITE_GLOB_DOMAIN_URL=http://172.19.67.171:8080/global-srm
 
 # 接口父路径前缀
 VITE_GLOB_API_URL_PREFIX=

+ 39 - 0
src/views/cuspCode/SupplierEvaluation/CuspSupplierEvaluation.api.ts

@@ -9,9 +9,12 @@ enum Api {
   edit='/cuspCode/cuspSupplierEvaluation/edit',
   deleteOne = '/cuspCode/cuspSupplierEvaluation/delete',
   deleteBatch = '/cuspCode/cuspSupplierEvaluation/deleteBatch',
+  submitBatch = '/cuspCode/cuspSupplierEvaluation/submitBatch',
+  cancelSubmitBatch = '/cuspCode/cuspSupplierEvaluation/returnSubmitBatch',
   importExcel = '/cuspCode/cuspSupplierEvaluation/importExcel',
   exportXls = '/cuspCode/cuspSupplierEvaluation/exportXls',
   cuspSupplierEvaluationScoreList = '/cuspCode/cuspSupplierEvaluation/queryCuspSupplierEvaluationScoreByMainId',
+  supplierList="/cuspCode/cuspSupplierProfile/list'"
 }
 /**
  * 导出api
@@ -28,6 +31,11 @@ export const getImportUrl = Api.importExcel;
  * @param params
  */
 export const cuspSupplierEvaluationScoreList = Api.cuspSupplierEvaluationScoreList;
+/**
+ * 查询供应商列表
+ * @param params
+ */
+export const supplierList = Api.supplierList;
 /**
  * 列表接口
  * @param params
@@ -61,6 +69,37 @@ export const batchDelete = (params, handleSuccess) => {
     }
   });
 }
+
+// 提交
+export const batchSubmit = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认提交',
+    content: '是否提交选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.delete({url: Api.submitBatch, data: params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+    }
+  });
+}
+// 取消提交
+export const cancelBatchSubmit = (params, handleSuccess) => {
+  createConfirm({
+    iconType: 'warning',
+    title: '确认取消提交',
+    content: '是否取消提交选中数据',
+    okText: '确认',
+    cancelText: '取消',
+    onOk: () => {
+      return defHttp.delete({url: Api.cancelSubmitBatch, data: params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+    }
+  });
+}
 /**
  * 保存或者更新
  * @param params

+ 117 - 154
src/views/cuspCode/SupplierEvaluation/CuspSupplierEvaluation.data.ts

@@ -4,55 +4,85 @@ import { rules} from '/@/utils/helper/validator';
 import { render } from '/@/utils/common/renderUtils';
 import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
 import { getWeekMonthQuarterYear } from '/@/utils';
+import { defHttp } from '/@/utils/http/axios';
+import {ref,onMounted} from 'vue';
+import { optionOptions } from 'ant-design-vue/es/vc-mentions/src/Option';
+var supplierOption = ref([])
 //列表数据
 export const columns: BasicColumn[] = [
    {
-    title: '状态(1-启用,0-停用)',
-    align:"center",
-    dataIndex: 'status'
-   },
-   {
-    title: '单据日期',
-    align:"center",
-    dataIndex: 'billDate'
-   },
-   {
-    title: '考评单号',
+    title: '考评单号(bill code)',
     align:"center",
     dataIndex: 'billCode'
    },
    {
-    title: '供应商',
+    title: '供应商(supplier)',
     align:"center",
     dataIndex: 'supplierId_dictText'
    },
    {
-    title: '考评期间',
+    title: '单据日期(bill date)',
     align:"center",
-    dataIndex: 'evaluationPeriod'
-   },
+    dataIndex: 'billDate'
+    //colProps: {span: 6},
+  },
    {
-    title: '考评等级',
+    title: '考评期间(evaluation period)',
     align:"center",
-    dataIndex: 'evaluationLevel_dictText'
+    dataIndex: 'evaluationPeriod'
    },
    {
-    title: '备注',
+    title: '考评等级(evaluation level)',
     align:"center",
-    dataIndex: 'notes'
+    dataIndex: 'evaluationLevel_dictText'
    },
    {
-    title: '提交(1-是 ,0-否)',
+    title: '提交(submit)',
     align:"center",
-    dataIndex: 'submit_dictText'
+    dataIndex: 'submit',
+    customRender:function (t, r, index) {
+      if(t.text==1){
+        return '是(yes)'
+      }else if(t.text==0){
+        return '否(no)'
+      }
+    }
    },
 ];
 //查询数据
 export const searchFormSchema: FormSchema[] = [
      {
-      label: "单据日期",
+        label: "考评单号(billCode)",
+        field: "billCode",
+        component: 'Input',
+        labelWidth:150,
+        //colProps: {span: 6},
+     },
+     {
+      label: "考评等级(evaluation level)",
+      field: "evaluationLevel",
+      component: 'JSelectMultiple',
+      labelWidth:200,
+      componentProps:{
+        dictCode:"grade" 
+      },
+      //colProps: {span: 6},
+ 	   },
+     {
+        label: "供应商(supplier)",
+        field: "supplierId",
+        component: 'JSelectInput',
+        labelWidth:150,
+        componentProps:{
+          options:supplierOption
+        },
+        //colProps: {span: 6},
+    },
+     {
+      label: "单据日期(billDate)",
       field: "billDate",
       component: 'RangePicker',
+      labelWidth:150,
       componentProps: {
           valueType: 'Date',
           showTime:true
@@ -60,96 +90,75 @@ export const searchFormSchema: FormSchema[] = [
       //colProps: {span: 6},
 	},
 	{
-      label: "考评单号",
-      field: "billCode",
-      component: 'Input',
-      //colProps: {span: 6},
- 	},
-	{
-      label: "供应商",
-      field: "supplierId",
-      component: 'JSelectMultiple',
-      componentProps:{
-      },
-      //colProps: {span: 6},
- 	},
-	{
-      label: "考评期间",
-      field: "evaluationPeriod",
-      component: 'Input',
-      //colProps: {span: 6},
- 	},
-	{
-      label: "考评等级",
-      field: "evaluationLevel",
-      component: 'JSelectMultiple',
-      componentProps:{
-      },
-      //colProps: {span: 6},
- 	},
-	{
-      label: "提交(1-是 ,0-否)",
+      label: "提交(submit)",
       field: "submit",
       component: 'JSelectMultiple',
+      labelWidth:150,
       componentProps:{
+        dictCode:"yes_or_no" 
       },
       //colProps: {span: 6},
  	},
+   {
+    label: "考评期间(evaluation period)",
+    field: "evaluationPeriod",
+    labelWidth:200,
+    component: 'Input',
+    //colProps: {span: 6},
+  },
 ];
 //表单数据
 export const formSchema: FormSchema[] = [
   {
-    label: '状态(1-启用,0-停用)',
-    field: 'status',
-    component: 'InputNumber',
-  },
-  {
-    label: '单据日期',
+    label: '单据日期(billDate)',
     field: 'billDate',
     component: 'DatePicker',
+    labelWidth:150,
     componentProps: {
        showTime:true,
        valueFormat: 'YYYY-MM-DD HH:mm:ss'
      },
   },
   {
-    label: '考评单号',
-    field: 'billCode',
-    component: 'Input',
+    label: '考评期间(evaluation period)',
+    field: 'evaluationPeriod',
+    component: 'DatePicker',
+    componentProps:{
+      AutoComplete:'off',
+      picker:"year",
+      valueFormat:'YYYY'
+    },
+    labelWidth:200,
   },
   {
-    label: '供应商',
+    label: '供应商(supplier)',
     field: 'supplierId',
-    component: 'JDictSelectTag',
+    component: 'JSelectInput',
+    labelWidth:150,
     componentProps:{
-        dictCode:""
-     },
+      options:supplierOption
+    },
   },
   {
-    label: '考评期间',
-    field: 'evaluationPeriod',
+    label: '考评单号(bill code)',
+    field: 'billCode',
     component: 'Input',
+    labelWidth:150,
   },
   {
-    label: '考评等级',
+    label: '考评等级(evaluation level)',
     field: 'evaluationLevel',
     component: 'JDictSelectTag',
+    labelWidth:200,
     componentProps:{
-        dictCode:""
+        dictCode:"grade"
      },
   },
   {
-    label: '备注',
+    label: '备注(notes)',
     field: 'notes',
     component: 'Input',
-  },
-  {
-    label: '提交(1-是 ,0-否)',
-    field: 'submit',
-    component: 'JDictSelectTag',
-    componentProps:{
-        dictCode:""
-     },
+    labelWidth:150,
   },
 	// TODO 主键隐藏字段,目前写死为ID
 	{
@@ -163,92 +172,32 @@ export const formSchema: FormSchema[] = [
 //子表表格配置
 export const cuspSupplierEvaluationScoreColumns: JVxeColumn[] = [
     {
-      title: '状态(1-启用,0-停用)',
-      key: 'status',
-      type: JVxeTypes.inputNumber,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
+      title: '项目(item)',
+      key: 'item',
+      type: JVxeTypes.normal,
+      align:"center",
     },
     {
-      title: '主表主键(供应商档案)',
-      key: 'headId',
-      type: JVxeTypes.inputNumber,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
+      title: '权重(weight)',
+      key: 'weight',
+      type: JVxeTypes.normal,
+      statistics:['sum'],
+      align:"center",
     },
     {
-      title: '价格得分',
-      key: 'priceScore',
-      type: JVxeTypes.inputNumber,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
+      title: '自动取数(automatic data)',
+      key: 'automaticData',
+      type: JVxeTypes.normal,
+      align:"center",
     },
     {
-      title: '质量得分',
-      key: 'qualityScore',
-      type: JVxeTypes.inputNumber,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
-    },
-    {
-      title: '交期得分',
-      key: 'deliveryTimeScore',
-      type: JVxeTypes.inputNumber,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
-    },
-    {
-      title: '服务得分',
-      key: 'serviceScore',
-      type: JVxeTypes.inputNumber,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
-    },
-    {
-      title: '总计得分',
+      title: '总计得分(total score)',
       key: 'totalScore',
       type: JVxeTypes.inputNumber,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
-    },
-    {
-      title: '价格自动取数',
-      key: 'priceAuto',
-      type: JVxeTypes.input,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
-    },
-    {
-      title: '质量自动取数',
-      key: 'qualityAuto',
-      type: JVxeTypes.input,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
-    },
-    {
-      title: '交期自动取数',
-      key: 'deliveryTimeAuto',
-      type: JVxeTypes.input,
-      width:"200px",
-      placeholder: '请输入${title}',
-      defaultValue:'',
-    },
-    {
-      title: '服务自动取数',
-      key: 'serviceAuto',
-      type: JVxeTypes.input,
-      width:"200px",
       placeholder: '请输入${title}',
       defaultValue:'',
+      statistics:['sum'],
+      align:"center",
     },
   ]
 
@@ -290,4 +239,18 @@ export const superQuerySchema = {
 export function getBpmFormSchema(_formData): FormSchema[]{
 // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
   return formSchema;
-}
+}
+export function getSupplierOptions(){
+  let params = {pageSize:'-1'}
+  defHttp.get({url:'/cuspCode/cuspSupplierProfile/list',params}, { isTransformResponse: false }).then(res=>{
+    if(res){
+      res.result.records.forEach(item=>{
+        supplierOption.value.push({
+          label: item.name,
+          value: item.id
+        })
+      })
+    }
+  })
+}
+export const supplierOptions = supplierOption.value

+ 39 - 41
src/views/cuspCode/SupplierEvaluation/CuspSupplierEvaluationList.vue

@@ -1,18 +1,19 @@
 <template>
   <div>
     <!--引用表格-->
-   <BasicTable @register="registerTable" :rowSelection="rowSelection">
+   <BasicTable @register="registerTable" :rowSelection="rowSelection" size="small">
      <!--插槽:table标题-->
       <template #tableTitle>
-          <a-button type="primary" v-auth="'cuspCode:cusp_supplier_evaluation:add'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
+          <a-button type="primary" v-auth="'cuspCode:cusp_supplier_profile:add'"  @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
           <a-button  type="primary" v-auth="'cuspCode:cusp_supplier_evaluation:exportXls'"  preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
-          <j-upload-button  type="primary" v-auth="'cuspCode:cusp_supplier_evaluation:importExcel'"  preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
+          <a-button  type="primary" v-auth="'cuspCode:cusp_supplier_evaluation:exportXls'"  preIcon="ant-design:export-outlined" @click="submit"> 提交</a-button>
+          <a-button  type="primary" v-auth="'cuspCode:cusp_supplier_evaluation:exportXls'"  preIcon="ant-design:export-outlined" @click="cancelSubmission"> 取消提交</a-button>
           <a-dropdown v-if="selectedRowKeys.length > 0">
               <template #overlay>
                 <a-menu>
                   <a-menu-item key="1" @click="batchHandleDelete">
                     <Icon icon="ant-design:delete-outlined"></Icon>
-                    删除
+                    删除(delete)
                   </a-menu-item>
                 </a-menu>
               </template>
@@ -20,8 +21,6 @@
                 <Icon icon="mdi:chevron-down"></Icon>
               </a-button>
         </a-dropdown>
-        <!-- 高级查询 -->
-        <super-query :config="superQueryConfig" @search="handleSuperQuery" />
       </template>
        <!--操作栏-->
       <template #action="{ record }">
@@ -32,25 +31,27 @@
       </template>
     </BasicTable>
     <!-- 表单区域 -->
-    <CuspSupplierEvaluationModal @register="registerModal" @success="handleSuccess"></CuspSupplierEvaluationModal>
+    <CuspSupplierEvaluationModal @register="registerModal" @success="handleSuccess" ref="CuspSupplierEvaluationModalRef"></CuspSupplierEvaluationModal>
   </div>
 </template>
 
 <script lang="ts" name="cuspCode-cuspSupplierEvaluation" setup>
-  import {ref, reactive, computed, unref} from 'vue';
+  import {ref, reactive,onMounted} from 'vue';
   import {BasicTable, useTable, TableAction} from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage'
   import {useModal} from '/@/components/Modal';
+  import { message } from 'ant-design-vue';
   import CuspSupplierEvaluationModal from './components/CuspSupplierEvaluationModal.vue'
-  import {columns, searchFormSchema, superQuerySchema} from './CuspSupplierEvaluation.data';
-  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './CuspSupplierEvaluation.api';
-  import {downloadFile} from '/@/utils/common/renderUtils';
+  import {columns, searchFormSchema, superQuerySchema,getSupplierOptions} from './CuspSupplierEvaluation.data';
+  import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,batchSubmit,cancelBatchSubmit,supplierList} from './CuspSupplierEvaluation.api';
   import { useUserStore } from '/@/store/modules/user';
+
   const queryParam = reactive<any>({});
   const checkedKeys = ref<Array<string | number>>([]);
   const userStore = useUserStore();
   //注册model
   const [registerModal, {openModal}] = useModal();
+  var CuspSupplierEvaluationModalRef = ref();
    //注册table数据
   const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
       tableProps:{
@@ -70,7 +71,7 @@
                 ],
             },
            actionColumn: {
-               width: 120,
+               width: 200,
                fixed:'right'
            },
            beforeFetch: (params) => {
@@ -89,48 +90,28 @@
     })
 
   const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
+  onMounted(() => {
+    getSupplierOptions()
+  });
 
-  // 高级查询配置
-  const superQueryConfig = reactive(superQuerySchema);
-
-  /**
-   * 高级查询事件
-   */
-  function handleSuperQuery(params) {
-    Object.keys(params).map((k) => {
-      queryParam[k] = params[k];
-    });
-    reload();
-  }
 
    /**
     * 新增事件
     */
   function handleAdd() {
-     openModal(true, {
-       isUpdate: false,
-       showFooter: true,
-     });
+    CuspSupplierEvaluationModalRef.value.getAdd()
   }
    /**
     * 编辑事件
     */
   function handleEdit(record: Recordable) {
-     openModal(true, {
-       record,
-       isUpdate: true,
-       showFooter: true,
-     });
+    CuspSupplierEvaluationModalRef.value.getEdit(record,)
    }
    /**
     * 详情
    */
   function handleDetail(record: Recordable) {
-     openModal(true, {
-       record,
-       isUpdate: true,
-       showFooter: false,
-     });
+    CuspSupplierEvaluationModalRef.value.getDetail(record)
    }
    /**
     * 删除事件
@@ -156,7 +137,7 @@
   function getTableAction(record){
        return [
          {
-           label: '编辑',
+           label: '编辑(edit)',
            onClick: handleEdit.bind(null, record),
            auth: 'cuspCode:cusp_supplier_evaluation:edit'
          }
@@ -170,10 +151,10 @@
   function getDropDownAction(record){
     return [
       {
-        label: '详情',
+        label: '详情(detail)',
         onClick: handleDetail.bind(null, record),
       }, {
-        label: '删除',
+        label: '删除(delete)',
         popConfirm: {
           title: '是否确认删除',
           confirm: handleDelete.bind(null, record),
@@ -183,6 +164,23 @@
       }
     ]
   }
+  function submit(){
+    if(selectedRowKeys.value.length==0){
+      message.warning('请选择要提交的数据')
+    }else{
+      var ids = selectedRowKeys.value.join(',')
+      batchSubmit({ids: ids},handleSuccess);
+    }
+  }
+  function cancelSubmission(){
+    if(selectedRowKeys.value.length==0){
+      message.warning('请选择要提交的数据')
+    }else{
+      var ids = selectedRowKeys.value.join(',')
+      cancelBatchSubmit({ids: ids},handleSuccess);
+    }
+  }
+  
 
 </script>
 

+ 209 - 87
src/views/cuspCode/SupplierEvaluation/components/CuspSupplierEvaluationModal.vue

@@ -1,104 +1,216 @@
 <template>
-  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="1024" @ok="handleSubmit">
-    <BasicForm @register="registerForm" ref="formRef" name="CuspSupplierEvaluationForm"/>
-    <!-- 子表单区域 -->
-    <a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs">
-      <a-tab-pane tab="供应商考评-得分" key="cuspSupplierEvaluationScore" :forceRender="true">
-        <JVxeTable
-          keep-source
-          resizable
-          ref="cuspSupplierEvaluationScore"
-          :loading="cuspSupplierEvaluationScoreTable.loading"
-          :columns="cuspSupplierEvaluationScoreTable.columns"
-          :dataSource="cuspSupplierEvaluationScoreTable.dataSource"
-          :height="340"
-          :rowNumber="true"
-          :rowSelection="true"
-          :disabled="formDisabled"
-          :toolbar="true"
-          />
-      </a-tab-pane>
-    </a-tabs>
-  </BasicModal>
+   <a-modal
+      :title="title"
+      width="95%"
+      :visible="visible"
+      :maskClosable="false"
+      switchFullscreen
+      @ok = "handleOk"
+      @cancel="handleCancel">
+        <template #footer>
+          <a-button  @click="handleCancel" >关闭(close)</a-button>
+          <a-button  @click="handleOk" type="primary" v-if="showFooter">保存(save)</a-button>
+        </template>
+        <div style=" padding: 16px;">
+          <a-form ref="form" :model="model" :rules="validatorRules">
+              <a-row :gutter="24">
+                <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8">
+                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="billDate" label="单据日期(billDate)">
+                    <a-date-picker v-model:value="model.billDate" show-time  valueFormat="YYYY-MM-DD HH:mm:ss" format='YYYY-MM-DD HH:mm:ss' style="width: 100%;" :disabled="!showFooter"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8">
+                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="evaluationPeriod" label="考评期间(evaluation period)">
+                        <a-date-picker v-model:value="model.evaluationPeriod" valueFormat="YYYY" picker="year" style="width: 100%;" :disabled="!showFooter"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8">
+                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplierId" label="供应商(supplier)">
+                    <JSelectInput   v-model:value="model.supplierId"  placeholder="请选择" :options="supplierOptions" :disabled="!showFooter"></JSelectInput>
+                  </a-form-item>
+                </a-col>
+                <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8">
+                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="billCode" label="考评单号(bill code)">
+                      <a-input  placeholder="请输入" v-model:value="model.billCode" AutoComplete='off' :disabled="!showFooter"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8">
+                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="evaluationLevel" label="考评等级(evaluation level)">
+                    <JDictSelectTag  v-model:value="model.evaluationLevel" placeholder="请选择" dictCode="grade" :disabled="!showFooter"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8">
+                  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes" label="备注(notes)">
+                      <a-input  placeholder="请输入" v-model:value="model.notes" AutoComplete='off' :disabled="!showFooter"/>
+                  </a-form-item>
+                </a-col>
+              </a-row>
+            </a-form>
+        </div>
+        <!-- 子表单区域 -->
+        <a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs" style=" padding: 24px;padding-top: 0px;">
+          <a-tab-pane tab="供应商考评-得分" key="cuspSupplierEvaluationScore" :forceRender="true">
+                  <a-table
+                    :columns="columns"
+                    :row-key="record => record.id"
+                    :data-source="dataSource"
+                    bordered
+                    size="small"
+                    height="500"
+                    :pagination="false"
+                    :scroll="{ x: 1500, y: 500 }"
+                  > 
+                    <template #totalScore="{ text, record,index }">
+                      <a-input  placeholder="请输入" v-model:value="model.priceScore" AutoComplete='off' v-if="record.item=='价格(price)'" @change="changeTotal" :disabled="!showFooter"/>
+                      <a-input  placeholder="请输入" v-model:value="model.qualityScore" AutoComplete='off' v-if="record.item=='质量(quality)'" @change="changeTotal" :disabled="!showFooter"/>
+                      <a-input  placeholder="请输入" v-model:value="model.deliveryTimeScore" AutoComplete='off' v-if="record.item=='交期(delivery time)'" @change="changeTotal" :disabled="!showFooter"/>
+                      <a-input  placeholder="请输入" v-model:value="model.serviceScore" AutoComplete='off' v-if="record.item=='服务(service)'" @change="changeTotal" :disabled="!showFooter"/>
+                      <span v-if="record.item=='合计(total)'">{{ model.totalScore }}</span>
+                    </template>
+                </a-table>
+          </a-tab-pane>
+        </a-tabs>
+  </a-modal>
 </template>
 
 <script lang="ts" setup>
     import {ref, computed, unref,reactive} from 'vue';
-    import {BasicModal, useModalInner} from '/@/components/Modal';
-    import {BasicForm, useForm} from '/@/components/Form/index';
-    import { JVxeTable } from '/@/components/jeecg/JVxeTable'
-    import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
-    import {formSchema,cuspSupplierEvaluationScoreColumns} from '../CuspSupplierEvaluation.data';
+    import { defHttp } from '/@/utils/http/axios';
+    import {formSchema,cuspSupplierEvaluationScoreColumns,supplierOptions} from '../CuspSupplierEvaluation.data';
     import {saveOrUpdate,cuspSupplierEvaluationScoreList} from '../CuspSupplierEvaluation.api';
-    import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
+    import { JDictSelectTag } from '/@/components/Form';
+    import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
     // Emits声明
     const emit = defineEmits(['register','success']);
     const isUpdate = ref(true);
-    const formDisabled = ref(false);
+    const visible = ref(false);
     const refKeys = ref(['cuspSupplierEvaluationScore', ]);
     const activeKey = ref('cuspSupplierEvaluationScore');
     const cuspSupplierEvaluationScore = ref();
-    const tableRefs = {cuspSupplierEvaluationScore, };
-    const cuspSupplierEvaluationScoreTable = reactive({
-          loading: false,
-          dataSource: [],
-          columns:cuspSupplierEvaluationScoreColumns
-    })
-    //表单配置
-    const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
-        schemas: formSchema,
-        showActionButtonGroup: false,
-        baseColProps: {span: 8}
+    const labelCol = ref({
+      xs: { span: 24 },
+      sm: { span: 8 },
+      });
+    const wrapperCol = ref({
+      xs: { span: 24 },
+      sm: { span: 16 },
     });
-     //表单赋值
-    const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
-        //重置表单
-        await reset();
-        setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
-        isUpdate.value = !!data?.isUpdate;
-        formDisabled.value = !data?.showFooter;
-        if (unref(isUpdate)) {
-            //表单赋值
-            await setFieldsValue({
-                ...data.record,
-            });
-             requestSubTableData(cuspSupplierEvaluationScoreList, {id:data?.record?.id}, cuspSupplierEvaluationScoreTable)
-        }
-        // 隐藏底部时禁用整个表单
-       setProps({ disabled: !data?.showFooter })
+    var showFooter= ref(true);
+    var model = ref({
+      billDate:'',
+      evaluationPeriod:'',
+      supplierId:'',
+      billCode:'',
+      evaluationLevel:'',
+      notes:'',
+      priceScore:'',
+      qualityScore:'',
+      deliveryTimeScore:'',
+      serviceScore:'',
+      totalScore:'',
     });
-    //方法配置
-    const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys);
-
-    //设置标题
-    const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(formDisabled) ? '编辑' : '详情'));
-
-    async function reset(){
-      await resetFields();
-      activeKey.value = 'cuspSupplierEvaluationScore';
-      cuspSupplierEvaluationScoreTable.dataSource = [];
-    }
-    function classifyIntoFormData(allValues) {
-         let main = Object.assign({}, allValues.formValue)
-         return {
-           ...main, // 展开
-           cuspSupplierEvaluationScoreList: allValues.tablesValue[0].tableData,
-         }
-       }
-    //表单提交事件
-    async function requestAddOrEdit(values) {
-        try {
-            setModalProps({confirmLoading: true});
-            //提交表单
-            await saveOrUpdate(values, isUpdate.value);
-            //关闭弹窗
-            closeModal();
-            //刷新列表
-            emit('success');
-        } finally {
-            setModalProps({confirmLoading: false});
-        }
-    }
+    var validatorRules = ref({});
+    var title = ref('');
+    const tableRefs = {cuspSupplierEvaluationScore, };
+    var dataSource = ref([
+            {item:'价格(price)',weight:'3',automaticData:'',totalScore:''},
+            {item:'质量(quality)',weight:'3',automaticData:'退货数量/入库数量(return/inventory):10/100',totalScore:''},
+            {item:'交期(delivery time)',weight:'2',automaticData:'延迟次数/发货次数(delay/deliver):5/45',totalScore:''},
+            {item:'服务(service)',weight:'2',automaticData:'',totalScore:''},
+            {item:'合计(total)',weight:'10',automaticData:'',totalScore:'',},
+    ]);
+    var columns = reactive([
+        {
+            title: '项目(item)',
+            dataIndex: 'item',
+            key: 'item',
+            align:"center",
+            ellipsis: true,
+        },
+        {
+            title: '权重(weight)',
+            dataIndex: 'weight',
+            key: 'weight',
+            align:"center"
+        },
+        {
+            title: '自动取数(automatic data)',
+            dataIndex: 'automaticData',
+            key: 'automaticData',
+            align:"center",
+        },
+        {
+            title: '总计得分(total score)',
+            key: 'totalScore',
+            dataIndex: 'totalScore',
+            align:"center",
+            slots: { customRender: 'totalScore' },
+        },
+  ]);
+  function handleChangeTabs(key: string) {
+      activeKey.value = key;
+  }
+  async function handleOk(){    
+    await saveOrUpdate(model.value, isUpdate.value);
+    //关闭弹窗
+    handleCancel();
+    //刷新列表
+    emit('success');
+  }
+  function handleCancel(){
+      visible.value = false
+      model.value = {
+        billDate:'',
+        evaluationPeriod:'',
+        supplierId:'',
+        billCode:'',
+        evaluationLevel:'',
+        notes:'',
+        priceScore:'',
+        qualityScore:'',
+        deliveryTimeScore:'',
+        serviceScore:'',
+        totalScore:'',
+      }
+  }
+  function getAdd(){
+    visible.value = true
+    title.value = '新增(add)'
+    isUpdate.value = false;
+    showFooter.value = true
+  }
+  function getEdit(record){
+    visible.value = true
+    title.value = '编辑(edit)'
+    isUpdate.value = true;
+    showFooter.value = true
+    model.value = record
+    model.value.priceScore = model.value.priceScore?model.value.priceScore:'0'
+    model.value.qualityScore = model.value.qualityScore?model.value.qualityScore:'0'
+    model.value.deliveryTimeScore = model.value.deliveryTimeScore?model.value.deliveryTimeScore:'0'
+    model.value.serviceScore = model.value.serviceScore?model.value.serviceScore:'0'
+  }
+  function changeTotal(){
+    var total = 0
+    total = Number(model.value.priceScore)+Number(model.value.qualityScore)+Number(model.value.deliveryTimeScore)+Number(model.value.serviceScore)
+    model.value.totalScore = total.toString()
+  }
+  function getDetail(record){
+    visible.value = true
+    title.value = '详情(detail)'
+    isUpdate.value = true;
+    showFooter.value = false
+    model.value = record
+    model.value.priceScore = model.value.priceScore?model.value.priceScore:'0'
+    model.value.qualityScore = model.value.qualityScore?model.value.qualityScore:'0'
+    model.value.deliveryTimeScore = model.value.deliveryTimeScore?model.value.deliveryTimeScore:'0'
+    model.value.serviceScore = model.value.serviceScore?model.value.serviceScore:'0'
+  }
+  defineExpose({
+    getAdd,
+    getEdit,
+    getDetail
+  });
 </script>
 
 <style lang="less" scoped>
@@ -110,4 +222,14 @@
   :deep(.ant-calendar-picker) {
     width: 100%;
   }
+  /deep/.vxe-table--body-wrapper{
+    height: 100% !important;
+  }
+  /deep/.ant-modal-body{
+    padding: 24px !important;
+  }
+  
+  /deep/.ant-form-item{
+      margin-bottom: 8px !important;
+  }
 </style>