detailsPage.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589
  1. <template>
  2. <div class="borderless">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. <div class="upper_right_button">
  9. <!-- <el-button type="success"-->
  10. <!-- size="small"-->
  11. <!-- class="el-button&#45;&#45;small-yh "-->
  12. <!-- :loading="buttonLoading"-->
  13. <!-- :disabled="!form.id || viewDisabled"-->
  14. <!-- @click.stop="mainCheck">-->
  15. <!-- 请核-->
  16. <!-- </el-button>-->
  17. <!-- <el-dropdown style="padding: 0 8px;line-height: 0">-->
  18. <!-- <el-button-->
  19. <!-- type="success"-->
  20. <!-- :loading="buttonLoading"-->
  21. <!-- :disabled="!form.id || viewDisabled"-->
  22. <!-- size="small"-->
  23. <!-- >-->
  24. <!-- 业务处理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  25. <!-- </el-button>-->
  26. <!-- <el-dropdown-menu slot="dropdown">-->
  27. <!-- <el-dropdown-item-->
  28. <!-- :loading="buttonLoading"-->
  29. <!-- :disabled="!form.id"-->
  30. <!-- @click.native="createData()">创建单据-->
  31. <!-- </el-dropdown-item>-->
  32. <!-- <el-dropdown-item-->
  33. <!-- :loading="buttonLoading"-->
  34. <!-- :disabled="!form.id"-->
  35. <!-- @click.native="copyData()">复制单据-->
  36. <!-- </el-dropdown-item>-->
  37. <!-- </el-dropdown-menu>-->
  38. <!-- </el-dropdown>-->
  39. <el-button type="primary"
  40. size="small"
  41. :disabled="buttonLoading"
  42. @click="postMessage">发送消息
  43. </el-button>
  44. <el-button type="primary"
  45. :loading="buttonLoading"
  46. @click.stop="editMainProject"
  47. size="small"
  48. >保存数据
  49. </el-button>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="customer-main">
  54. <containerTitle title="基础信息"></containerTitle>
  55. <basic-container>
  56. <avue-form class="trading-form" ref="form" v-model="form" :option="option">
  57. <template slot="corpId">
  58. <crop-select
  59. v-model="form.corpId"
  60. corpType="KG"
  61. :disabled="viewDisabled"
  62. style="width: 100%"
  63. ></crop-select>
  64. </template>
  65. <template slot="corpAttn">
  66. <el-select
  67. v-model="form.corpAttn"
  68. :disabled="viewDisabled"
  69. icon="el-icon-edit"
  70. remote
  71. filterable
  72. clearable
  73. :remote-method="corpAttnRemoteMethod"
  74. >
  75. <el-option
  76. v-for="item in corpAttnDic"
  77. :key="item.value"
  78. :label="item.realName"
  79. :value="item.realName">
  80. </el-option>
  81. </el-select>
  82. </template>
  83. <template slot="salesName">
  84. <el-select
  85. v-model="form.salesName"
  86. :disabled="viewDisabled"
  87. remote
  88. filterable
  89. clearable
  90. :remote-method="salesNameRemoteMethod"
  91. >
  92. <el-option
  93. v-for="item in salesNameDic"
  94. :key="item.value"
  95. :label="item.realName"
  96. :value="item.realName">
  97. </el-option>
  98. </el-select>
  99. </template>
  100. <template slot="sourceBusiness">
  101. <el-select
  102. v-model="form.sourceBusiness"
  103. :disabled="viewDisabled"
  104. filterable
  105. clearable
  106. >
  107. <el-option
  108. v-for="(item,index) in sourceBusinessDic"
  109. :key="index"
  110. :label="item.dictValue"
  111. :value="item.dictValue">
  112. </el-option>
  113. </el-select>
  114. </template>
  115. <template slot="remark">
  116. <el-input type="textarea"
  117. v-model="form.remark"
  118. size="small"
  119. rows="6"
  120. autocomplete="off"
  121. placeholder="">
  122. </el-input>
  123. </template>
  124. </avue-form>
  125. </basic-container>
  126. <containerTitle title="明细列表"></containerTitle>
  127. <basic-container>
  128. <avue-crud
  129. ref="crud"
  130. :data="data"
  131. :option="optionTable"
  132. :table-loading="loading"
  133. v-model="optionFrom"
  134. @row-del="rowDel"
  135. @row-save="rowSave"
  136. @row-update="rowUpdate"
  137. @size-change="sizeChange"
  138. @current-change="currentChange"
  139. @selection-change="selectionChange"
  140. @search-change="searchChange"
  141. @saveColumn="saveColumn"
  142. @resetColumn="resetColumn"
  143. >
  144. <template slot="menuLeft">
  145. <el-tabs v-model="activeName" @tab-click="handleClick">
  146. <el-tab-pane label="原始数据" name="first" :key="'first'">
  147. </el-tab-pane>
  148. <el-tab-pane label="追加" name="second" :key="'second'">
  149. </el-tab-pane>
  150. <el-tab-pane label="退款" name="three" :key="'three'">
  151. </el-tab-pane>
  152. </el-tabs>
  153. <el-button type="primary"
  154. size="small"
  155. icon="el-icon-plus"
  156. :disabled="viewDisabled"
  157. @click="serviceDialog = true">录入明细
  158. </el-button>
  159. </template>
  160. <!-- <el-button type="info"-->
  161. <!-- size="small"-->
  162. <!-- v-if="false"-->
  163. <!-- :disabled="crudSelection == 0"-->
  164. <!-- @click.stop="beforePleaseCheck()">请 核-->
  165. <!-- </el-button>-->
  166. <!-- </template>-->
  167. <template slot-scope="{row,index}" slot="menu">
  168. <el-button
  169. v-if="row.status !== 5"
  170. type="text"
  171. size="small"
  172. @click="beforeCloseAccount(row)"
  173. >结算</el-button>
  174. <el-button
  175. v-if="row.status === 5"
  176. type="text"
  177. size="small"
  178. :disabled="viewDisabled"
  179. @click="cancelCloseAccount(row)"
  180. >取消结算</el-button>
  181. <el-button
  182. type="text"
  183. size="small"
  184. @click="rowCellTwo(row,index)"
  185. :disabled="row.strStatus == '结算完成' || viewDisabled"
  186. >{{row.$cellEdit?'修改完成':'修改'}}</el-button>
  187. <el-button
  188. type="text"
  189. size="small"
  190. @click="rowDel(row,index)"
  191. :disabled="row.strStatus == '结算完成' || viewDisabled"
  192. >删除</el-button>
  193. </template>
  194. <template slot="userid" slot-scope="{row,index}">
  195. <span v-if="row.$cellEdit" class="required_fields">*</span>
  196. <user-select
  197. style="width:90% !important;"
  198. v-if="row.$cellEdit"
  199. v-model="row.userName"
  200. @value="(values) => value(values,row)"
  201. :configuration="UConfiguration"
  202. >
  203. </user-select>
  204. <span v-else>{{ row.userName }}</span>
  205. </template>
  206. <template slot="amount" slot-scope="{ row }">
  207. <el-input
  208. v-if="row.$cellEdit"
  209. v-model="row.amount"
  210. placeholder="请输入"
  211. size="small"
  212. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  213. @change="totalChange(row,'金额')"
  214. ></el-input>
  215. <span v-else>{{ row.amount }}</span>
  216. </template>
  217. <template slot="serviceCharge" slot-scope="{ row }">
  218. <el-input
  219. v-if="row.$cellEdit"
  220. v-model="row.serviceCharge"
  221. placeholder="请输入"
  222. size="small"
  223. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  224. @input="costCount(row)"
  225. @change="totalChange(row,'服务')"
  226. ></el-input>
  227. <span v-else>{{ row.serviceCharge }}</span>
  228. </template>
  229. <template slot="matMoney" slot-scope="{ row }">
  230. <el-input
  231. v-if="row.$cellEdit"
  232. v-model="row.matMoney"
  233. placeholder="请输入"
  234. size="small"
  235. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  236. @input="costCount(row)"
  237. @change="totalChange(row,'代垫')"
  238. ></el-input>
  239. <span v-else>{{ row.matMoney }}</span>
  240. </template>
  241. <template slot="otheramt" slot-scope="{ row }">
  242. <el-input
  243. v-if="row.$cellEdit"
  244. v-model="row.otheramt"
  245. placeholder="请输入"
  246. size="small"
  247. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  248. @input="costCount(row)"
  249. ></el-input>
  250. <span v-else>{{ row.otheramt }}</span>
  251. </template>
  252. </avue-crud>
  253. </basic-container>
  254. <containerTitle title="补充信息"></containerTitle>
  255. <basic-container>
  256. <el-form :model="formTwo" ref="formTwo" label-width="100px" class="demo-ruleForm">
  257. <el-row>
  258. <el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:6" :key="index">
  259. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  260. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="formTwo[item.prop]" size="small" type="datetime" :disabled="item.disabled?true:false || viewDisabled" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
  261. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="formTwo[item.prop]" size="small" type="date" :disabled="viewDisabled" placeholder="选择日期" value-format="yyyy-MM-dd"/>
  262. <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="formTwo[item.prop]" :disabled="viewDisabled" size="small" autocomplete="off" placeholder="请输入"></el-input>
  263. <el-input type="age" v-else-if="item.prop === 'debitAmount'" v-model="formTwo[item.prop]" @change="debitChange" :disabled="item.disabled?true:false || viewDisabled" size="small" autocomplete="off" placeholder="请输入">
  264. <template slot="append">元</template>
  265. </el-input>
  266. <el-input type="age" v-else-if="item.type === 'unit'" v-model="formTwo[item.prop]" :disabled="item.disabled?true:false || viewDisabled" size="small" autocomplete="off" placeholder="请输入">
  267. <template slot="append">元</template>
  268. </el-input>
  269. <el-input type="age" v-else v-model="formTwo[item.prop]" :disabled="item.disabled?true:false || viewDisabled" size="small" value="0" autocomplete="off" placeholder="请输入">
  270. <template v-if="item.prop === 'advanceAmount'||item.prop === 'settlmentAmount'||item.prop === 'balanceAmount'" slot="append">元</template>
  271. </el-input>
  272. </el-form-item>
  273. </el-col>
  274. </el-row>
  275. </el-form>
  276. </basic-container>
  277. <containerTitle title="附件上传"></containerTitle>
  278. <basic-container style="margin-bottom: 40px">
  279. <avue-crud
  280. :option="upLoadOption"
  281. v-model="upLoadForm"
  282. :data="upLoadData"
  283. @row-save="upLoadSave"
  284. @row-update="upLoadUpdate"
  285. @row-del="upLoadDel"
  286. ></avue-crud>
  287. </basic-container>
  288. </div>
  289. <messagePost
  290. v-if="messageVisble"
  291. ref="messagePost"
  292. @closeDialog="closeDialog"
  293. ></messagePost>
  294. <el-dialog
  295. title="导入服务项目"
  296. append-to-body
  297. class="el-dialogDeep"
  298. :visible.sync="serviceDialog"
  299. width="70%"
  300. :close-on-click-modal="false"
  301. :destroy-on-close="true"
  302. :close-on-press-escape="false">
  303. <el-row style="height: 0;">
  304. <el-col :span="5" >
  305. <div>
  306. <el-scrollbar>
  307. <basic-container>
  308. <avue-tree :option="serviceTreeOption" @node-click="serviceNodeClick"/>
  309. </basic-container>
  310. </el-scrollbar>
  311. </div>
  312. </el-col>
  313. <el-col :span="19">
  314. <basic-container>
  315. <avue-crud ref="serviceCrud"
  316. :page.sync="servicePage"
  317. :search.sync="serviceSearch"
  318. :option="serviceOption"
  319. :table-loading="serviceLoading"
  320. :data="serviceData"
  321. @refresh-change="serviceRefreshChange"
  322. @selection-change="serviceSelectionChange"
  323. @search-change="serviceSearchChange"
  324. @on-load="serviceOnLoad">
  325. </avue-crud>
  326. </basic-container>
  327. </el-col>
  328. </el-row>
  329. <span slot="footer" class="dialog-footer">
  330. <el-button type="primary" @click="serviceConfirm()" :disabled="this.serviceSelectList.length == 0">导 入</el-button>
  331. <el-button @click="serviceDialog = false">取 消</el-button>
  332. </span>
  333. </el-dialog>
  334. <el-dialog
  335. title="导入用户"
  336. :visible.sync="userDialog"
  337. class="el-dialogDeep"
  338. append-to-body
  339. width="80%">
  340. <el-row style="margin-top: -5px;height: 0">
  341. <el-col :span="5">
  342. <div class="box">
  343. <el-scrollbar>
  344. <basic-container>
  345. <avue-tree :option="userTreeOption" :data="userTreeData" @node-click="userNodeClick"/>
  346. </basic-container>
  347. </el-scrollbar>
  348. </div>
  349. </el-col>
  350. <el-col :span="19">
  351. <basic-container>
  352. <avue-crud ref="userCrud"
  353. :option="userOption"
  354. :data="userDataList"
  355. :table-loading="userLoading"
  356. :page.sync="userPage"
  357. v-model="userForm"
  358. @search-change="userSearchChange"
  359. @search-reset="userSearchReset"
  360. @refresh-change="userRefreshChange"
  361. @selection-change="userSelectionChange"
  362. @on-load="userOnLoad"
  363. >
  364. </avue-crud>
  365. </basic-container>
  366. </el-col>
  367. </el-row>
  368. <span slot="footer" class="dialog-footer">
  369. <el-button @click="userDialog = false">取 消</el-button>
  370. <el-button type="primary" :disabled="this.userSelection.length == 1 ? false:true" @click="userConfirm" >确 定</el-button>
  371. </span>
  372. </el-dialog>
  373. <el-dialog
  374. title="流程"
  375. append-to-body
  376. class="el-dialogDeep"
  377. :visible.sync="processDialog"
  378. width="60%"
  379. :close-on-click-modal="false"
  380. :destroy-on-close="true"
  381. :modal-append-to-body='false'
  382. :close-on-press-escape="false"
  383. v-dialog-drag
  384. >
  385. <examine-approve
  386. :itemId ="itemId"
  387. :closeFun="dialogProcessClose"
  388. >
  389. </examine-approve>
  390. </el-dialog>
  391. <el-dialog
  392. title="结算"
  393. append-to-body
  394. class="el-dialogDeep"
  395. :visible.sync="accountDialog"
  396. width="25%"
  397. :close-on-click-modal="false"
  398. :destroy-on-close="true"
  399. :close-on-press-escape="false">
  400. <el-form :model="accountFormData" ref="accountFormData">
  401. <el-form-item label="账户名称" class="landConFrom-input" prop="accountName" :rules="rules">
  402. <el-input v-model="accountFormData.accountName" style="width: 220px;" size="small" clearable placeholder="请输入" ></el-input>
  403. </el-form-item>
  404. <el-form-item label="结算日期" class="landConFrom-input" prop="payTime" :rules="rules">
  405. <el-date-picker type="date" v-model="accountFormData.payTime" value-format="yyyy-MM-dd HH:mm:ss" size="small" clearable placeholder="日期" ></el-date-picker>
  406. </el-form-item>
  407. </el-form>
  408. <span slot="footer" style="display: flex; justify-content: center">
  409. <el-button @click.stop="accountDialog = false , accountFormData = {}" size="small">取 消</el-button>
  410. <el-button type="primary" size="small" @click="closeAccount('accountFormData')">结算</el-button>
  411. </span>
  412. </el-dialog>
  413. </div>
  414. </template>
  415. <script>
  416. import option from "./configuration/detailsPage.json";
  417. import startOption from "./configuration/startDialog.json";
  418. import { projectDetail,editMianProject,settleAccounts,getSysNo,masterCheck} from "@/api/workManagement/mainProject";
  419. //上传文件json
  420. import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json"
  421. //服务列表接口
  422. import {getServiceProjectList,getServiceTypeTree,} from "@/api/workManagement/serviceProject";
  423. import serviceOption from "./configuration/serviceDialogList.json";
  424. //用户组件
  425. import userOption from "./configuration/userList.json";
  426. import { getList } from "@/api/system/user";
  427. import { getDeptLazyTree} from "@/api/system/dept";
  428. //上传附件删除
  429. import { corpsbank } from "@/api/basicData/configuration"
  430. //事务
  431. import examineApprove from "@/components/examineApprove/index";
  432. //对象数组比较
  433. import { contrastObj,contrastList2 } from "@/util/contrastData";
  434. import _ from "lodash";
  435. import { getUserList } from "@/api/workManagement/mainProject";
  436. import optionAdd from "../receipt/configuration/settleAccountsDetailsADD.json";
  437. import optionReturn from "../receipt/configuration/settleAccountsDetailsReturn.json";
  438. import { getDeptTree } from "@/api/system/dept";
  439. import messagePost from "@/components/messageSend/main"
  440. import clientOption from "../performanceAnalysis/config/clientList.json";
  441. export default {
  442. props: {
  443. detailData: {
  444. type: Object
  445. }
  446. },
  447. components:{
  448. examineApprove,
  449. messagePost
  450. },
  451. data() {
  452. return {
  453. id:'',
  454. loading: false,
  455. form:{},
  456. formTwo:{},
  457. optionFrom:{},
  458. account:{},
  459. data:[],
  460. dataList:[],
  461. crudSelection:[],
  462. corpAttnDic:[],
  463. salesNameDic:[],
  464. sourceBusinessDic:[],
  465. buttonLoading:false,
  466. messageVisble:false,
  467. viewDisabled:false,
  468. deptDicData:[],//任务部门数据
  469. serviceDialog:false,//服务导入窗口
  470. userDialog:false,//用户导入窗口
  471. accountDialog:false,//结算窗口
  472. //客户组件配置控制
  473. UConfiguration:{
  474. multipleChoices:false,
  475. multiple:false,
  476. disabled:false,
  477. searchShow:true,
  478. collapseTags:false,
  479. placeholder:'请点击右边按钮选择',
  480. dicData:[]
  481. },
  482. detailsSelect: {},
  483. //顶部from数据
  484. option: {
  485. menuBtn: false,
  486. labelWidth: 100,
  487. column: [
  488. {
  489. label: '项目名称',
  490. prop: 'cname',
  491. span: 12,
  492. rules: [
  493. {
  494. required: true,
  495. message: ' ',
  496. trigger: 'blur'
  497. }
  498. ]
  499. },
  500. {
  501. label: '客户名称',
  502. prop: 'corpId',
  503. span: 12,
  504. rules: [
  505. {
  506. required: true,
  507. message: ' ',
  508. trigger: 'blur'
  509. }
  510. ]
  511. },
  512. {
  513. label: '责任人',
  514. prop: 'corpAttn',
  515. span: 6,
  516. rules: [
  517. {
  518. required: true,
  519. message: ' ',
  520. trigger: 'blur'
  521. }
  522. ]
  523. },
  524. {
  525. label: '承揽人',
  526. prop: 'salesName',
  527. span: 6,
  528. rules: [
  529. {
  530. required: true,
  531. message: ' ',
  532. trigger: 'blur'
  533. }
  534. ]
  535. },
  536. {
  537. label: '业务来源',
  538. prop: 'sourceBusiness',
  539. span: 6,
  540. rules: [
  541. {
  542. required: true,
  543. message: ' ',
  544. trigger: 'blur'
  545. }
  546. ]
  547. },
  548. {
  549. label: '备注',
  550. span: 24,
  551. minRows: 6,
  552. prop: 'remark'
  553. }
  554. ],
  555. },
  556. basicData: {
  557. column: [
  558. {
  559. label: '合同金额',
  560. prop: 'debitAmount',
  561. rules: [
  562. {
  563. required: false,
  564. message: ' ',
  565. trigger: 'blur'
  566. },
  567. {
  568. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  569. message: ' ',
  570. trigger: 'blur'
  571. },
  572. ]
  573. },
  574. {
  575. label: '首付金额',
  576. prop: 'advanceAmount',
  577. type:'unit',
  578. rules: [
  579. {
  580. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  581. message: ' ',
  582. trigger: 'blur'
  583. }
  584. ]
  585. },
  586. {
  587. label: '已收金额',
  588. prop: 'settlmentAmount',
  589. disabled: true,
  590. type:'unit',
  591. },
  592. {
  593. label: '未收金额',
  594. type:'unit',
  595. prop: 'balanceAmount',
  596. disabled: true,
  597. },
  598. {
  599. label: '总服务费',
  600. prop: 'serviceCharge',
  601. type:'unit',
  602. disabled: true,
  603. rules: [
  604. {
  605. pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  606. message: ' ',
  607. trigger: 'blur'
  608. }
  609. ]
  610. },
  611. {
  612. label: '总成本',
  613. prop: 'matMoney',
  614. type:'unit',
  615. disabled: true,
  616. rules: [
  617. {
  618. pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  619. message: ' ',
  620. trigger: 'blur'
  621. }
  622. ]
  623. },
  624. {
  625. label: '制单人',
  626. prop: 'createUserName',
  627. disabled: true
  628. }, {
  629. label: '制单日期',
  630. prop: 'createTime',
  631. type: 'datetime',
  632. valueFormat:"yyyy-MM-dd HH:mm:ss",
  633. format:"yyyy-MM-dd",
  634. disabled: true
  635. },
  636. {
  637. label: '电话',
  638. prop: 'corpTel',
  639. },
  640. {
  641. label: '收款方式',
  642. prop: 'paymentType',
  643. width: 120,
  644. },
  645. {
  646. label: '开始日期',
  647. prop: 'beginTime',
  648. valueFormat:"yyyy-MM-dd HH:mm:ss",
  649. format:"yyyy-MM-dd",
  650. type:'datetime',
  651. },
  652. {
  653. label: '结束日期',
  654. prop: 'endTime',
  655. valueFormat:"yyyy-MM-dd HH:mm:ss",
  656. format:"yyyy-MM-dd",
  657. type:'datetime',
  658. }
  659. ],
  660. },
  661. optionTable: {},
  662. //结算
  663. accountFormData:{},
  664. rules:[{
  665. required: true,
  666. message: ' ',
  667. trigger: 'blur'
  668. }
  669. ],
  670. //上传文件
  671. upLoadOption: upLoadOption,
  672. upLoadData:[],
  673. upLoadForm:{},
  674. //服务窗口定义
  675. serviceTreeOption: {
  676. nodeKey: 'id',
  677. lazy: true,
  678. treeLoad: function(node, resolve) {
  679. const parentId = node.level === 0 ? 0 : node.data.id;
  680. getServiceTypeTree(parentId).then(res => {
  681. resolve(
  682. res.data.data.map(item => {
  683. return {
  684. ...item,
  685. leaf: !item.hasChildren
  686. };
  687. })
  688. );
  689. });
  690. },
  691. addBtn: false,
  692. menu: false,
  693. size: 'small',
  694. props: {
  695. labelText: '标题',
  696. label: 'title',
  697. value: 'value',
  698. children: 'children'
  699. }
  700. },
  701. serviceOption:serviceOption,
  702. serviceLoading:false,
  703. serviceData:[],
  704. servicePage:{
  705. currentPage: 1,
  706. total: 0,
  707. pageSize: 10
  708. },
  709. serviceSearch:{},
  710. serviceTreeDeptId:"",
  711. serviceSelectList:[],
  712. //用户窗口定义
  713. userTreeOption: {
  714. nodeKey: 'id',
  715. lazy: true,
  716. treeLoad: function (node, resolve) {
  717. const parentId = (node.level === 0) ? 0 : node.data.id;
  718. getDeptLazyTree(parentId).then(res => {
  719. resolve(res.data.data.map(item => {
  720. return {
  721. ...item,
  722. leaf: !item.hasChildren
  723. }
  724. }))
  725. });
  726. },
  727. addBtn: false,
  728. menu: false,
  729. size: 'small',
  730. props: {
  731. labelText: '标题',
  732. label: 'title',
  733. value: 'value',
  734. children: 'children'
  735. }
  736. },
  737. userTreeData:[],
  738. userOption:userOption,
  739. userLoading:false,
  740. userDataList:[],
  741. userSelection:[],
  742. userTreeDeptId:"",
  743. userForm:{},
  744. userPage:{
  745. currentPage: 1,
  746. total: 0,
  747. pageSize: 10
  748. },
  749. itemId:'',
  750. //请核窗口定义
  751. processDialog:false,
  752. pleaseCheckContact:startOption,
  753. pleaseCheckLoading:false,
  754. pleaseCheckData:[],
  755. pleaseCheckPage:{
  756. pageSize: 10,
  757. currentPage: 1,
  758. total: 0
  759. },
  760. activeName: "first",
  761. tab1:true,
  762. tab2:false,
  763. tab3:false,
  764. secondDisable:0,
  765. data_one:[],
  766. data_two:[],
  767. data_three:[],
  768. //新旧数据比较
  769. oldData:[],
  770. oldUpLoadData:[],
  771. oldForm:{},
  772. oldFormTwo:{},
  773. };
  774. },
  775. async created() {
  776. this.optionTable = await this.getColumnData(this.getColumnName(56), option);
  777. getDeptTree("096359").then(res=>{
  778. this.optionTable.column.forEach(item=>{
  779. if(item.prop === "deptid"){
  780. item.dicData = res.data.data;
  781. }
  782. })
  783. })
  784. //承揽人 责任人 默认20条数据
  785. getUserList().then(res=>{
  786. res.data.data.map((item,index)=>{
  787. if(index <= 20){
  788. this.corpAttnDic.push(item)
  789. this.salesNameDic.push(item)
  790. }
  791. })
  792. })
  793. //字典值
  794. this.getWorkDicts("source_Business").then(res =>{
  795. this.sourceBusinessDic = res.data.data;
  796. })
  797. if(this.detailData.id){
  798. this.id = BigInt(this.detailData.id);//字符串转数字 超长用BigInt
  799. projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
  800. this.afterEcho(res.data.data)
  801. })
  802. }else{
  803. //责任人 承揽人 默认当前登录人
  804. this.$set(this.formTwo,"corpAttn",this.$store.getters.userInfo.user_name)
  805. this.$set(this.formTwo,"salesName",this.$store.getters.userInfo.user_name)
  806. this.$set(this.formTwo,"debitAmount",0)
  807. this.$set(this.formTwo,"advanceAmount",0)
  808. this.$set(this.formTwo,"settlmentAmount",0)
  809. this.$set(this.formTwo,"balanceAmount",0)
  810. this.$set(this.formTwo,"createUserName", this.$store.getters.userInfo.user_name)
  811. let date = new Date();
  812. let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  813. this.$set(this.formTwo,"createTime",strDate)
  814. //备注格式
  815. let remark = "收入:\n" +
  816. "1、业务名称:\n" +
  817. "2、费用明细:\n" +
  818. "3、业务负责人:\n" +
  819. "4、优惠合计:\n" +
  820. "5、实际收费:\n" +
  821. "6、付款人:\n" +
  822. "7、收款时间:\n" +
  823. "8、收款人:\n" +
  824. "9、收款方式:\n" +
  825. "10、备注/特别说明:";
  826. this.$nextTick(() => {
  827. this.$set(this.form,"remark",remark)
  828. })
  829. }
  830. if(this.$route.query.itemId){
  831. this.id = this.$route.query.itemId
  832. projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
  833. this.afterEcho(res.data.data)
  834. })
  835. }
  836. },
  837. mounted() {
  838. },
  839. methods: {
  840. //明细切换tab
  841. async handleClick(tab) {
  842. if(tab.name == "first") {
  843. this.tab1 = true;
  844. this.tab2 = false;
  845. this.tab3 = false;
  846. if(this.secondDisable === 1){
  847. this.data_two = this.data
  848. }
  849. if(this.secondDisable === 2){
  850. this.data_three = this.data
  851. }
  852. this.secondDisable = 0
  853. await this.switchTab("first")
  854. this.data = this.data_one //切换数据
  855. getDeptTree("096359").then(res=>{
  856. this.optionTable.column.forEach(item=>{
  857. if(item.prop === "deptid"){
  858. item.dicData = res.data.data;
  859. }
  860. })
  861. })
  862. } else if(tab.name == "second") {
  863. this.tab1 = false;
  864. this.tab2 = true;
  865. this.tab3 = false;
  866. if(this.secondDisable === 0){
  867. this.data_one = this.data
  868. }
  869. if(this.secondDisable === 2){
  870. this.data_three = this.data
  871. }
  872. this.secondDisable = 1
  873. await this.switchTab("second")
  874. this.data = this.data_two
  875. }else if(tab.name == "three") {
  876. this.tab1 = false;
  877. this.tab2 = false;
  878. this.tab3 = true;
  879. if(this.secondDisable === 0){
  880. this.data_one = this.data
  881. }
  882. if(this.secondDisable === 1){
  883. this.data_two = this.data
  884. }
  885. this.secondDisable = 2
  886. await this.switchTab("three")
  887. this.data = this.data_three
  888. }
  889. },
  890. switchTab(val){ //换option
  891. if(val === 'first'){
  892. this.optionTable = option
  893. }else if(val === 'second'){
  894. this.optionTable = optionAdd
  895. }else if(val === 'three'){
  896. this.optionTable = optionReturn
  897. }
  898. },
  899. //责任人 远程
  900. corpAttnRemoteMethod(val){
  901. getUserList({realName : val}).then(res=>{
  902. this.corpAttnDic = res.data.data
  903. })
  904. },
  905. //承揽人 远程
  906. salesNameRemoteMethod(val){
  907. getUserList({realName : val}).then(res=>{
  908. this.salesNameDic = res.data.data
  909. })
  910. },
  911. value(value,row){
  912. if(value){
  913. row.userid = value.id
  914. row.deptid = value.deptId
  915. }
  916. },
  917. //合计
  918. totalChange(row,type){
  919. //明细列表金额合计
  920. if(this.secondDisable === 0){
  921. this.data_one = this.data
  922. }
  923. let amountList = this.data_one.map(item => {
  924. if(item.amount){
  925. return parseFloat(item.amount);
  926. }else return 0
  927. });
  928. //明细列表服务费合计
  929. let serviceChargeList = this.data.map(item => {
  930. if(item.serviceCharge){
  931. return parseFloat(item.serviceCharge);
  932. }else return 0
  933. });
  934. //明细列表成本合计
  935. let matMoneyList = this.data.map(item => {
  936. if(item.matMoney){
  937. return parseFloat(item.matMoney);
  938. }else return 0
  939. });
  940. if(type==='金额'){
  941. if(this.formTwo.debitAmount){
  942. if(this.formTwo.debitAmount < amountList.reduce((n,m) => n + m)){
  943. this.$message.error("明细列表合同金额不能大于总金额!")
  944. }
  945. }
  946. }
  947. // if(type==='服务'){
  948. // this.formTwo.serviceCharge = serviceChargeList.reduce((n,m) => n + m)
  949. // }
  950. // if(type==='代垫'){
  951. // this.formTwo.matMoney = matMoneyList.reduce((n,m) => n + m)
  952. // }
  953. if(row.serviceCharge && row.matMoney && row.otheramt && row.amount){
  954. if(row.amount < (parseFloat(row.serviceCharge) + parseFloat(row.matMoney) + parseFloat(row.otheramt))){
  955. this.$message.error("费用之和不能超过合计金额!")
  956. row.serviceCharge = 0;
  957. row.matMoney = 0;
  958. }
  959. }
  960. },
  961. //费用计算计算
  962. costCount(row){
  963. if (this.activeName === 'first'){
  964. if(row.serviceCharge && row.matMoney && row.otheramt){
  965. row.amount = parseFloat(row.serviceCharge) + parseFloat(row.matMoney) + parseFloat(row.otheramt)
  966. }
  967. }else {
  968. if(row.serviceCharge && row.matMoney){
  969. row.amount = parseFloat(row.serviceCharge) + parseFloat(row.matMoney)
  970. }
  971. }
  972. },
  973. //删除列表后面的删除按钮触发触发(row, index, done)
  974. rowDel(row, index) {
  975. this.$confirm("确定将此明细删除?", {
  976. confirmButtonText: "确定",
  977. cancelButtonText: "取消",
  978. type: "warning"
  979. }).then(() => {
  980. this.data.splice(index,1)
  981. });
  982. },
  983. // 合同金额
  984. debitChange(val){
  985. if(val){
  986. if(!this.formTwo.settlmentAmount){
  987. this.$set(this.formTwo,"balanceAmount",val)
  988. }
  989. }
  990. },
  991. //打开结算窗口
  992. beforeCloseAccount(row){
  993. if(this.verificationData()){
  994. this.account = row;
  995. this.accountDialog = true;
  996. }
  997. },
  998. //结算
  999. closeAccount(form){
  1000. this.$refs[form].validate((valid) => {
  1001. if(valid){
  1002. settleAccounts(this.account.id,5,
  1003. this.accountFormData.accountName,
  1004. this.accountFormData.payTime,).then(res =>{
  1005. if(res.data.success){
  1006. this.$message({
  1007. type: "success",
  1008. message: "操作成功!"
  1009. });
  1010. this.accountFormData = {},
  1011. this.accountDialog = false;
  1012. this.getProjectDetail();
  1013. }
  1014. })
  1015. }
  1016. })
  1017. },
  1018. cancelCloseAccount(row){
  1019. this.$confirm("确认取消结算此明细?", {
  1020. confirmButtonText: "确定",
  1021. cancelButtonText: "取消",
  1022. type: "warning"
  1023. }).then(() => {
  1024. settleAccounts(row.id,6).then(res =>{
  1025. if(res.data.success){
  1026. this.$message({
  1027. type: "success",
  1028. message: "操作成功!"
  1029. });
  1030. this.getProjectDetail();
  1031. }
  1032. })
  1033. });
  1034. },
  1035. //请核
  1036. mainCheck(){
  1037. if(this.verificationData()){
  1038. this.detailsCollection()
  1039. for (let i = 0; i < this.dataList.length; i++) {
  1040. if (this.dataList[i].strStatus !== "结算完成") {
  1041. return this.$message.error(`明细列表存在未结算数据,请检查!`);
  1042. }
  1043. }
  1044. masterCheck(this.form.id).then(res=>{
  1045. if(res.data.success){
  1046. this.$message.success("操作成功!")
  1047. this.getProjectDetail();
  1048. }
  1049. })
  1050. }
  1051. //
  1052. },
  1053. // 发送消息
  1054. postMessage() {
  1055. this.messageVisble = true
  1056. this.$nextTick(() => {
  1057. this.$refs.messagePost.init()
  1058. })
  1059. },
  1060. closeDialog() {
  1061. this.messageVisble = false
  1062. },
  1063. getProjectDetail(){
  1064. projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
  1065. this.afterEcho(res.data.data)
  1066. })
  1067. },
  1068. //新增 修改
  1069. editMainProject(type){
  1070. this.$refs["form"].validate((valid) => {
  1071. if(valid){
  1072. this.detailsCollection()
  1073. for (let i = 0; i < this.dataList.length; i++) {
  1074. if (this.dataList[i].userid === (null || "")) {
  1075. return this.$message.error(`请输入明细列表第${i + 1}行的承做人`);
  1076. }
  1077. if (this.dataList[i].deptid === (null || "")) {
  1078. return this.$message.error(`请输入明细列表第${i + 1}行的任务部门`);
  1079. }
  1080. if (this.dataList[i].beginTime === (null || "")) {
  1081. return this.$message.error(`请输入明细列表第${i + 1}行的开始日期`);
  1082. }
  1083. if (this.dataList[i].actualDate === (null || "")) {
  1084. return this.$message.error(`请输入明细列表第${i + 1}行的结束`);
  1085. }
  1086. }
  1087. this.buttonLoading = true
  1088. const params = {
  1089. ...this.form,
  1090. ...this.formTwo,
  1091. itemList:this.dataList,
  1092. filesList:this.upLoadData
  1093. }
  1094. editMianProject(params).then(res =>{
  1095. if(res.data.success){
  1096. this.id = res.data.data
  1097. this.$message.success("操作成功!")
  1098. projectDetail(res.data.data,"0,1,2,3,4,5").then(res =>{
  1099. this.afterEcho(res.data.data)
  1100. })
  1101. }
  1102. }).finally(()=>{
  1103. this.buttonLoading = false
  1104. })
  1105. if(type === true){
  1106. this.$emit("goBack");
  1107. }
  1108. }
  1109. })
  1110. },
  1111. copyData(){
  1112. if(this.verificationData()){
  1113. delete this.form.id
  1114. delete this.formTwo.id
  1115. }
  1116. },
  1117. createData(){
  1118. if(this.verificationData()){
  1119. this.$confirm("确定创建新的单据吗?", "提示", {
  1120. confirmButtonText: "保存",
  1121. cancelButtonText: "取消",
  1122. type: "warning",
  1123. }).then(() => {
  1124. this.form = {}
  1125. this.oldForm = {}
  1126. this.formTwo = {}
  1127. this.oldFormTwo = {}
  1128. this.dataList = []
  1129. this.oldData = []
  1130. this.upLoadData = []
  1131. this.oldUpLoadData = []
  1132. this.$set(this.formTwo,"corpAttn",this.$store.getters.userInfo.user_name)
  1133. this.$set(this.formTwo,"salesName",this.$store.getters.userInfo.user_name)
  1134. this.$set(this.formTwo,"debitAmount",0)
  1135. this.$set(this.formTwo,"advanceAmount",0)
  1136. this.$set(this.formTwo,"settlmentAmount",0)
  1137. this.$set(this.formTwo,"balanceAmount",0)
  1138. this.$set(this.formTwo,"createUserName", this.$store.getters.userInfo.user_name)
  1139. let date = new Date();
  1140. let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  1141. this.$set(this.formTwo,"createTime",strDate)
  1142. })
  1143. }
  1144. },
  1145. //明细合集
  1146. detailsCollection(){
  1147. if(this.secondDisable === 0){
  1148. this.data = this.data_one
  1149. }
  1150. if(this.secondDisable === 1){
  1151. this.data = this.data_two
  1152. }
  1153. if(this.secondDisable === 2){
  1154. this.data = this.data_three
  1155. }
  1156. this.dataList = []
  1157. this.dataList.push(...this.data_one,...this.data_two,...this.data_three)
  1158. },
  1159. afterEcho(data){
  1160. this.form = data;
  1161. this.viewDisabled = this.form.status !== 0? true : false
  1162. this.option.column.forEach(item =>{
  1163. if( item.prop == "cname" ){
  1164. this.$set(item,"disabled",this.viewDisabled)
  1165. }
  1166. })
  1167. this.formTwo = Object.assign({},data);
  1168. delete this.formTwo.cname;
  1169. delete this.formTwo.corpId;
  1170. delete this.formTwo.corpAttn;
  1171. delete this.formTwo.salesName;
  1172. delete this.formTwo.sourceBusiness;
  1173. delete this.formTwo.remark;
  1174. this.oldForm = Object.assign({},data);
  1175. this.oldFormTwo = Object.assign({},data);
  1176. if(data.itemList){
  1177. this.dataList = data.itemList;
  1178. this.oldData = this.deepClone(data.itemList)
  1179. //根据状态区分三种明细
  1180. this.data_one=this.dataList.filter(item=>item.projectType === 0)
  1181. this.data_two=this.dataList.filter(item=>item.projectType === 1)
  1182. this.data_three=this.dataList.filter(item=>item.projectType === 2)
  1183. //判断当前所处哪个明细下 给data赋值
  1184. if(this.secondDisable === 0){
  1185. this.data = this.data_one
  1186. }
  1187. if(this.secondDisable === 1){
  1188. this.data = this.data_two
  1189. }
  1190. if(this.secondDisable === 2){
  1191. this.data = this.data_three
  1192. }
  1193. }
  1194. if(data.filesList){
  1195. this.upLoadData = data.filesList
  1196. this.oldUpLoadData = this.deepClone(data.filesList)
  1197. }
  1198. },
  1199. verificationData(){
  1200. this.detailsCollection()
  1201. if(contrastObj(this.form,this.oldForm)||contrastObj(this.formTwo,this.oldFormTwo) || contrastList2(this.dataList,this.oldData)
  1202. || contrastList2(this.upLoadData,this.oldUpLoadData)
  1203. ) {
  1204. this.$confirm("数据发生变化,请先提交保存!", "提示", {
  1205. confirmButtonText: "保存",
  1206. cancelButtonText: "取消",
  1207. type: "warning",
  1208. }).then(() => {
  1209. this.editMainProject()
  1210. }).catch(()=>{
  1211. return false
  1212. })
  1213. }else{
  1214. return true
  1215. }
  1216. },
  1217. //点击修改或保存时触发
  1218. rowCellTwo(row,index){
  1219. this.$refs.crud.rowCell(row, index);
  1220. },
  1221. //选择时
  1222. selectionChange(row){
  1223. this.crudSelection = row;
  1224. },
  1225. //新增修改时保存触发
  1226. rowSave(row, done, loading) {
  1227. done()
  1228. },
  1229. rowUpdate(row, index, done, loading) {
  1230. done(row)
  1231. },
  1232. searchChange(params, done) {
  1233. this.getList(this.page, params);
  1234. done();
  1235. },
  1236. sizeChange(val) {
  1237. this.page.pageSize = val;
  1238. this.getList();
  1239. },
  1240. currentChange(val) {
  1241. this.page.currentPage = val;
  1242. this.getList();
  1243. },
  1244. //上传文件保存
  1245. upLoadSave(row, done, loading){
  1246. this.upLoadData.push(row)
  1247. done()
  1248. },
  1249. //修改附件上传触发
  1250. upLoadUpdate(row, done){
  1251. done(row);
  1252. },
  1253. //删除附件上传触发
  1254. upLoadDel(row, index,){
  1255. this.$confirm("确定将选择数据删除?", {
  1256. confirmButtonText: "确定",
  1257. cancelButtonText: "取消",
  1258. type: "warning"
  1259. }).then(() => {
  1260. if (row.id){
  1261. corpsbank(row.id).then(res=>{
  1262. if(res.data.success){
  1263. this.$message({
  1264. type: "success",
  1265. message: "操作成功!"
  1266. });
  1267. this.bankOfDepositData.splice(index, 1);
  1268. }
  1269. })
  1270. }else {
  1271. this.$message({
  1272. type: "success",
  1273. message: "操作成功!"
  1274. });
  1275. this.bankOfDepositData.splice(index, 1);
  1276. }
  1277. })
  1278. },
  1279. //服务窗口事件
  1280. serviceNodeClick(data) {
  1281. this.serviceTreeDeptId = data.id;
  1282. this.serviceOnLoad(this.servicePage);
  1283. },
  1284. serviceRefreshChange(){
  1285. this.serviceOnLoad(this.servicePage, this.serviceSearch)
  1286. },
  1287. serviceSearchChange(params, done){
  1288. this.serviceOnLoad(this.servicePage, params)
  1289. done();
  1290. },
  1291. serviceSelectionChange(row){
  1292. this.serviceSelectList = row;
  1293. },
  1294. serviceOnLoad(page, params = {}) {
  1295. this.serviceLoading = true;
  1296. getServiceProjectList(page.currentPage, page.pageSize, params, this.serviceTreeDeptId).then(res => {
  1297. this.serviceData = res.data.data.records
  1298. this.servicePage.total = res.data.data.total
  1299. this.serviceLoading = false
  1300. })
  1301. },
  1302. serviceConfirm(){
  1303. if(this.serviceSelectList.length != 0){
  1304. this.serviceSelectList.forEach((item)=>{
  1305. const params = {
  1306. strStatus:"录入",
  1307. pname:item.cname,
  1308. remarks:item.remarks,
  1309. price:item.price,
  1310. unit:item.unit,
  1311. secondDisable:this.secondDisable,
  1312. frequency:item.rate,
  1313. projectType:this.secondDisable
  1314. }
  1315. this.$refs.crud.rowCellAdd(params);
  1316. this.$refs.crud.rowCell(item, this.optionFrom.length-1)
  1317. })
  1318. }
  1319. this.serviceSelectList = []
  1320. this.serviceDialog = false
  1321. this.$message({
  1322. type: "success",
  1323. message: "导入成功!"
  1324. });
  1325. },
  1326. //用户窗口事件
  1327. selectUser(row){
  1328. this.userDialog = true
  1329. this.detailsSelect = row.$index;
  1330. },
  1331. userSearchChange(params, done){
  1332. this.userOnLoad(this.userPage, params);
  1333. done()
  1334. },
  1335. userSearchReset(){
  1336. },
  1337. userRefreshChange(){
  1338. this.userOnLoad(this.userPage)
  1339. },
  1340. userSelectionChange(row){
  1341. this.userSelection = row;
  1342. },
  1343. userOnLoad(page,params={}){
  1344. this.userLoading = true;
  1345. getList(page.currentPage, page.pageSize, params, this.userTreeDeptId).then(res => {
  1346. this.userDataList = res.data.data.records
  1347. this.userPage.total = res.data.data.total
  1348. this.userLoading = false;
  1349. });
  1350. },
  1351. userNodeClick(data){
  1352. this.userTreeDeptId = data.id;
  1353. this.userOnLoad(this.userPage);
  1354. },
  1355. //确定
  1356. userConfirm(){
  1357. if(this.userSelection){
  1358. this.data[this.detailsSelect].userid = this.userSelection[0].id;
  1359. this.$set(this.data[this.detailsSelect],'userName',this.userSelection[0].realName)
  1360. this.userDialog = !this.userDialog
  1361. }
  1362. },
  1363. dialogProcessClose(){
  1364. this.processDialog = false
  1365. this.getProjectDetail()
  1366. },
  1367. //返回主营项目列表
  1368. backToList(){
  1369. this.detailsCollection()
  1370. if(contrastObj(this.form,this.oldForm) || contrastObj(this.formTwo,this.oldFormTwo) || contrastList2(this.dataList,this.oldData)
  1371. || contrastList2(this.upLoadData,this.oldUpLoadData)
  1372. ){
  1373. this.$confirm("当前页面有未保存数据,是否保存数据?", "提示", {
  1374. confirmButtonText: "保存",
  1375. cancelButtonText: "取消",
  1376. type: "warning",
  1377. }).then(() => {
  1378. this.editMainProject(true)
  1379. }).catch(()=>{
  1380. this.$emit("goBack");
  1381. })
  1382. }else{
  1383. this.$emit("goBack");
  1384. }
  1385. },
  1386. //列保存触发
  1387. async saveColumn() {
  1388. const inSave = await this.saveColumnData(
  1389. this.getColumnName(56),
  1390. this.optionTable
  1391. );
  1392. if (inSave) {
  1393. this.$message.success("保存成功");
  1394. //关闭窗口
  1395. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1396. }
  1397. },
  1398. async resetColumn() {
  1399. const inSave = await this.delColumnData(
  1400. this.getColumnName(56),
  1401. option
  1402. );
  1403. if (inSave) {
  1404. this.$message.success("重置成功");
  1405. this.optionTable = option;
  1406. //关闭窗口
  1407. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1408. }
  1409. },
  1410. //1.0版本注释内容
  1411. // operationDetailList(itemList){
  1412. // this.data = itemList;
  1413. // this.oldData = this.deepClone(itemList)
  1414. // let status = [];
  1415. // this.data.forEach(item =>{
  1416. // item.status == 0 ? status.push(true) : status.push(false)
  1417. // })
  1418. // //如果 明细列表存在 请核之后的状态 禁止编辑一些输入框
  1419. // if(status.findIndex(item => item == false) == 0){
  1420. // this.basicData.column.forEach(item =>{
  1421. // if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
  1422. // item.disabled = true
  1423. // this.configuration.disabled = true
  1424. // }
  1425. // })
  1426. // }else{
  1427. // this.basicData.column.forEach(item =>{
  1428. // if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
  1429. // item.disabled = false
  1430. // this.configuration.disabled = false
  1431. // }
  1432. // })
  1433. // }
  1434. // },
  1435. // openPleaseCheckDialog(){
  1436. // this.processDialog = true;
  1437. // this.itemId = this.crudSelection[0].id //记得不能写死
  1438. // },
  1439. // //请核之前
  1440. // beforePleaseCheck(){
  1441. // if(this.crudSelection){
  1442. // let id = [];
  1443. // let result = [];
  1444. // this.crudSelection.forEach(item=>{
  1445. // // 新录入状态下 才可提交审核
  1446. // item.id ? id.push(true) : id.push(false) //如果没有id并且为新录入 提示保存
  1447. // item.strStatus === "录入" ? result.push(true) : result.push(false) //判断所有的是否为录入状态
  1448. // })
  1449. // if(id.findIndex(item => item != true) == -1){
  1450. // if(result.findIndex(item => item != true) == -1){
  1451. // if(contrastObj(this.form,this.oldForm) || contrastList2(this.data,this.oldData)){ //判断是否改动过此页面
  1452. // this.$confirm("您已改动此页面,请先保存之后在请核?", "提示", {
  1453. // confirmButtonText: "保存",
  1454. // cancelButtonText: "取消",
  1455. // type: "warning",
  1456. // }).then(() => {
  1457. // this.editMainProject();
  1458. // }).catch(()=>{
  1459. // return
  1460. // })
  1461. // }else{
  1462. // this.pleaseCheck()
  1463. // // this.openPleaseCheckDialog();
  1464. // }
  1465. // }else{
  1466. // this.$message({
  1467. // type: "error",
  1468. // message: "请核数据中存在已请核数据!"
  1469. // });
  1470. // return
  1471. // }
  1472. // }else{
  1473. // this.$confirm("列表内存在新录入数据,是否先保存此数据?", {
  1474. // confirmButtonText: "确定",
  1475. // cancelButtonText: "取消",
  1476. // type: "warning"
  1477. // }).then(() => {
  1478. // this.editMainProject();
  1479. // })
  1480. // }
  1481. // }
  1482. // },
  1483. // //请核
  1484. // pleaseCheck(){
  1485. // this.crudSelection.forEach(item =>{
  1486. // updateItemStatus(this.data[item.$index].id,1).then(res =>{
  1487. //
  1488. // })
  1489. // this.$message({
  1490. // type: "success",
  1491. // message: "请核成功!"
  1492. // });
  1493. // //刷新列表
  1494. // this.getProjectDetail();
  1495. // })
  1496. // },
  1497. },
  1498. watch:{
  1499. dataList:function (list) {
  1500. }
  1501. }
  1502. };
  1503. </script>
  1504. <style scoped lang="scss">
  1505. .main-head {
  1506. position: fixed;
  1507. top: 105px;
  1508. width: 100%;
  1509. margin-left: -10px;
  1510. height: 62px;
  1511. background: #ffffff;
  1512. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  1513. z-index: 999;
  1514. }
  1515. .upper_right_button{
  1516. display: flex;
  1517. position: fixed;
  1518. right: 12px;
  1519. top: 47px;
  1520. }
  1521. .main-back {
  1522. cursor: pointer;
  1523. line-height: 62px;
  1524. font-size: 16px;
  1525. color: #323233;
  1526. font-weight: 400;
  1527. }
  1528. .required_fields{
  1529. color: #F56C6C;
  1530. display:inline-block;
  1531. width: 7%
  1532. }
  1533. .avue-tree {
  1534. overflow: hidden;
  1535. max-height: 660px;
  1536. }
  1537. ::v-deep .el-form-item {
  1538. margin-bottom: 0;
  1539. }
  1540. ::v-deep .el-form-item__content{
  1541. line-height: 32px;
  1542. }
  1543. .trading-form ::v-deep .el-form-item {
  1544. margin-bottom: 8px !important;
  1545. }
  1546. .landConFrom-input{
  1547. display:flex;
  1548. justify-content:center;
  1549. }
  1550. </style>