修改
This commit is contained in:
		| @ -13,8 +13,7 @@ | ||||
|             <el-form-item> | ||||
|               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> | ||||
|               <el-button icon="Refresh" @click="resetQuery">重置</el-button> | ||||
|               <el-button type="primary" plain :icon="Plus" @click="openDialog" | ||||
|                 v-hasPermi="['tender:segmentedIndicatorPlanning:add']">新增</el-button> | ||||
|               <el-button type="primary" plain :icon="Plus" @click="openDialog" v-hasPermi="['tender:segmentedIndicatorPlanning:add']">新增</el-button> | ||||
|             </el-form-item> | ||||
|           </el-form> | ||||
|         </el-card> | ||||
| @ -28,23 +27,24 @@ | ||||
|           <el-table-column prop="content" label="内容" /> | ||||
|           <el-table-column prop="plannedBiddingTime" label="计划招标时间" align="center"> | ||||
|             <template #default="scope"> | ||||
|               <el-date-picker v-model="scope.row.plannedBiddingTime" type="date" value-format="YYYY-MM-DD" | ||||
|                 placeholder="选择时间" /> | ||||
|               <el-date-picker v-model="scope.row.plannedBiddingTime" type="date" value-format="YYYY-MM-DD" placeholder="选择时间" /> | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|           <el-table-column prop="price" label="操作" align="center"> | ||||
|             <template #default="scope"> | ||||
|               <el-button type="warning" size="small" @click="handleDetail(scope.row)" | ||||
|                 v-hasPermi="['tender:segmentedIndicatorPlanning:getMore']">详情</el-button> | ||||
|               <el-button type="primary" size="small" @click="handleSave(scope.row)" | ||||
|                 v-hasPermi="['tender:segmentedIndicatorPlanning:edit']">修改</el-button> | ||||
|               <el-button type="danger" size="small" @click="delHandle(scope.row)" | ||||
|                 v-hasPermi="['tender:segmentedIndicatorPlanning:remove']">删除</el-button> | ||||
|               <el-button type="warning" size="small" @click="handleDetail(scope.row)" v-hasPermi="['tender:segmentedIndicatorPlanning:getMore']" | ||||
|                 >详情</el-button | ||||
|               > | ||||
|               <el-button type="primary" size="small" @click="handleSave(scope.row)" v-hasPermi="['tender:segmentedIndicatorPlanning:edit']" | ||||
|                 >修改</el-button | ||||
|               > | ||||
|               <el-button type="danger" size="small" @click="delHandle(scope.row)" v-hasPermi="['tender:segmentedIndicatorPlanning:remove']" | ||||
|                 >删除</el-button | ||||
|               > | ||||
|             </template> | ||||
|           </el-table-column> | ||||
|         </el-table> | ||||
|         <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" | ||||
|           v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||
|         <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> | ||||
|       </el-tab-pane> | ||||
|     </el-tabs> | ||||
|     <el-dialog title="新增" v-model="dialogVisible" width="75%" draggable> | ||||
| @ -66,8 +66,7 @@ | ||||
|             <el-form :model="treeForm" :inline="true"> | ||||
|               <el-form-item label="版本号" prop="versions"> | ||||
|                 <el-select v-model="treeForm.versions" placeholder="选择版本号" @change="changeVersions"> | ||||
|                   <el-option v-for="item in options" :key="item.versions" :label="item.versions" | ||||
|                     :value="item.versions" /> | ||||
|                   <el-option v-for="item in options" :key="item.versions" :label="item.versions" :value="item.versions" /> | ||||
|                 </el-select> | ||||
|               </el-form-item> | ||||
|               <el-form-item label="表名" prop="sheet"> | ||||
| @ -83,8 +82,16 @@ | ||||
|               </el-form-item> | ||||
|             </el-form> | ||||
|           </el-card> | ||||
|           <el-table :data="treeData" ref="treeTableRef" v-loading="treeLoading" row-key="id" border lazy | ||||
|             default-expand-all @selection-change="handleSelection"> | ||||
|           <el-table | ||||
|             :data="treeData" | ||||
|             ref="treeTableRef" | ||||
|             v-loading="treeLoading" | ||||
|             row-key="id" | ||||
|             border | ||||
|             lazy | ||||
|             default-expand-all | ||||
|             @selection-change="handleSelection" | ||||
|           > | ||||
|             <el-table-column type="selection" width="55" /> | ||||
|             <el-table-column prop="num" label="编号" /> | ||||
|             <el-table-column prop="name" label="工程或费用名称" /> | ||||
| @ -92,13 +99,20 @@ | ||||
|             <!-- <el-table-column prop="quantity" label="数量" /> --> | ||||
|             <el-table-column prop="selectNum" label="选择数量" align="center"> | ||||
|               <template #default="scope"> | ||||
|                 <el-input-number :model-value="scope.row.selectNum" @change=" | ||||
|                   (val) => { | ||||
|                     scope.row.selectNum = val; | ||||
|                     handleNumberChange(scope.row); | ||||
|                   } | ||||
|                 " :precision="2" :step="1" :controls="false" :max="Math.floor(scope.row.quantity)" | ||||
|                   v-if="scope.row.quantity && scope.row.quantity != 0" /> | ||||
|                 <el-input-number | ||||
|                   :model-value="scope.row.selectNum" | ||||
|                   @change=" | ||||
|                     (val) => { | ||||
|                       scope.row.selectNum = val; | ||||
|                       handleNumberChange(scope.row); | ||||
|                     } | ||||
|                   " | ||||
|                   :precision="2" | ||||
|                   :step="1" | ||||
|                   :controls="false" | ||||
|                   :max="Math.floor(scope.row.quantity)" | ||||
|                   v-if="scope.row.quantity && scope.row.quantity != 0" | ||||
|                 /> | ||||
|               </template> | ||||
|             </el-table-column> | ||||
|             <el-table-column prop="unitPrice" label="单价" align="center" /> | ||||
|  | ||||
| @ -323,18 +323,21 @@ | ||||
| <script setup name="SupplierInput" lang="ts"> | ||||
| import { ComponentInternalInstance, getCurrentInstance, onMounted, ref, reactive, toRefs, computed } from 'vue'; | ||||
| import { ElFormInstance } from 'element-plus'; | ||||
| import { listSupplierInput, getSupplierInput, delSupplierInput } from '@/api/supplierInput/supplierInput'; | ||||
| import { listSupplierInput, getSupplierInput, delSupplierInput } from '@/api/supplierInput/supplierInput/index'; | ||||
| import { SupplierInputVO, SupplierInputQuery, SupplierInputForm, PageData, DialogOption } from '@/api/supplierInput/supplierInput/types'; | ||||
| import Pagination from '@/components/Pagination/index.vue'; | ||||
| import RightToolbar from '@/components/RightToolbar/index.vue'; | ||||
| import FileUpload from '@/components/FileUpload/index.vue'; | ||||
| import { useUserStoreHook } from '@/store/modules/user'; | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status')); | ||||
| // 组件引用 | ||||
| const fileUploadRef = ref<InstanceType<typeof FileUpload> | null>(null); | ||||
| const queryFormRef = ref<ElFormInstance>(); | ||||
| const supplierInputFormRef = ref<ElFormInstance>(); | ||||
|  | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| const currentProject = computed(() => userStore.selectedProject); | ||||
| // 基础数据 | ||||
| const supplierInputList = ref<SupplierInputVO[]>([]); | ||||
| const buttonLoading = ref(false); | ||||
| @ -393,6 +396,7 @@ const initFormData: any = { | ||||
| const data = reactive<PageData<SupplierInputForm, SupplierInputQuery>>({ | ||||
|   form: { ...initFormData }, | ||||
|   queryParams: { | ||||
|     projectId: currentProject.value?.id, | ||||
|     pageNum: 1, | ||||
|     pageSize: 10, | ||||
|     supplierType: undefined, | ||||
| @ -506,7 +510,7 @@ const cancel = () => { | ||||
|  | ||||
| /** 表单重置:清空所有字段 */ | ||||
| const reset = () => { | ||||
|   form.value = { ...initFormData }; | ||||
|   form.value = { ...initFormData, projectId: currentProject.value?.id }; | ||||
|   fileUrl.value = ''; | ||||
|   form.value.inputFile = ''; | ||||
|   supplierInputFormRef.value?.resetFields(); | ||||
| @ -606,8 +610,6 @@ const handleUpdate = async (row?: SupplierInputVO) => { | ||||
|  | ||||
| /** 提交表单 */ | ||||
| const submitForm = () => { | ||||
|   console.log(1); | ||||
|  | ||||
|   supplierInputFormRef.value?.validate(async (valid: boolean) => { | ||||
|     if (!valid) return; | ||||
|     if (form.value.supplierType === '劳务') { | ||||
| @ -662,10 +664,29 @@ const handleDelete = async (row?: SupplierInputVO) => { | ||||
| const handleExport = () => { | ||||
|   proxy?.download('supplierInput/supplierInput/export', { ...queryParams.value }, `supplierInput_${new Date().getTime()}.xlsx`); | ||||
| }; | ||||
|  | ||||
| /** 页面挂载时查询列表 */ | ||||
| //调用projectId并获取列表 | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
|   // 若需要依赖项目ID,可先判断项目是否已选中,再调用接口 | ||||
|   if (currentProject.value?.id) { | ||||
|     queryParams.value.projectId = currentProject.value.id; | ||||
|     form.value.projectId = currentProject.value.id; | ||||
|     getList(); // 首次进入自动调取listSupplierInput接口 | ||||
|   } else { | ||||
|     // 若项目未选中,可提示或后续监听项目变化时再加载(已有监听逻辑) | ||||
|     getList(); | ||||
|   } | ||||
| }); | ||||
| // 监听项目id刷新数据 | ||||
| const listeningProject = watch( | ||||
|   () => currentProject.value?.id, | ||||
|   (nid, oid) => { | ||||
|     queryParams.value.projectId = nid; | ||||
|     form.value.projectId = nid; | ||||
|     getList(); | ||||
|   } | ||||
| ); | ||||
| onUnmounted(() => { | ||||
|   listeningProject(); | ||||
| }); | ||||
| </script> | ||||
|  | ||||
|  | ||||
| @ -437,9 +437,7 @@ onMounted(() => { | ||||
|   .el-input__inner, | ||||
|   .el-select .el-input__inner { | ||||
|     border-radius: 4px; | ||||
|     transition: | ||||
|       border-color 0.2s, | ||||
|       box-shadow 0.2s; | ||||
|     transition: border-color 0.2s, box-shadow 0.2s; | ||||
|  | ||||
|     &:focus { | ||||
|       border-color: var(--primary-light); | ||||
| @ -449,9 +447,7 @@ onMounted(() => { | ||||
|  | ||||
|   .el-textarea__inner { | ||||
|     border-radius: 4px; | ||||
|     transition: | ||||
|       border-color 0.2s, | ||||
|       box-shadow 0.2s; | ||||
|     transition: border-color 0.2s, box-shadow 0.2s; | ||||
|  | ||||
|     &:focus { | ||||
|       border-color: var(--primary-light); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user