lamphua 1 gadu atpakaļ
vecāks
revīzija
4afc23bd56

+ 6
- 6
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcContract.java Parādīt failu

@@ -26,8 +26,8 @@ public class CmcContract extends BaseEntity
26 26
     @Excel(name = "合同编号")
27 27
     private String contractNumber;
28 28
 
29
-    /** 项目 */
30
-    private String[] projectIds;
29
+    /** 投标项目 */
30
+    private String tenderId;
31 31
 
32 32
     /** 合同金额 */
33 33
     @Excel(name = "合同金额")
@@ -87,14 +87,14 @@ public class CmcContract extends BaseEntity
87 87
     {
88 88
         return contractNumber;
89 89
     }
90
-    public void setProjectIds(String[] projectIds)
90
+    public void setTenderId(String tenderId)
91 91
     {
92
-        this.projectIds = projectIds;
92
+        this.tenderId = tenderId;
93 93
     }
94 94
 
95
-    public String[] getProjectIds()
95
+    public String getTenderId()
96 96
     {
97
-        return projectIds;
97
+        return tenderId;
98 98
     }
99 99
 
100 100
     public void setAmount(BigDecimal amount)

+ 10
- 3
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcContractMapper.xml Parādīt failu

@@ -7,6 +7,7 @@
7 7
     <resultMap type="CmcContract" id="CmcContractResult">
8 8
         <result property="contractId"    column="contract_id"    />
9 9
         <result property="contractNumber"    column="contract_number"    />
10
+        <result property="tenderId"    column="tender_id"    />
10 11
         <result property="amount"    column="amount"    />
11 12
         <result property="deposit"    column="deposit"    />
12 13
         <result property="contractDocument"    column="contract_document"    />
@@ -26,14 +27,16 @@
26 27
     </resultMap>
27 28
 
28 29
     <sql id="selectCmcContractVo">
29
-        select c.contract_id, c.contract_number, c.amount, c.deposit, c.contract_document, c.drafter, u.nick_name as draft_nick_name, c.draft_time, c.remark, c.sign_date, c.sign_remark,
30
-               c.sign_scan, c.comment_type from cmc_contract
31
-        left join sys_user as u on u.user_id = ca.drafter
30
+        select c.contract_id, c.contract_number, c.tender_id, c.amount, c.deposit, c.contract_document, c.drafter, u.nick_name as draft_nick_name, c.draft_time, c.remark, c.sign_date, c.sign_remark,
31
+               c.sign_scan, c.comment_type from cmc_contract as c
32
+        left join sys_user as u on u.user_id = c.drafter
32 33
     </sql>
33 34
 
34 35
     <select id="selectCmcContractList" parameterType="CmcContract" resultMap="CmcContractResult">
35 36
         <include refid="selectCmcContractVo"/>
36 37
         <where>
38
+            <if test="contractId != null  and contractId != ''"> and c.contract_id like concat('%', #{contractId}, '%')</if>
39
+            <if test="tenderId != null  and tenderId != ''"> and c.tender_id = #{tenderId}</if>
37 40
             <if test="contractNumber != null  and contractNumber != ''"> and c.contract_number = #{contractNumber}</if>
38 41
             <if test="amount != null "> and c.amount = #{amount}</if>
39 42
             <if test="deposit != null "> and c.deposit = #{deposit}</if>
@@ -45,6 +48,7 @@
45 48
             <if test="signScan != null  and signScan != ''"> and c.sign_scan = #{signScan}</if>
46 49
             <if test="commentType != null  and commentType != ''"> and c.comment_type = #{commentType}</if>
47 50
         </where>
51
+        order by contract_id desc
48 52
     </select>
49 53
 
50 54
     <select id="selectCmcContractByContractId" parameterType="String" resultMap="CmcContractResult">
@@ -56,6 +60,7 @@
56 60
         insert into cmc_contract
57 61
         <trim prefix="(" suffix=")" suffixOverrides=",">
58 62
             <if test="contractId != null">contract_id,</if>
63
+            <if test="tenderId != null">tender_id,</if>
59 64
             <if test="contractNumber != null">contract_number,</if>
60 65
             <if test="amount != null">amount,</if>
61 66
             <if test="deposit != null">deposit,</if>
@@ -70,6 +75,7 @@
70 75
         </trim>
71 76
         <trim prefix="values (" suffix=")" suffixOverrides=",">
72 77
             <if test="contractId != null">#{contractId},</if>
78
+            <if test="tenderId != null">#{tenderId},</if>
73 79
             <if test="contractNumber != null">#{contractNumber},</if>
74 80
             <if test="amount != null">#{amount},</if>
75 81
             <if test="deposit != null">#{deposit},</if>
@@ -87,6 +93,7 @@
87 93
     <update id="updateCmcContract" parameterType="CmcContract">
88 94
         update cmc_contract
89 95
         <trim prefix="SET" suffixOverrides=",">
96
+            <if test="tenderId != null">tender_id = #{tenderId},</if>
90 97
             <if test="contractNumber != null">contract_number = #{contractNumber},</if>
91 98
             <if test="amount != null">amount = #{amount},</if>
92 99
             <if test="deposit != null">deposit = #{deposit},</if>

+ 1
- 0
oa-back/sql/sql.sql Parādīt failu

@@ -3055,6 +3055,7 @@ drop table if exists `cmc_contract`;
3055 3055
 create table `cmc_contract`  (
3056 3056
   `contract_id` 			char(10)  		not null 	 comment '合同id(ht2024w002)',
3057 3057
   `contract_number` 		varchar(30)  	default null comment '合同编号',
3058
+  `tender_id` 				char(8)  		default null comment '投标项目id',
3058 3059
   `amount` 					decimal(10, 2) 	default null comment '合同金额',
3059 3060
   `deposit` 				decimal(10, 2) 	default null comment '履约保证金',
3060 3061
   `contract_document` 		varchar(255)  	default null comment '合同文件',

+ 99
- 20
oa-ui/src/views/flowable/form/contractForm.vue Parādīt failu

@@ -2,16 +2,50 @@
2 2
   <div class="app-container">
3 3
     <el-row :gutter="20">
4 4
       <el-col :span="18" :xs="24">
5
-        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
6
-          <el-form-item label="合同编号" prop="contractNumber">
7
-            <el-input v-model="form.contractNumber" placeholder="请输入合同编号" />
8
-          </el-form-item>
9
-          <el-form-item label="合同金额" prop="amount">
10
-            <el-input v-model="form.amount" placeholder="请输入合同金额" />
11
-          </el-form-item>
12
-          <el-form-item label="履约保证金" prop="deposit">
13
-            <el-input v-model="form.deposit" placeholder="请输入履约保证金" />
5
+        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
6
+          <el-form-item label="项目名称:" prop="tenderName">
7
+            <el-select v-model="form.tenderId" filterable placeholder="请选择" @change="handleSelectTender"
8
+              :disabled="taskName != '合同拟稿'" clearable>
9
+              <el-option v-for="item in tenderList" :key="item.value" :label="item.projectName" :value="item.tenderId">
10
+              </el-option>
11
+            </el-select>
12
+            <el-descriptions border v-if="isSelect" style="margin-top: 10px;" :column="1">
13
+              <el-descriptions-item label="项目名称" label-class-name="my-label">{{ chooseTender.projectName
14
+              }}</el-descriptions-item>
15
+              <el-descriptions-item label="项目来源" label-class-name="my-label">{{ getProjectSource(chooseTender)
16
+              }}</el-descriptions-item>
17
+              <el-descriptions-item label="甲方单位" label-class-name="my-label">{{ chooseTender.partyA
18
+              }}</el-descriptions-item>
19
+              <el-descriptions-item label="联系人" label-class-name="my-label">{{ chooseTender.aPerson
20
+              }}</el-descriptions-item>
21
+              <el-descriptions-item label="联系电话" label-class-name="my-label">{{ chooseTender.aPhone
22
+              }}</el-descriptions-item>
23
+            </el-descriptions>
14 24
           </el-form-item>
25
+          <el-row>
26
+            <el-col :span="6">
27
+              <el-form-item label="合同编码" prop="contractId">
28
+                <el-input v-model="form.contractId" :disabled="true"></el-input>
29
+              </el-form-item>
30
+            </el-col>
31
+            <el-col :span="6">
32
+              <el-form-item label="合同编号" prop="contractNumber">
33
+                <el-input v-model="form.contractNumber" placeholder="请输入合同编号"></el-input>
34
+              </el-form-item>
35
+            </el-col>
36
+          </el-row>
37
+          <el-row>
38
+            <el-col :span="6">
39
+              <el-form-item label="合同金额" prop="amount">
40
+                <el-input v-model="form.amount" placeholder="请输入合同金额" />
41
+              </el-form-item>
42
+            </el-col>
43
+            <el-col :span="6">
44
+              <el-form-item label="履约保证金" prop="deposit">
45
+                <el-input v-model="form.deposit" placeholder="请输入履约保证金" />
46
+              </el-form-item>
47
+            </el-col>
48
+          </el-row>
15 49
           <el-form-item label="合同文件" prop="contractDocument">
16 50
             <el-input v-model="form.contractDocument" placeholder="请输入合同文件" />
17 51
           </el-form-item>
@@ -63,7 +97,7 @@ import { parseTime } from "@/utils/ruoyi";
63 97
 import { listContract, getContract, delContract, addContract, updateContract } from "@/api/oa/contract/contract";
64 98
 import { getContractWork } from "@/api/oa/contract/contractWork";
65 99
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
66
-import { listProject, getProject } from "@/api/oa/project/project";
100
+import { listTender, getTender } from "@/api/oa/tender/tender";
67 101
 import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
68 102
 import flow from '@/views/flowable/task/todo/detail/flow'
69 103
 import { flowXmlAndNode } from "@/api/flowable/definition";
@@ -125,8 +159,8 @@ export default {
125 159
       rules: {
126 160
       },
127 161
       workList: [],
128
-      projectList: [],
129
-      chooseProject: {},
162
+      tenderList: [],
163
+      chooseTender: {},
130 164
       isSelect: false,
131 165
       formTotal: 0,
132 166
       flowData: {},
@@ -137,6 +171,7 @@ export default {
137 171
       this.drafter = this.$store.getters.name;
138 172
       this.draftTime = parseTime(new Date(), '{y}-{m}-{d}')
139 173
     }
174
+    this.getTenderList();
140 175
     this.getList();
141 176
     flowXmlAndNode({ procInsId: this.taskForm.procInsId, deployId: this.taskForm.deployId }).then(res => {
142 177
       this.flowData = res.data;
@@ -158,6 +193,12 @@ export default {
158 193
         else {
159 194
           this.formTotal = 1;
160 195
           this.form = res.data;
196
+          if (data.tenderId) {
197
+            getTender(data.tenderId).then(response => {
198
+              this.chooseTender = response.data;
199
+              this.isSelect = true
200
+            })
201
+          }
161 202
         }
162 203
       })
163 204
     },
@@ -171,21 +212,22 @@ export default {
171 212
       });
172 213
     },
173 214
     // 查询项目列表
174
-    getProjectList() {
215
+    getTenderList() {
175 216
       this.loading = true
176
-      listProject({
217
+      listTender({
177 218
         pageNum: 1,
178 219
         pageSize: 99999999
179 220
       }).then(response => {
180
-        this.projectList = response.rows;
221
+        this.tenderList = response.rows;
181 222
       })
182 223
     },
183 224
     // 选择项目
184
-    handleSelectProject(val) {
225
+    handleSelectTender(val) {
185 226
       if (val != "" && val != undefined && val != null) {
186
-        getProject(val).then(res => {
187
-          this.chooseProject = res.data;
188
-          this.isSelect = true
227
+        getTender(val).then(res => {
228
+          this.chooseTender = res.data;
229
+          this.isSelect = true;
230
+          this.getContractId(this.chooseTender)
189 231
         })
190 232
       } else {
191 233
         this.isSelect = false
@@ -204,6 +246,43 @@ export default {
204 246
       }
205 247
       return true;
206 248
     },
249
+    getProjectSource(chooseTender) {
250
+      let partyAList = ['中国电建集团成都勘测设计研究院勘测设计分公司', '成勘院 水环境与城建工程分公司'];
251
+      return partyAList.indexOf(chooseTender.partyA) != -1 ? '院内' : '院外';
252
+    },
253
+    getContractId(chooseTender) {
254
+      let contractId = '';
255
+      if (chooseTender) {
256
+        if (this.getProjectSource(chooseTender) == '院内') {
257
+          listContract({ contractId: 'C' }).then(res => {
258
+            if (res.total == 0)
259
+              contractId = 'HT' + new Date().getFullYear() + 'C' + '001';
260
+            else
261
+              contractId = 'HT' + new Date().getFullYear() + 'C' + this.fillZero(Number(res.rows[0].contractId.substring(7, 10)) + 1);
262
+            this.$set(this.form, 'contractId', contractId);
263
+          })
264
+        }
265
+        else {
266
+          listContract({ contractId: 'W' }).then(res => {
267
+            if (res.total == 0)
268
+              contractId = 'HT' + new Date().getFullYear() + 'W' + '001';
269
+            else
270
+              contractId = 'HT' + new Date().getFullYear() + 'W' + this.fillZero(Number(res.rows[0].contractId.substring(7, 10)) + 1);
271
+            this.$set(this.form, 'contractId', contractId);
272
+          })
273
+        }
274
+      }
275
+    },
276
+    fillZero(number) {
277
+      let fullNumber = '';
278
+      if (number < 10)
279
+        fullNumber = '00' + number;
280
+      else if (number >= 10 & number < 100)
281
+        fullNumber = '0' + number;
282
+      else
283
+        fullNumber = number;
284
+      return fullNumber;
285
+    },
207 286
     // 表单重置
208 287
     reset() {
209 288
       this.form = {
@@ -303,7 +382,7 @@ export default {
303 382
       }, `contract_${new Date().getTime()}.xlsx`)
304 383
     }
305 384
   }
306
-};
385
+}
307 386
 </script>
308 387
 
309 388
 <style>

Notiek ielāde…
Atcelt
Saglabāt