detail.vue 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784
  1. <template>
  2. <basic-container>
  3. <div>
  4. <el-tabs
  5. v-model="activeType"
  6. :before-leave="beforeLeave"
  7. >
  8. <!-- 合同段信息 -->
  9. <el-tab-pane
  10. label="合同段信息"
  11. name="1"
  12. :disabled="btnLoad"
  13. >
  14. <div>
  15. <el-form
  16. :model="contractForm"
  17. :rules="contractRules"
  18. ref="contractForm"
  19. label-width="auto"
  20. >
  21. <el-form-item label="项目名称">
  22. <el-input
  23. v-model="projectInfo.projectName"
  24. disabled
  25. ></el-input>
  26. </el-form-item>
  27. <el-row>
  28. <el-col :span="12">
  29. <el-form-item
  30. label="合同段类型"
  31. prop="contractType"
  32. >
  33. <el-select
  34. :disabled="contractForm.id?true:false"
  35. v-model="contractForm.contractType"
  36. placeholder="请选择"
  37. class="w-100p"
  38. >
  39. <el-option
  40. v-for="item in contractTypeList"
  41. :key="item.id"
  42. :label="item.dictValue"
  43. :value="item.dictKey"
  44. ></el-option>
  45. </el-select>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="12">
  49. <el-form-item
  50. label="合同段编号"
  51. prop="contractNumber"
  52. >
  53. <el-input v-model="contractForm.contractNumber"></el-input>
  54. </el-form-item>
  55. </el-col>
  56. </el-row>
  57. <el-row>
  58. <el-col :span="12">
  59. <el-form-item
  60. label="合同段名称"
  61. prop="contractName"
  62. >
  63. <el-input v-model="contractForm.contractName"></el-input>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="12">
  67. <el-form-item
  68. label="参与方进场日期"
  69. prop="contractorJoinTime"
  70. >
  71. <el-date-picker
  72. v-model="contractForm.contractorJoinTime"
  73. type="date"
  74. format="yyyy 年 MM 月 dd 日"
  75. value-format="yyyy-MM-dd HH:mm:ss"
  76. placeholder="选择日期"
  77. ></el-date-picker>
  78. </el-form-item>
  79. </el-col>
  80. </el-row>
  81. <div class="flexBetween">
  82. <el-form-item
  83. :label="isShowDq?'是否开启电签':'认证设置'"
  84. prop="isElectronicSignature"
  85. >
  86. <el-radio-group v-model="contractForm.isElectronicSignature">
  87. <el-radio :label="0">关闭</el-radio>
  88. <el-radio :label="1">开启</el-radio>
  89. </el-radio-group>
  90. </el-form-item>
  91. <el-form-item
  92. label="模板引用"
  93. prop="templateType"
  94. >
  95. <el-radio-group v-model="contractForm.templateType">
  96. <el-radio :label="1">模板节点</el-radio>
  97. <el-radio :label="2">底层节点</el-radio>
  98. </el-radio-group>
  99. </el-form-item>
  100. <el-form-item
  101. label="是否开启试验模块"
  102. prop="isTestModule"
  103. >
  104. <el-radio-group v-model="contractForm.isTestModule">
  105. <el-radio :label="0">关闭</el-radio>
  106. <el-radio :label="1">开启</el-radio>
  107. </el-radio-group>
  108. </el-form-item>
  109. <el-form-item
  110. label="是否强制引用记录/报告编号:"
  111. prop="isTestRecord"
  112. v-if="contractForm.isTestModule === 1"
  113. >
  114. <el-radio-group v-model="contractForm.isTestRecord">
  115. <el-radio :label="0">关闭</el-radio>
  116. <el-radio :label="1">开启</el-radio>
  117. </el-radio-group>
  118. </el-form-item>
  119. <!-- <el-form-item
  120. style="width:25%;"
  121. label="是否开启复制数据"
  122. prop="isCopyData"
  123. v-if="contractForm.contractType==1"
  124. >
  125. <el-radio-group v-model="contractForm.isCopyData">
  126. <el-radio :label="0">否</el-radio>
  127. <el-radio :label="1">是</el-radio>
  128. </el-radio-group>
  129. </el-form-item>
  130. <div v-else style="width:25%;">
  131. </div> -->
  132. </div>
  133. <div class="flexBetween">
  134. <el-form-item
  135. style="width:50%;"
  136. label="是否引用编号"
  137. prop="isReferenceNumber"
  138. >
  139. <el-radio-group v-model="contractForm.isReferenceNumber">
  140. <el-radio :label="0">否</el-radio>
  141. <el-radio :label="1">是</el-radio>
  142. </el-radio-group>
  143. </el-form-item>
  144. <el-form-item
  145. style="width:50%;"
  146. label="是否允许超计"
  147. prop="isReferenceNumber"
  148. >
  149. <el-radio-group v-model="contractForm.isOverMeter">
  150. <el-radio :label="0">否</el-radio>
  151. <el-radio :label="1">是</el-radio>
  152. </el-radio-group>
  153. </el-form-item>
  154. </div>
  155. <el-row>
  156. <el-col :span="12">
  157. <el-form-item
  158. label="计划开工日期"
  159. prop="planStartTime"
  160. >
  161. <el-date-picker
  162. v-model="contractForm.planStartTime"
  163. type="date"
  164. format="yyyy 年 MM 月 dd 日"
  165. value-format="yyyy-MM-dd HH:mm:ss"
  166. placeholder="选择日期"
  167. ></el-date-picker>
  168. </el-form-item>
  169. </el-col>
  170. <el-col :span="12">
  171. <el-form-item
  172. label="计划完工日期"
  173. prop="planEndTime"
  174. >
  175. <el-date-picker
  176. v-model="contractForm.planEndTime"
  177. type="date"
  178. format="yyyy 年 MM 月 dd 日"
  179. value-format="yyyy-MM-dd HH:mm:ss"
  180. placeholder="选择日期"
  181. ></el-date-picker>
  182. </el-form-item>
  183. </el-col>
  184. </el-row>
  185. <el-row>
  186. <el-col :span="12">
  187. <el-form-item
  188. label="实际开工日期"
  189. prop="actualStartTime"
  190. >
  191. <el-date-picker
  192. v-model="contractForm.actualStartTime"
  193. type="date"
  194. format="yyyy 年 MM 月 dd 日"
  195. value-format="yyyy-MM-dd HH:mm:ss"
  196. placeholder="选择日期"
  197. ></el-date-picker>
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="12">
  201. <el-form-item
  202. label="实际完工日期"
  203. prop="actualEndTime"
  204. >
  205. <el-date-picker
  206. v-model="contractForm.actualEndTime"
  207. type="date"
  208. format="yyyy 年 MM 月 dd 日"
  209. value-format="yyyy-MM-dd HH:mm:ss"
  210. placeholder="选择日期"
  211. ></el-date-picker>
  212. </el-form-item>
  213. </el-col>
  214. </el-row>
  215. <el-row>
  216. <el-col :span="12">
  217. <el-form-item
  218. label="业主单位名称"
  219. v-if="contractForm.contractType==1"
  220. prop="contractorUnitName"
  221. >
  222. <el-input v-model="contractForm.contractorUnitName"></el-input>
  223. </el-form-item>
  224. <el-form-item
  225. v-if="contractForm.contractType==2"
  226. label="监理单位名称"
  227. prop="supervisionUnitName"
  228. >
  229. <el-input v-model="contractForm.supervisionUnitName"></el-input>
  230. </el-form-item>
  231. <el-form-item
  232. v-if="contractForm.contractType==3"
  233. label="建设单位名称"
  234. prop="contractorUnitName"
  235. >
  236. <el-input v-model="contractForm.contractorUnitName"></el-input>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="12">
  240. <el-form-item
  241. label="合同金额"
  242. prop="contractAmount"
  243. >
  244. <el-input v-model="contractForm.contractAmount">
  245. <template slot="append">万元</template>
  246. </el-input>
  247. </el-form-item>
  248. </el-col>
  249. <el-col :span="12" v-if="contractForm.contractType==2 || contractForm.contractType==3">
  250. <el-form-item label="试验室名称" prop="laboratoryName">
  251. <el-input v-model="contractForm.laboratoryName"></el-input>
  252. </el-form-item>
  253. </el-col>
  254. </el-row>
  255. <el-row v-if="contractForm.contractType==1">
  256. <el-col :span="12">
  257. <el-form-item
  258. label="施工单位名称"
  259. prop="constructionUnitName"
  260. >
  261. <el-input v-model="contractForm.constructionUnitName"></el-input>
  262. </el-form-item>
  263. </el-col>
  264. <el-col :span="12">
  265. <el-form-item
  266. label="上传开工令"
  267. prop="startFileUrl"
  268. >
  269. <template v-if="isBackShow">
  270. <el-link
  271. type="primary"
  272. @click="downloadFile"
  273. >开工令
  274. </el-link>
  275. <el-button
  276. @click="delFile"
  277. class="mg-l-10"
  278. style="color:red"
  279. type="text"
  280. icon="el-icon-circle-close"
  281. ></el-button>
  282. </template>
  283. <template v-else>
  284. <el-upload
  285. action="/api/blade-resource/oss/endpoint/put-file-attach"
  286. :on-remove="handleRemove"
  287. :limit="1"
  288. :headers=headers
  289. :on-exceed="handleExceed"
  290. :on-success="handleSuccess"
  291. :file-list="fileList"
  292. >
  293. <el-button
  294. size="small"
  295. type="primary"
  296. >点击上传
  297. </el-button>
  298. </el-upload>
  299. </template>
  300. </el-form-item>
  301. </el-col>
  302. </el-row>
  303. <el-row v-if="contractForm.contractType==1">
  304. <el-col :span="12">
  305. <el-form-item
  306. label="监理单位名称"
  307. prop="supervisionUnitName"
  308. >
  309. <el-input v-model="contractForm.supervisionUnitName"></el-input>
  310. </el-form-item>
  311. </el-col>
  312. <el-col :span="12">
  313. <el-form-item
  314. label="试验室名称"
  315. prop="laboratoryName"
  316. >
  317. <el-input v-model="contractForm.laboratoryName"></el-input>
  318. </el-form-item>
  319. </el-col>
  320. </el-row>
  321. <el-divider></el-divider>
  322. <el-row :gutter="20">
  323. <el-col
  324. :span="12"
  325. v-show="contractForm.contractType!=1"
  326. >
  327. <div class="head-font">合同段权限配置</div>
  328. <el-checkbox-group
  329. v-model="idList"
  330. class="martop15"
  331. >
  332. <el-checkbox
  333. :label="item.contractId"
  334. :key="key"
  335. v-for="(item,key) in checkList"
  336. >{{ item.contractName }}
  337. </el-checkbox>
  338. </el-checkbox-group>
  339. </el-col>
  340. <el-col :span="12">
  341. <div class="head-font">组卷归档默认信息</div>
  342. <el-row class="martop15">
  343. <el-col :span="12">
  344. <el-form-item
  345. label="立卷人"
  346. prop="filer"
  347. >
  348. <el-input v-model="contractForm.filer"></el-input>
  349. </el-form-item>
  350. </el-col>
  351. <el-col :span="12">
  352. <el-form-item
  353. label="保管期限"
  354. prop="storagePeriod"
  355. >
  356. <el-select
  357. v-model="contractForm.storagePeriod"
  358. placeholder="请选择"
  359. class="w-100p"
  360. >
  361. <el-option
  362. v-for="item in storagePeriodList"
  363. :key="item.id"
  364. :label="item.dictValue"
  365. :value="item.dictKey"
  366. ></el-option>
  367. </el-select>
  368. </el-form-item>
  369. </el-col>
  370. </el-row>
  371. <el-row>
  372. <el-col :span="12">
  373. <el-form-item
  374. label="审核人"
  375. prop="reviewer"
  376. >
  377. <el-input v-model="contractForm.reviewer"></el-input>
  378. </el-form-item>
  379. </el-col>
  380. <el-col :span="12">
  381. <el-form-item
  382. label="保管密级"
  383. prop="securityLevel"
  384. >
  385. <el-select
  386. v-model="contractForm.securityLevel"
  387. placeholder="请选择"
  388. class="w-100p"
  389. >
  390. <el-option
  391. v-for="item in securityLevelList"
  392. :key="item.id"
  393. :label="item.dictValue"
  394. :value="item.dictKey"
  395. ></el-option>
  396. </el-select>
  397. </el-form-item>
  398. </el-col>
  399. </el-row>
  400. <el-row>
  401. <el-col :span="12">
  402. <el-form-item
  403. label="档案前缀"
  404. prop="prefix"
  405. >
  406. <el-input v-model="contractForm.prefix"></el-input>
  407. </el-form-item>
  408. </el-col>
  409. <el-col :span="12">
  410. </el-col>
  411. </el-row>
  412. </el-col>
  413. <el-col :span="12" v-if="contractForm.contractType==1">
  414. <div class="head-font">附加信息</div>
  415. <el-form-item label="项目地址" prop="projectPlace">
  416. <!-- <el-input v-model="contractForm.projectPlace" placeholder="点击后面地图选取地址">
  417. <el-button slot="append" icon="el-icon-map-location" @click="mapDialogVisible = true"></el-button>
  418. </el-input> -->
  419. <avue-input-map :params="params" placeholder="请选择地图" v-model="flageData" @change="mapChange"></avue-input-map>
  420. </el-form-item>
  421. <el-form-item label="起始桩号" prop="startStation">
  422. <el-input v-model="contractForm.startStation"></el-input>
  423. </el-form-item>
  424. <el-form-item label="结束桩号" prop="endStation">
  425. <el-input v-model="contractForm.endStation"></el-input>
  426. </el-form-item>
  427. <el-form-item label="里程">
  428. <el-input v-model="contractForm.projectMileage">
  429. <template slot="append">公里(KM)</template>
  430. </el-input>
  431. </el-form-item>
  432. </el-col>
  433. </el-row>
  434. <el-divider></el-divider>
  435. <el-row >
  436. <el-col :span="24" style="overflow-x: auto;">
  437. <div class="head-font">计量信息</div>
  438. <table class="table-form" style="width: 100%; border: 1px solid #DCDFE6; font-size: 14px;" border="1" cellspacing="5" cellpadding="10">
  439. <tbody>
  440. <tr class=" bg bor">
  441. <td colspan="2">动员预付款</td>
  442. <td colspan="4">材料预付款</td>
  443. <td colspan="2">保留金信息</td>
  444. <td colspan="2">农民工工资保证金(元)</td>
  445. <td colspan="2">整体结算比例(%)</td>
  446. <td colspan="2">农民工工资专户</td>
  447. </tr>
  448. <tr >
  449. <td >
  450. 总额(元)
  451. </td>
  452. <td >
  453. <el-input v-model="meterContractInfo.dyTotalAmount" placeholder="请输入" type="number" :controls="false" :min="0"></el-input>
  454. </td>
  455. <td >
  456. 预付款限额(元)
  457. </td>
  458. <td >
  459. <el-input v-model="meterContractInfo.clAdvancePaymentQuota" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  460. </td>
  461. <td >
  462. 开户银行
  463. </td>
  464. <td >
  465. <el-input v-model="meterContractInfo.bankOfDeposit" placeholder="请输入" style="width: 180px;"></el-input>
  466. </td>
  467. <td >
  468. 保留金比列 (%)
  469. </td>
  470. <td >
  471. <el-input v-model="meterContractInfo.blReserveFundsRatio" placeholder="请输入" :controls="false" :min="0"></el-input type="number">
  472. </td>
  473. <td >
  474. 保证金起扣点(元)
  475. </td>
  476. <td >
  477. <el-input v-model="meterContractInfo.nmSdStartDeductPoint" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  478. </td>
  479. <td >
  480. 中期计量总体支付比例(%)
  481. </td>
  482. <td >
  483. <el-input v-model="meterContractInfo.middlePayRatio" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  484. </td>
  485. <td >
  486. 农民工工资专户 开户银行
  487. </td>
  488. <td >
  489. <el-input v-model="meterContractInfo.farmersBank" placeholder="请输入" ></el-input>
  490. </td>
  491. </tr>
  492. <tr >
  493. <td >
  494. 起扣点(元)
  495. </td>
  496. <td >
  497. <el-input v-model="meterContractInfo.dyStartDeductPoint" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  498. </td>
  499. <td >
  500. 隔几期扣回 (期)
  501. </td>
  502. <td >
  503. <el-input v-model="meterContractInfo.clIntervalDeduct" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  504. </td>
  505. <td >
  506. 银行账号
  507. </td>
  508. <td >
  509. <el-input v-model="meterContractInfo.bankAccountNumber" placeholder="请输入" ></el-input>
  510. </td>
  511. <td >
  512. 起扣点(元)
  513. </td>
  514. <td >
  515. <el-input v-model="meterContractInfo.blStartDeductPoint" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  516. </td>
  517. <td >
  518. 保证金比列 (%)
  519. </td>
  520. <td>
  521. <el-input v-model="meterContractInfo.nmSdRatio" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  522. </td>
  523. <td >
  524. 7d强度支付比例 (%)
  525. </td>
  526. <td>
  527. <el-input v-model="meterContractInfo.sevenRatio" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  528. </td>
  529. <td >
  530. 农民工工资专户 银行账号
  531. </td>
  532. <td >
  533. <el-input v-model="meterContractInfo.farmersBankAccountNumber" placeholder="请输入" ></el-input>
  534. </td>
  535. </tr>
  536. <tr >
  537. <td >
  538. 全额扣回点(元)
  539. </td>
  540. <td >
  541. <el-input type="number" v-model="meterContractInfo.dyFullDeductPoint" placeholder="请输入" :controls="false" :min="0"></el-input>
  542. </td>
  543. <td >
  544. 从第几期起扣 (期)
  545. </td>
  546. <td >
  547. <el-input v-model="meterContractInfo.clFromIntervalDeduct" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  548. </td>
  549. <td >
  550. 银行账户名称
  551. </td>
  552. <td >
  553. <el-input v-model="meterContractInfo.bankAccountName" placeholder="请输入"></el-input>
  554. </td>
  555. <td >
  556. 累计扣回限额(元)
  557. </td>
  558. <td >
  559. <el-input v-model="meterContractInfo.blTotalDeductQuota" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  560. </td>
  561. <td >
  562. 保证金扣回限额(元)
  563. </td>
  564. <td>
  565. <el-input v-model="meterContractInfo.nmTotalDeductQuota" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  566. </td>
  567. <td >
  568. 28d强度支付比例 (%)
  569. </td>
  570. <td>
  571. <el-input v-model="meterContractInfo.twentyEightRatio" placeholder="请输入" :controls="false" :min="0" type="number"></el-input>
  572. </td>
  573. <td >
  574. 农民工工资专户 银行账户名称
  575. </td>
  576. <td >
  577. <el-input v-model="meterContractInfo.farmersBankAccountName" placeholder="请输入" ></el-input>
  578. </td>
  579. </tr>
  580. <tr>
  581. <td rowspan="2">扣回比列(%)</td>
  582. <td rowspan="2"> <el-input v-model="meterContractInfo.dyDeductRatio" placeholder="请输入" class="maxinp" :controls="false" :min="0" type="number"></el-input></td>
  583. <td >预付款比列 (%)</td>
  584. <td colspan="3"> <el-input v-model="meterContractInfo.clPrepaymentRatio" placeholder="请输入" :controls="false" :min="0" type="number"></el-input></td>
  585. <td>预扣农民工工资保证金(元)</td>
  586. <td > <el-input v-model="meterContractInfo.nmPayDepositWithheld" placeholder="请输入" :controls="false" :min="0" type="number"></el-input></td>
  587. </tr>
  588. <tr>
  589. <td >扣回比列 (%)</td>
  590. <td colspan="5"><el-input v-model="meterContractInfo.clDeductRatio" placeholder="请输入" :controls="false" :min="0" type="number"></el-input></td>
  591. </tr>
  592. </tbody>
  593. </table>
  594. </el-col>
  595. </el-row>
  596. </el-form>
  597. </div>
  598. </el-tab-pane>
  599. <el-tab-pane
  600. v-if="contractForm.contractType == 1"
  601. label="分配WBS"
  602. name="2"
  603. :disabled="btnLoad"
  604. >
  605. <div>
  606. <div
  607. v-if="!wbsId"
  608. class="text-align-c"
  609. >项目暂未分配wbs树
  610. </div>
  611. <tree-tree
  612. :left-tree-data="leftTreeData"
  613. ref="treetotree"
  614. @onAddTree="treeChang"
  615. @onDelTree="treeChang"
  616. :leftloading="leftloading"
  617. :rightloading="rightloading"
  618. :isNoAdd="contractForm.templateType == 2"
  619. ></tree-tree>
  620. </div>
  621. </el-tab-pane>
  622. <el-tab-pane
  623. label="分配项目人员"
  624. name="3"
  625. :disabled="btnLoad"
  626. >
  627. <div>
  628. <div class="flex jc-al-c">
  629. <span class="mg-r-10">项目名称</span>
  630. <el-input
  631. v-model="projectInfo.projectName"
  632. disabled
  633. style="width:300px;margin-right:30px;"
  634. ></el-input>
  635. <span class="mg-r-10">合同段名称</span>
  636. <el-input
  637. v-model="contractForm.contractName"
  638. disabled
  639. style="width:300px;"
  640. ></el-input>
  641. </div>
  642. <el-divider></el-divider>
  643. <div class="flex jc-al-c mg-b-10">
  644. <div>
  645. <span class="mg-r-10">角色方</span>
  646. <el-radio-group v-model="rId">
  647. <el-radio-button
  648. v-for="(item,key) in roleList"
  649. :label="item.id"
  650. :key="key"
  651. >{{ item.roleName }}
  652. </el-radio-button>
  653. </el-radio-group>
  654. </div>
  655. <div>
  656. <span class="mg-r-10 mg-l-20">请选择岗位</span>
  657. <el-select
  658. v-model="postId"
  659. filterable
  660. placeholder="请输入搜索"
  661. >
  662. <el-option
  663. v-for="item in postList"
  664. :key="item.id"
  665. :label="item.roleName"
  666. :value="item.id"
  667. ></el-option>
  668. </el-select>
  669. </div>
  670. </div>
  671. <!-- table表 -->
  672. <div>
  673. <el-table
  674. :data="contractUserList"
  675. border
  676. height="420"
  677. style="width: 100%"
  678. >
  679. <el-table-column
  680. prop="name"
  681. label="姓名"
  682. align="center"
  683. ></el-table-column>
  684. <el-table-column
  685. prop="account"
  686. label="登录账号"
  687. align="center"
  688. ></el-table-column>
  689. <el-table-column
  690. prop="password"
  691. label="密码"
  692. align="center"
  693. ></el-table-column>
  694. <el-table-column
  695. label="操作"
  696. align="center"
  697. >
  698. <template slot-scope="scope">
  699. <el-link
  700. class="mg-r-20"
  701. type="primary"
  702. @click="copyAccPas(scope.row)"
  703. >复制
  704. </el-link>
  705. <el-link
  706. class="mg-r-20"
  707. type="primary"
  708. @click="resetPassword(scope.row)"
  709. >重置密码
  710. </el-link>
  711. <el-link
  712. type="danger"
  713. @click="handleDelete(scope.$index, scope.row)"
  714. >删除
  715. </el-link>
  716. </template>
  717. </el-table-column>
  718. </el-table>
  719. <el-input
  720. v-model="copyText"
  721. ref="copyInput"
  722. type="textarea"
  723. style='opacity: 0;position: absolute;height:1px;overflow:hidden;'
  724. ></el-input>
  725. </div>
  726. <div class="martop10 flexEnd">
  727. <el-pagination
  728. background
  729. @size-change="handleSizeChange"
  730. @current-change="handleCurrentChange"
  731. :current-page.sync="pageindx"
  732. :page-size="pagesize"
  733. layout="total, prev, pager, next"
  734. :total="total"
  735. >
  736. </el-pagination>
  737. </div>
  738. <div class="flex jc-al-c mg-t-20">
  739. <span>添加项目人员</span>
  740. <el-select
  741. class="marleft10"
  742. v-model="userId"
  743. filterable
  744. placeholder="请输入搜索"
  745. >
  746. <el-option
  747. v-for="item in userList"
  748. :key="item.id"
  749. :label="item.name"
  750. :value="item.id"
  751. ></el-option>
  752. </el-select>
  753. <el-button
  754. class="marleft10"
  755. type="success"
  756. @click="addUserToProject"
  757. >添加
  758. </el-button>
  759. <el-button
  760. type="primary"
  761. @click="rputerPush()"
  762. >创建新用户
  763. </el-button>
  764. <el-button
  765. type="danger"
  766. @click="handleDeletes"
  767. >全部删除
  768. </el-button>
  769. </div>
  770. <el-divider></el-divider>
  771. </div>
  772. </el-tab-pane>
  773. </el-tabs>
  774. <div class="flexEnd marbottom20">
  775. <el-button
  776. :type="activeType != 3?'info':'success'"
  777. size="medium"
  778. :disabled="saveBtnDisabled || leftloading || rightloading"
  779. :loading="saveBtnLoad"
  780. @click="saveQuit"
  781. >保存并退出</el-button>
  782. <el-button
  783. type="info"
  784. size="medium"
  785. :disabled="saveBtnBackDisabled || leftloading || rightloading"
  786. :loading="saveBtnBackLoad"
  787. v-if="activeType != 1"
  788. @click="saveNext('p')"
  789. >保存并返回上一步</el-button>
  790. <el-button
  791. type="success"
  792. size="medium"
  793. :disabled="saveBtnNextDisabled || leftloading || rightloading"
  794. :loading="saveBtnNextLoad"
  795. v-if="activeType != 3"
  796. @click="saveNext('n')"
  797. >保存并进入下一步</el-button>
  798. </div>
  799. </div>
  800. </basic-container>
  801. </template>
  802. <script>
  803. import {getProjectDeatil, findProjectTree, treeAllConstruction, getContractRelation} from "@/api/manager/projectinfo";
  804. import {
  805. submitContractInfo,
  806. getContractInfo,
  807. getContractInfo2,
  808. delFileFromUrl,
  809. searchRole,
  810. findAllUserByCondition,
  811. findUserList,
  812. saveUserInfoByProjectTow,
  813. removeUsersByIds,
  814. resetPasswordByUserId,
  815. submitWbsTreeInContract,
  816. getContractInfoTree
  817. } from "@/api/manager/contractinfo";
  818. import {getDictionary} from "@/api/system/dict";
  819. import {getDictionary as getDictbiz} from "@/api/system/dictbiz";
  820. import {remove as removeFile} from "@/api/resource/attach";
  821. import website from '@/config/website';
  822. import {Base64} from 'js-base64';
  823. import {getToken} from '@/util/auth';
  824. import {mapGetters} from "vuex";
  825. import treeTree from "@/components/tree-tree/main"
  826. export default {
  827. components: {
  828. treeTree
  829. },
  830. data() {
  831. var checkPlace = (rule, value, callback) => {
  832. if (this.flageData && this.flageData.length > 2 && this.flageData[2]) {
  833. callback();
  834. } else {
  835. callback(new Error('请选取项目地址'));
  836. }
  837. }
  838. var checkDate = (rule, value, callback) => {
  839. if (value && this.contractForm.planStartTime) {
  840. if (Date.parse(value) < Date.parse(this.contractForm.planStartTime)) {
  841. callback(new Error('计划完工日期不能小于开工日期'));
  842. }
  843. }
  844. callback();
  845. };
  846. var checkDate2 = (rule, value, callback) => {
  847. if (value && this.contractForm.actualStartTime) {
  848. if (Date.parse(value) < Date.parse(this.contractForm.actualStartTime)) {
  849. callback(new Error('实际完工日期不能小于开工日期'));
  850. }
  851. }
  852. callback();
  853. };
  854. var checkIsNumber = (rule, value, callback) => {
  855. if (value != Number(value)) {
  856. callback(new Error('金额必须是数字'));
  857. }
  858. callback();
  859. };
  860. return {
  861. isShowDq: true,
  862. idList: [],
  863. checkList: [],
  864. postIdss: '',
  865. //#region
  866. pageindx: 1,
  867. pagesize: 10,
  868. total: 0,
  869. //#endregion
  870. activeType: '1',
  871. typeChang: {
  872. 1: false,
  873. 2: false,
  874. 3: false,
  875. },
  876. btnLoad: false,
  877. saveBtnLoad: false,
  878. saveBtnDisabled: false,
  879. saveBtnBackLoad: false,
  880. saveBtnBackDisabled: false,
  881. saveBtnNextLoad: false,
  882. saveBtnNextDisabled: false,
  883. pid: '',
  884. cid: '',
  885. projectInfo: {},
  886. contractTypeList: [],
  887. storagePeriodList: [],//保管期限
  888. securityLevelList: [],//保管密级
  889. fileList: [],
  890. headers: {},
  891. isBackShow: false,
  892. contractForm: {
  893. contractType: 1,
  894. contractAmount: 0,
  895. isElectronicSignature: 0,
  896. isTestModule: 0,
  897. isReferenceNumber: 0,
  898. isOverMeter:0
  899. // isCopyData: 0,
  900. },
  901. contractRules: {
  902. contractName: [
  903. {required: true, message: '请输入合同段名称', trigger: 'blur'},
  904. ],
  905. contractType: [
  906. {required: true, message: '请选择合同段类型', trigger: 'change'}
  907. ],
  908. contractNumber: [
  909. {required: true, message: '请输入合同段编号', trigger: 'blur'},
  910. ],
  911. isElectronicSignature: [
  912. {required: true, message: '请设置电签状态', trigger: 'change'},
  913. ],
  914. isTestModule: [
  915. {required: true, message: '请设置试验模块状态', trigger: 'change'},
  916. ],
  917. isTestRecord: [
  918. {required: true, message: '请设置是否强制引用记录/报告编号', trigger: 'change'},
  919. ],
  920. isReferenceNumber: [
  921. {required: true, message: '请设置是否引用编号', trigger: 'change'},
  922. ],
  923. // isCopyData: [
  924. // {required: true, message: '请设置是否复制数据', trigger: 'change'},
  925. // ],
  926. contractorUnitName: [
  927. {required: true, message: '请输入业主单位名称', trigger: 'blur'},
  928. ],
  929. constructionUnitName: [
  930. {required: true, message: '请输入施工单位名称', trigger: 'blur'},
  931. ],
  932. supervisionUnitName: [
  933. {required: true, message: '请输入监理单位名称', trigger: 'blur'},
  934. ],
  935. startStation: [
  936. {required: true, message: '请输入起始桩号', trigger: 'blur'},
  937. ],
  938. endStation: [
  939. {required: true, message: '请输入结束桩号', trigger: 'blur'},
  940. ],
  941. isOverMeter: [
  942. {required: true, message: '选择是否允许超计', trigger: 'blur'},
  943. ],
  944. projectPlace: [
  945. {required: true, validator: checkPlace, trigger: 'blur'},
  946. ],
  947. planEndTime: [
  948. {validator: checkDate, trigger: 'blur'},
  949. ],
  950. actualEndTime: [
  951. {validator: checkDate2, trigger: 'blur'},
  952. ],
  953. contractAmount: [
  954. {validator: checkIsNumber, trigger: 'blur'}
  955. ],
  956. templateType: [
  957. { required: true, message: '请选择模板引用', trigger: 'blur' },
  958. ]
  959. },
  960. mapDialogVisible: false,
  961. params: {
  962. zoom: 10,
  963. // zoomEnable: false,
  964. // dragEnable: false,
  965. },
  966. flageData: [],
  967. rId: '',
  968. roleList: [],
  969. postId: '',
  970. postList: [],
  971. contractUserList: [],
  972. userId: '',
  973. userList: [],
  974. copyText: '',
  975. wbsId: '',
  976. leftTreeData: [],
  977. leftloading:false,
  978. rightloading:false,
  979. meterContractInfo:{
  980. dyStartDeductPoint:null,
  981. dyTotalAmount:null,
  982. clAdvancePaymentQuota:null,
  983. bankOfDeposit:null,
  984. blReserveFundsRatio:null,
  985. nmSdStartDeductPoint:null,
  986. clIntervalDeduct:null,
  987. bankAccountNumber:null,
  988. blStartDeductPoint:null,
  989. nmSdRatio:null,
  990. dyFullDeductPoint:null,
  991. clFromIntervalDeduct:null,
  992. bankAccountName:null,
  993. blTotalDeductQuota:null,
  994. nmTotalDeductQuota:null,
  995. dyDeductRatio:null,
  996. clPrepaymentRatio:null,
  997. nmPayDepositWithheld:null,
  998. clDeductRatio:null,
  999. farmersBankAccountName:null,
  1000. farmersBankAccountNumber:null,
  1001. farmersBank:null,
  1002. middlePayRatio:null,
  1003. sevenRatio: null,
  1004. twentyEightRatio: null,
  1005. }//计量合同段管理相关信息
  1006. }
  1007. },
  1008. computed: {
  1009. ...mapGetters(["userInfo"]),
  1010. },
  1011. watch: {
  1012. contractForm: {
  1013. handler: function () { // 此处注意,handler函数不能为箭头函数,this会取上下文,而不是组件里的this,此外,深度监听,必须为handler函数名,否则会无效果
  1014. this.typeChang['1'] = true;
  1015. },
  1016. deep: true
  1017. },
  1018. activeType: async function (newValue) {
  1019. if (newValue == '3') {
  1020. this.getUserByName();
  1021. this.searchRole()
  1022. } else if (newValue == '2') {
  1023. await this.getLeftTree();
  1024. this.getRightTree();
  1025. }
  1026. },
  1027. rId: function () {
  1028. this.postIdss = ''
  1029. this.postId = ''
  1030. this.contractUserList = [];//从超级管理员,切到其他角色,不会清空列表
  1031. this.roleList.forEach(val => {
  1032. if (val.id === this.rId) {
  1033. if (val.children) {
  1034. this.postList = val.children
  1035. this.postId = this.postList[0].id;//切换的时候默认选中第一个岗位
  1036. } else {
  1037. this.postList = []
  1038. }
  1039. if (val.roleName === '超级管理员') {
  1040. this.postIdss = this.rId
  1041. this.findAllUserByCondition(this.rId)
  1042. }
  1043. }
  1044. })
  1045. },
  1046. postId: function (newValue) {
  1047. if (newValue) {
  1048. this.findAllUserByCondition();
  1049. } else {
  1050. this.contractUserList = [];
  1051. }
  1052. },
  1053. 'contractForm.contractType'(newValue) {
  1054. if (newValue != 1) {
  1055. this.treeAllConstruction()
  1056. }
  1057. }
  1058. },
  1059. created() {
  1060. this.init();
  1061. //console.log(this.userInfo)
  1062. let hostName= window.location.hostname;
  1063. console.log(hostName,'hostName');
  1064. if(hostName==='183.247.216.148'){
  1065. this.isShowDq=false//183显示认证设置
  1066. }else{
  1067. this.isShowDq=true
  1068. }
  1069. },
  1070. mounted() {
  1071. this.$nextTick(() => {
  1072. this.typeChang = {
  1073. 1: false,
  1074. 2: false,
  1075. 3: false,
  1076. }
  1077. })
  1078. },
  1079. methods: {
  1080. //#region //后加分页
  1081. handleSizeChange(val) {
  1082. this.pagesize = val
  1083. this.findAllUserByCondition()
  1084. },
  1085. handleCurrentChange(val) {
  1086. this.pageindx = val
  1087. this.findAllUserByCondition()
  1088. },
  1089. rputerPush() {
  1090. this.$router.push({
  1091. path: '/system/user',
  1092. query: {tankai: true}
  1093. })
  1094. },
  1095. //#endregion
  1096. //#region 甘云杰
  1097. async searchRole() {
  1098. const {data: res} = await searchRole()
  1099. console.log(res);
  1100. if (res.code === 200) {
  1101. this.roleList = res.data
  1102. }
  1103. },
  1104. async init() {
  1105. this.pid = this.$route.query.pid;
  1106. this.cid = this.$route.query.cid;
  1107. this.contractForm.contractType=this.$route.query.contractType
  1108. await this.getContractTypeList();//获取合同类型
  1109. if (!this.cid) {
  1110. this.contractForm.pid = this.pid;
  1111. } else {
  1112. if (this.$route.query.contractType == 1 || this.$route.query.contractType == 4 || this.$route.query.contractType == 8) {
  1113. await this.getContractInfo();//获取合同段基本信息
  1114. } else if (this.$route.query.contractType == 2 || this.$route.query.contractType == 3) {
  1115. await this.getContractInfo2()
  1116. await this.getContractRelation(); //监理、业主关联施工
  1117. }
  1118. }
  1119. await this.getProjectDeatil();//获取项目详情
  1120. if (this.$route.query.type) {
  1121. console.log(this.$route.query.type);
  1122. this.activeType = this.$route.query.type;
  1123. }
  1124. this.getStoragePeriodList();//获取业务字典
  1125. this.getSecurityLevelList();//获取安全等级
  1126. this.setHeaders();
  1127. },
  1128. beforeLeave(activeName, oldActiveName) {
  1129. return new Promise((resolve, reject) => {
  1130. if (oldActiveName == '1' && !this.contractForm.id) {
  1131. this.$message({
  1132. type: "warning",
  1133. message: "请先保存合同段后,再进行合同段的分配"
  1134. });
  1135. reject();
  1136. }
  1137. if (this.typeChang[oldActiveName]) {
  1138. this.$confirm('检测到新编辑内容, 是否保存?', '提示', {
  1139. confirmButtonText: '确定',
  1140. cancelButtonText: '不用',
  1141. type: 'warning'
  1142. }).then(() => {
  1143. switch (oldActiveName) {
  1144. case '1':
  1145. this.savecontract().then((res) => {
  1146. this.contractForm.id = res.data.data.id;
  1147. this.typeChang[oldActiveName] = false;
  1148. resolve();
  1149. this.$message({
  1150. type: "success",
  1151. message: "保存成功!"
  1152. });
  1153. });
  1154. break;
  1155. case '2':
  1156. this.saveWbsTree().then(() => {
  1157. this.typeChang[oldActiveName] = false;
  1158. resolve();
  1159. this.$message({
  1160. type: "success",
  1161. message: "保存成功!"
  1162. });
  1163. }).catch(() => {
  1164. this.getRightTree();
  1165. reject();
  1166. })
  1167. break;
  1168. }
  1169. }).catch(() => {
  1170. this.typeChang[oldActiveName] = false;
  1171. resolve();
  1172. })
  1173. } else {
  1174. resolve();
  1175. }
  1176. })
  1177. },
  1178. getProjectDeatil() {
  1179. return new Promise((resolve) => {
  1180. getProjectDeatil(this.pid).then((res) => {
  1181. this.projectInfo = res.data.data;
  1182. this.wbsId = this.projectInfo.referenceWbsTemplateId;
  1183. resolve();
  1184. }).finally(() => {
  1185. resolve();
  1186. })
  1187. })
  1188. },
  1189. getContractRelation() {
  1190. return new Promise((resolve) => {
  1191. getContractRelation(this.cid).then((res) => {
  1192. console.log("ids", res)
  1193. this.idList = res.data.data && res.data.data.map(item => {
  1194. return item.id
  1195. })
  1196. resolve();
  1197. }).finally(() => {
  1198. resolve();
  1199. })
  1200. })
  1201. },
  1202. getContractInfo() {
  1203. return new Promise((resolve) => {
  1204. getContractInfo(this.cid).then((res) => {
  1205. this.contractForm = res.data.data;
  1206. if (this.contractForm.startFileUrl) {
  1207. this.isBackShow = true;
  1208. }
  1209. if (this.contractForm.projectPlace) {
  1210. this.flageData = ['', '', this.contractForm.projectPlace]
  1211. }
  1212. if (Number(this.contractForm.contractAmount) < 0) {
  1213. this.contractForm.contractAmount = 0;
  1214. }
  1215. if (Number(this.contractForm.securityLevel) < 0) {
  1216. this.contractForm.securityLevel = 0;
  1217. }
  1218. if (Number(this.contractForm.storagePeriod) < 0) {
  1219. this.contractForm.storagePeriod = 0;
  1220. }
  1221. this.meterContractInfo = this.contractForm.meterContractInfo
  1222. ||{
  1223. dyStartDeductPoint:null,
  1224. dyTotalAmount:null,
  1225. clAdvancePaymentQuota:null,
  1226. bankOfDeposit:null,
  1227. blReserveFundsRatio:null,
  1228. nmSdStartDeductPoint:null,
  1229. clIntervalDeduct:null,
  1230. bankAccountNumber:null,
  1231. blStartDeductPoint:null,
  1232. nmSdRatio:null,
  1233. dyFullDeductPoint:null,
  1234. clFromIntervalDeduct:null,
  1235. bankAccountName:null,
  1236. blTotalDeductQuota:null,
  1237. nmTotalDeductQuota:null,
  1238. dyDeductRatio:null,
  1239. clPrepaymentRatio:null,
  1240. nmPayDepositWithheld:null,
  1241. clDeductRatio:null,
  1242. farmersBankAccountName:null,
  1243. farmersBankAccountNumber:null,
  1244. farmersBank:null,
  1245. middlePayRatio:null,
  1246. sevenRatio: null,
  1247. twentyEightRatio: null,
  1248. }
  1249. this.$nextTick(() => {
  1250. this.typeChang['1'] = false;
  1251. })
  1252. }).finally(() => {
  1253. resolve();
  1254. })
  1255. })
  1256. },
  1257. getContractInfo2() {
  1258. return new Promise((resolve) => {
  1259. getContractInfo2({id: this.cid, contractType: this.contractType}).then((res) => {
  1260. this.contractForm = res.data.data.contractInfo
  1261. if (res.data.data.wbsTreeContractList.length > 0) {
  1262. this.idList = []
  1263. res.data.data.wbsTreeContractList.forEach(val => {
  1264. if (val.contractIdRelation) {
  1265. this.idList.push(val.contractIdRelation)
  1266. }
  1267. })
  1268. }
  1269. if (this.contractForm.startFileUrl) {
  1270. this.isBackShow = true;
  1271. }
  1272. if (this.contractForm.projectPlace) {
  1273. this.flageData = ['', '', this.contractForm.projectPlace]
  1274. }
  1275. if (Number(this.contractForm.contractAmount) < 0) {
  1276. this.contractForm.contractAmount = 0;
  1277. }
  1278. if (Number(this.contractForm.securityLevel) < 0) {
  1279. this.contractForm.securityLevel = 0;
  1280. }
  1281. if (Number(this.contractForm.storagePeriod) < 0) {
  1282. this.contractForm.storagePeriod = 0;
  1283. }
  1284. this.meterContractInfo=res.data.data.meterContractInfo
  1285. ||{
  1286. dyStartDeductPoint:null,
  1287. dyTotalAmount:null,
  1288. clAdvancePaymentQuota:null,
  1289. bankOfDeposit:null,
  1290. blReserveFundsRatio:null,
  1291. nmSdStartDeductPoint:null,
  1292. clIntervalDeduct:null,
  1293. bankAccountNumber:null,
  1294. blStartDeductPoint:null,
  1295. nmSdRatio:null,
  1296. dyFullDeductPoint:null,
  1297. clFromIntervalDeduct:null,
  1298. bankAccountName:null,
  1299. blTotalDeductQuota:null,
  1300. nmTotalDeductQuota:null,
  1301. dyDeductRatio:null,
  1302. clPrepaymentRatio:null,
  1303. nmPayDepositWithheld:null,
  1304. clDeductRatio:null,
  1305. farmersBankAccountName:null,
  1306. farmersBankAccountNumber:null,
  1307. farmersBank:null,
  1308. middlePayRatio:null,
  1309. sevenRatio: null,
  1310. twentyEightRatio: null,
  1311. }
  1312. this.$nextTick(() => {
  1313. this.typeChang['1'] = false;
  1314. })
  1315. }).finally(() => {
  1316. resolve();
  1317. })
  1318. })
  1319. },
  1320. async saveQuit() {
  1321. this.btnLoad = true;
  1322. this.saveBtnLoad = true;
  1323. this.saveBtnBackDisabled = true
  1324. this.saveBtnNextDisabled = true
  1325. try {
  1326. if (this.activeType == '1') {
  1327. await this.savecontract();
  1328. } else if (this.activeType == '2') {
  1329. await this.saveWbsTree();
  1330. }
  1331. } catch (error) {
  1332. this.btnLoad = false;
  1333. this.saveBtnLoad = false;
  1334. this.saveBtnBackDisabled = false
  1335. this.saveBtnNextDisabled = false
  1336. if(this.activeType == '2'){
  1337. this.getRightTree();
  1338. }
  1339. return;
  1340. }
  1341. this.$message({
  1342. type: "success",
  1343. message: "保存成功!"
  1344. });
  1345. this.btnLoad = false;
  1346. this.saveBtnLoad = false;
  1347. this.saveBtnBackDisabled = false
  1348. this.saveBtnNextDisabled = false
  1349. this.$router.go(-1);
  1350. },
  1351. async saveNext(type) {
  1352. this.btnLoad = true;
  1353. if (type == 'n') {
  1354. this.saveBtnNextLoad = true;
  1355. this.saveBtnBackDisabled = true
  1356. this.saveBtnDisabled = true
  1357. } else if (type == 'p') {
  1358. this.saveBtnBackLoad = true;
  1359. this.saveBtnNextDisabled = true
  1360. this.saveBtnDisabled = true
  1361. }
  1362. try {
  1363. if (this.activeType == '1') {
  1364. let res = await this.savecontract();
  1365. this.contractForm.id = res.data.data.id;
  1366. } else if (this.activeType == '2') {
  1367. await this.saveWbsTree();
  1368. }
  1369. } catch (error) {
  1370. this.btnLoad = false;
  1371. if (type == 'n') {
  1372. this.saveBtnNextLoad = false;
  1373. this.saveBtnBackDisabled = false
  1374. this.saveBtnDisabled = false
  1375. } else if (type == 'p') {
  1376. this.saveBtnBackLoad = false;
  1377. this.saveBtnNextDisabled = false
  1378. this.saveBtnDisabled = false
  1379. }
  1380. if(this.activeType == '2'){
  1381. this.getRightTree();
  1382. }
  1383. return;
  1384. }
  1385. this.$message({
  1386. type: "success",
  1387. message: "保存成功!"
  1388. });
  1389. this.typeChang[this.activeType] = false;
  1390. let num = Number(this.activeType);
  1391. if (this.contractForm.contractType == 1) {
  1392. if (type == 'n') {
  1393. num++;
  1394. } else if (type == 'p') {
  1395. num--;
  1396. }
  1397. } else {
  1398. if (type == 'n') {
  1399. num = num + 2;
  1400. } else if (type == 'p') {
  1401. num = num - 2
  1402. }
  1403. }
  1404. this.activeType = num.toString();
  1405. this.btnLoad = false;
  1406. if (type == 'n') {
  1407. this.saveBtnNextLoad = false;
  1408. this.saveBtnBackDisabled = false
  1409. this.saveBtnDisabled = false
  1410. } else if (type == 'p') {
  1411. this.saveBtnBackLoad = false;
  1412. this.saveBtnNextDisabled = false
  1413. this.saveBtnDisabled = false
  1414. }
  1415. },
  1416. getIds() {
  1417. },
  1418. savecontract() {
  1419. return new Promise((resolve, reject) => {
  1420. this.$refs['contractForm'].validate((valid) => {
  1421. if (valid) {
  1422. if (this.flageData.length == 3) {
  1423. this.contractForm.projectPlace = this.flageData[2];
  1424. }
  1425. let das = this.contractForm
  1426. das.meterContractInfo = this.meterContractInfo
  1427. if (this.contractForm.contractType != 1) {
  1428. delete das.startStation
  1429. delete das.endStation
  1430. delete das.projectPlace
  1431. das.idList = []
  1432. this.idList.forEach(val => {
  1433. das.idList.push({contractId: val})
  1434. })
  1435. resolve(submitContractInfo(das))
  1436. this.btnLoad = false
  1437. } else {
  1438. resolve(submitContractInfo(das))
  1439. this.btnLoad = false
  1440. }
  1441. } else {
  1442. reject('验证失败')
  1443. this.btnLoad = false
  1444. }
  1445. })
  1446. })
  1447. },
  1448. handleRemove(file) {
  1449. //console.log(file, fileList);
  1450. removeFile(file.response.data.attachId).then(() => {
  1451. this.contractForm.startFileUrl = '';
  1452. })
  1453. },
  1454. handleExceed() {
  1455. this.$message.warning(`当前限制选择 1 个文件,请先移除后,再次上传`);
  1456. },
  1457. handleSuccess(res) {
  1458. this.contractForm.startFileUrl = res.data.link;
  1459. },
  1460. setHeaders() {
  1461. this.headers['Authorization'] = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`;
  1462. this.headers[website.tokenHeader] = 'bearer ' + getToken()
  1463. },
  1464. downloadFile() {
  1465. window.open(this.contractForm.startFileUrl);
  1466. },
  1467. delFile() {
  1468. this.$confirm('是否删除该文件?', '删除开工令', {
  1469. distinguishCancelAndClose: true,
  1470. confirmButtonText: '删除',
  1471. cancelButtonText: '取消'
  1472. }).then(() => {
  1473. delFileFromUrl(this.contractForm.startFileUrl).then(() => {
  1474. this.isBackShow = false;
  1475. this.contractForm.startFileUrl = '';
  1476. })
  1477. })
  1478. },
  1479. addUserToProject() {
  1480. if (!this.userId) {
  1481. this.$message({
  1482. type: "warning",
  1483. message: "请先选择用户再进行添加"
  1484. });
  1485. return;
  1486. }
  1487. let roleId = ''
  1488. if (!this.postIdss) {
  1489. if (!this.postId) {
  1490. this.$message({
  1491. type: "warning",
  1492. message: "请先选择岗位再进行添加"
  1493. });
  1494. return;
  1495. } else {
  1496. roleId = this.postId
  1497. }
  1498. } else {
  1499. roleId = this.postIdss
  1500. }
  1501. let list = [{
  1502. projectId: this.pid,
  1503. contractId: this.contractForm.id,
  1504. userId: this.userId,
  1505. roleId: roleId,
  1506. }];
  1507. saveUserInfoByProjectTow(list).then(() => {
  1508. this.findAllUserByCondition(this.rId);
  1509. })
  1510. },
  1511. findAllUserByCondition(val) {
  1512. let rId
  1513. if (this.postId) {
  1514. rId = this.postId
  1515. } else {
  1516. rId = val
  1517. }
  1518. findAllUserByCondition({
  1519. cId: this.contractForm.id,
  1520. pId: this.pid,
  1521. // "postId": this.postId,
  1522. rId: rId,
  1523. },
  1524. this.pagesize,
  1525. this.pageindx,
  1526. ).then((res) => {
  1527. this.contractUserList = res.data.data.records;
  1528. this.total = res.data.data.total
  1529. })
  1530. },
  1531. handleDelete(index, row) {
  1532. this.$confirm('是否将该用户移除出合同段', '提示', {
  1533. confirmButtonText: '确定',
  1534. cancelButtonText: '取消',
  1535. type: 'warning'
  1536. }).then(() => {
  1537. removeUsersByIds(row.id).then(() => {
  1538. this.contractUserList.splice(index, 1);
  1539. this.$message({
  1540. type: "success",
  1541. message: "删除成功!"
  1542. });
  1543. })
  1544. })
  1545. },
  1546. handleDeletes() {
  1547. this.$confirm('是否将所有用户移除出合同段', '提示', {
  1548. confirmButtonText: '确定',
  1549. cancelButtonText: '取消',
  1550. type: 'warning'
  1551. }).then(() => {
  1552. let ids = [];
  1553. this.contractUserList.forEach((element) => {
  1554. ids.push(element.id);
  1555. })
  1556. removeUsersByIds(ids.join(',')).then(() => {
  1557. this.contractUserList = [];
  1558. this.$message({
  1559. type: "success",
  1560. message: "删除成功!"
  1561. });
  1562. })
  1563. })
  1564. },
  1565. copyAccPas(row) {
  1566. this.copyText = `姓名:${row.name}
  1567. 账号:${row.account}
  1568. 密码:${row.password}`;
  1569. this.$nextTick(() => {
  1570. this.$refs.copyInput.select()
  1571. document.execCommand('copy')
  1572. this.$message({
  1573. type: "success",
  1574. message: "成功复制在剪贴板!"
  1575. });
  1576. })
  1577. },
  1578. resetPassword(row) {
  1579. this.$confirm('是否将用户【' + row.name + '】密码重置为123456', '提示', {
  1580. confirmButtonText: '确定',
  1581. cancelButtonText: '取消',
  1582. type: 'warning'
  1583. }).then(() => {
  1584. resetPasswordByUserId(row.uid).then(() => {
  1585. row.password = '123456';
  1586. this.$message({
  1587. type: "success",
  1588. message: "重置成功!"
  1589. });
  1590. })
  1591. })
  1592. },
  1593. getContractTypeList() {
  1594. if (this.contractTypeList.length > 1) {
  1595. return;
  1596. }
  1597. getDictionary({
  1598. code: 'contract_type'
  1599. }).then((res) => {
  1600. res.data.data.forEach(element => {
  1601. element.dictKey = Number(element.dictKey)
  1602. });
  1603. this.contractTypeList = res.data.data;
  1604. })
  1605. },
  1606. getUserByName() {
  1607. findUserList('').then((res) => {
  1608. this.userList = res.data.data;
  1609. })
  1610. },
  1611. getLeftTree() {
  1612. return new Promise((resolve) => {
  1613. if (!this.leftTreeData.length) {
  1614. this.leftloading = true;
  1615. findProjectTree(this.projectInfo.id, this.wbsId).then((res) => {
  1616. if (Array.isArray(res.data.data)) {
  1617. this.leftTreeData = res.data.data;
  1618. } else {
  1619. this.leftTreeData = [];
  1620. }
  1621. resolve();
  1622. }).finally(() => {
  1623. this.leftloading = false;
  1624. resolve();
  1625. })
  1626. }
  1627. resolve();
  1628. })
  1629. },
  1630. getRightTree() {
  1631. console.log(this.wbsId, this.projectInfo.id, this.contractForm.id);
  1632. if(this.wbsId){
  1633. this.rightloading = true;
  1634. getContractInfoTree(this.wbsId, this.projectInfo.id, this.contractForm.id).then((res) => {
  1635. if (Array.isArray(res.data.data)) {
  1636. this.$refs.treetotree.setRightTree(res.data.data);
  1637. }
  1638. this.rightloading = false;
  1639. })
  1640. }
  1641. },
  1642. saveWbsTree() {
  1643. let obj = {};
  1644. let ids = this.$refs.treetotree.getTreeAllId('rightTree');
  1645. obj = {
  1646. wbsId: this.wbsId,
  1647. projectId: this.projectInfo.id,
  1648. contractId: this.contractForm.id,
  1649. wbsTreeIds: ids
  1650. }
  1651. return submitWbsTreeInContract(obj);
  1652. },
  1653. treeChang() {
  1654. this.typeChang[2] = true;
  1655. },
  1656. mapChange() {
  1657. this.$refs['contractForm'].validateField('projectPlace');
  1658. },
  1659. getStoragePeriodList() {
  1660. if (this.storagePeriodList.length > 1) {
  1661. return;
  1662. }
  1663. getDictbiz({
  1664. code: 'storage_period'
  1665. }).then((res) => {
  1666. res.data.data.forEach(element => {
  1667. element.dictKey = Number(element.dictKey)
  1668. });
  1669. this.storagePeriodList = res.data.data;
  1670. })
  1671. },
  1672. getSecurityLevelList() {
  1673. if (this.securityLevelList.length > 1) {
  1674. return;
  1675. }
  1676. getDictbiz({
  1677. code: 'security_level'
  1678. }).then((res) => {
  1679. res.data.data.forEach(element => {
  1680. element.dictKey = Number(element.dictKey)
  1681. });
  1682. this.securityLevelList = res.data.data;
  1683. })
  1684. },
  1685. //#endregion
  1686. //#region 合同段信息
  1687. async treeAllConstruction() {
  1688. const {data: res} = await treeAllConstruction({projectId: this.$route.query.pid,contractType:this.contractForm.contractType})
  1689. console.log(res);
  1690. if (res.code == 200) {
  1691. this.checkList = res.data
  1692. }
  1693. },
  1694. //#endregion
  1695. }
  1696. };
  1697. </script>
  1698. <style scoped lang="scss">
  1699. .bm-view {
  1700. width: 100%;
  1701. height: 300px;
  1702. }
  1703. .head-font {
  1704. font-size: 20px;
  1705. font-weight: bold;
  1706. }
  1707. .table-form{
  1708. margin-top: 10px;
  1709. box-sizing: border-box;
  1710. .bg{
  1711. background: rgb(239, 239, 239);
  1712. }
  1713. }
  1714. .bor{
  1715. line-height: 40px;
  1716. text-align: center;
  1717. box-sizing: border-box;
  1718. }
  1719. </style>
  1720. <style  lang="scss">
  1721. .maxinp{
  1722. .el-input__inner{
  1723. height: 80px;
  1724. }
  1725. }
  1726. </style>
  1727. </style>