From fbe3c5fb0269e937ea4c35ed4f564278690c85bf Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Thu, 26 Dec 2024 14:26:01 +0800 Subject: [PATCH] init --- src/components/XyTable/index.vue | 4 +- src/store/modules/user.js | 7 +- .../contract/components/EditContract.vue | 1103 ++++++++++++++++- .../contract/components/editorContract.vue | 2 +- src/views/contract/contractList.vue | 232 +--- 5 files changed, 1143 insertions(+), 205 deletions(-) diff --git a/src/components/XyTable/index.vue b/src/components/XyTable/index.vue index eed9fc0..1d34edb 100644 --- a/src/components/XyTable/index.vue +++ b/src/components/XyTable/index.vue @@ -127,9 +127,9 @@ export default { createIndexRow(){ return }, - toggleRowSelection(row){ + toggleRowSelection(row, selected=true){ this.$nextTick(()=>{ - this.$refs.table.toggleRowSelection(row); + this.$refs.table.toggleRowSelection(row,selected); }) }, clearSelection(){ diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 09e5e97..4c916bb 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -17,6 +17,7 @@ import { const getDefaultState = () => { return { token: getToken(), + username: '', name: '', avatar: '', adminId: '', @@ -48,6 +49,9 @@ const mutations = { }, SET_DEPARTMENT: (state, department) => { state.department = department + }, + SET_USERNAME: (state, username) => { + state.username = username } } @@ -114,13 +118,14 @@ const actions = { if (!response) { reject('身份验证失败请重新登录') } - const { name, avatar, id, role, department } = response + const { name, avatar, id, role, department, username } = response commit('SET_DEPARTMENT',department) commit('SET_NAME', name) commit('SET_AVATAR', avatar) commit('SET_ADMIN_ID', id) commit('SET_ROLE', role) + commit('SET_USERNAME', username) resolve(response) }).catch(error => { reject(error) diff --git a/src/views/contract/components/EditContract.vue b/src/views/contract/components/EditContract.vue index c50b4a2..faf58c3 100644 --- a/src/views/contract/components/EditContract.vue +++ b/src/views/contract/components/EditContract.vue @@ -1,51 +1,1128 @@ diff --git a/src/views/contract/components/editorContract.vue b/src/views/contract/components/editorContract.vue index 7044560..5322533 100644 --- a/src/views/contract/components/editorContract.vue +++ b/src/views/contract/components/editorContract.vue @@ -625,7 +625,7 @@ import { resetSelect } from '@/utils' }, { label: '已用金额', - prop: 'has_money_total', + prop: 'has_moxney_total', width: 120, align: 'right' } diff --git a/src/views/contract/contractList.vue b/src/views/contract/contractList.vue index 732ab07..b3a3b23 100644 --- a/src/views/contract/contractList.vue +++ b/src/views/contract/contractList.vue @@ -528,135 +528,19 @@ - - - - - - - - - -
-
- -
- - - 取 消 - 确 定 - -
- - - + :common-purchase-type="commonPurchaseType" + :types="type" + :departments="departments" + :is-show.sync="isShowEdit" + @refresh="getContracts" /> @@ -707,7 +591,7 @@ import { editorContract, detailContract, } from "@/api/contract/contract"; -import { getparameter } from "@/api/system/dictionary"; +import {getparameter, getparameterTree} from "@/api/system/dictionary"; import { listdeptNoAuth } from "@/api/system/department"; import { getBudget } from "@/api/budget/budget"; import { getOatoken } from "@/api/oatoken"; @@ -747,7 +631,7 @@ export default { flowIds: [{"name":"政府采购流转","id":71,"type":2},{"name":"公务接待","id":86,"type":1},{"name":"会议费用","id":87,"type":1},{"name":"培训费","id":88,"type":1},{"name":"用印","id":76,"type":1},{"name":"仪器设备维修流转","id":84,"type":1},{"name":"请休假","id":68,"type":1},{"name":"仪器设备购置流转","id":82,"type":1},{"name":"安装、维修流转","id":96,"type":1},{"name":"车船维修保养流转","id":97,"type":1}], isShowIsFramework: true, - userList: ["ma_sm", "admin", "yu_l","wang_yx","li_f","chen_y"], + userList: ["admin"], nowContract: {}, window: { width: 0, @@ -837,6 +721,7 @@ export default { purchaseType: [], //购买形式 purchaseWay: [], //购买方式 moneyWay: [], //资金渠道 + commonPurchaseType: [],//一般采购类型 departments: [], //部门科室 list: [], //数据 total: 0, @@ -1686,12 +1571,6 @@ export default { return sums; }, - //y验证合同的名称是否存在重复 - checkName(e) { - checkContractName({ name: e }).then((res) => { - console.log(res); - }); - }, confirmPlanForSearch() { this.isShowPlanForSearch = false; this.getContracts(); @@ -1730,15 +1609,14 @@ export default { } } switch (row.flow_mod_id) { - case 12: + case 82: baseInfo = { - "6583b42c5c29a": row.name, + "cankaojiage": row.plan_price, } break; - case 5: + case 101: baseInfo = { - "65b37c797845d": row.name, - "65b37c8facfc9": row.content, + "yujifeiyong": row.plan_price, } break; case 29: @@ -1874,11 +1752,24 @@ export default { }, //获取资金渠道 async getMoneyWay() { - this.moneyWay = ( - await getparameter({ - number: "money_way", - }) - ).detail; + try { + this.moneyWay = []; + const res = await getparameterTree({ + id: 3 + }); + const dataHandler = (data) => { + data.forEach(i => { + if (i.hasOwnProperty('detail')) { + this.moneyWay.push(...i.detail) + } else { + dataHandler(i['children']) + } + }) + } + dataHandler(res?.children) + } catch (err) { + + } }, //获取购买方式 async getPurchaseWay() { @@ -1892,6 +1783,16 @@ export default { this.plansPageIndex = 1; this.getBudgets(); }, + // 一般采购类型 + async getCommonPurchaseType() { + try { + this.commonPurchaseTypes = (await getparameter({ + number: 'common_purchase_type' + }))?.detail || [] + } catch (err) { + + } + }, //获取科室 async getDepartment() { this.departments = await listdeptNoAuth(); @@ -1977,11 +1878,6 @@ export default { },1000), //新建合同 - //显示 - async showPlan() { - this.isShowPlan = true; - await this.getBudgets(); - }, async showPlanForSearch() { this.isShowPlanForSearch = true; await this.getBudgets(); @@ -2111,47 +2007,6 @@ export default { this.$refs.planTable.clearSelection(); } }, - //提交新建 - submit() { - addContrant({ - type: this.form.type, - is_plan: this.form.isBudget ? 1 : 0, - purchase_type_id: this.form.methods, - is_contract: this.form.is_contract, - purchase_way_id: this.form.modality, - money_way_id: `${this.form.fundingChannels.toString()}`, - plan_price: this.form.price, - name: this.form.name, - contract_plan_links: this.form.plan.map((item) => { - return item.value; - }), - flow_mod_id: this.form.flow_mod_id, - is_substitute: this.form.is_substitute, - is_simple: this.form.is_simple, - supply: this.form.supply, - money: this.form?.money, - status: this.form?.is_simple ? 2 : 1, - is_framework: this.form?.is_framework, - use_framework_buy: this.form.use_framework_buy, - content: this.form.content, - contract_to_contracts: this.selections.map((i) => { - return { - to_contract_id: i.id, - use_money: i.money, - }; - }), - }).then((res) => { - this.isShowAdd = false; - Message({ - type: "success", - message: "操作成功", - }); - this.selections = []; - this.$refs["addContract"].reset(); - this.$refs["planTable"].clearSelection(); - this.getContracts(false,false,true); - }); - }, //删除合同 deleteContract(id) { @@ -2280,7 +2135,7 @@ export default { (item.is_purchase === 0 && other?.flow_status === 1) || item.status === 2 || (!item.is_contract && item.is_simple) || - (item.is_tender_audit && !item.is_contract && shenpi?.flow_status === 1) || + (item.is_tender_audit && !item.is_contract && item.invite_status === 1) || (!item.is_tender_audit && !item.is_contract && (caigou?.flow_status === 1 || common_purchase?.flow_status === 1)) ) { //网上商场的话采购完成 合同签订完成 不为合同并且为简易 @@ -2356,6 +2211,7 @@ export default { }; }, created() { + this.getCommonPurchaseType(); this.getPurchaseType(); this.getDepartment(); this.getPurchaseWay();