detailsPage.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584
  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,contrastList } 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(row.serviceCharge && row.matMoney && row.otheramt){
  964. row.amount = parseFloat(row.serviceCharge) + parseFloat(row.matMoney) + parseFloat(row.otheramt)
  965. }
  966. },
  967. //删除列表后面的删除按钮触发触发(row, index, done)
  968. rowDel(row, index) {
  969. this.$confirm("确定将此明细删除?", {
  970. confirmButtonText: "确定",
  971. cancelButtonText: "取消",
  972. type: "warning"
  973. }).then(() => {
  974. this.data.splice(index,1)
  975. });
  976. },
  977. // 合同金额
  978. debitChange(val){
  979. if(val){
  980. if(!this.formTwo.settlmentAmount){
  981. this.$set(this.formTwo,"balanceAmount",val)
  982. }
  983. }
  984. },
  985. //打开结算窗口
  986. beforeCloseAccount(row){
  987. if(this.verificationData()){
  988. this.account = row;
  989. this.accountDialog = true;
  990. }
  991. },
  992. //结算
  993. closeAccount(form){
  994. this.$refs[form].validate((valid) => {
  995. if(valid){
  996. settleAccounts(this.account.id,5,
  997. this.accountFormData.accountName,
  998. this.accountFormData.payTime,).then(res =>{
  999. if(res.data.success){
  1000. this.$message({
  1001. type: "success",
  1002. message: "操作成功!"
  1003. });
  1004. this.accountFormData = {},
  1005. this.accountDialog = false;
  1006. this.getProjectDetail();
  1007. }
  1008. })
  1009. }
  1010. })
  1011. },
  1012. cancelCloseAccount(row){
  1013. this.$confirm("确认取消结算此明细?", {
  1014. confirmButtonText: "确定",
  1015. cancelButtonText: "取消",
  1016. type: "warning"
  1017. }).then(() => {
  1018. settleAccounts(row.id,6).then(res =>{
  1019. if(res.data.success){
  1020. this.$message({
  1021. type: "success",
  1022. message: "操作成功!"
  1023. });
  1024. this.getProjectDetail();
  1025. }
  1026. })
  1027. });
  1028. },
  1029. //请核
  1030. mainCheck(){
  1031. if(this.verificationData()){
  1032. this.detailsCollection()
  1033. for (let i = 0; i < this.dataList.length; i++) {
  1034. if (this.dataList[i].strStatus !== "结算完成") {
  1035. return this.$message.error(`明细列表存在未结算数据,请检查!`);
  1036. }
  1037. }
  1038. masterCheck(this.form.id).then(res=>{
  1039. if(res.data.success){
  1040. this.$message.success("操作成功!")
  1041. this.getProjectDetail();
  1042. }
  1043. })
  1044. }
  1045. //
  1046. },
  1047. // 发送消息
  1048. postMessage() {
  1049. this.messageVisble = true
  1050. this.$nextTick(() => {
  1051. this.$refs.messagePost.init()
  1052. })
  1053. },
  1054. closeDialog() {
  1055. this.messageVisble = false
  1056. },
  1057. getProjectDetail(){
  1058. projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
  1059. this.afterEcho(res.data.data)
  1060. })
  1061. },
  1062. //新增 修改
  1063. editMainProject(type){
  1064. this.$refs["form"].validate((valid) => {
  1065. if(valid){
  1066. this.detailsCollection()
  1067. for (let i = 0; i < this.dataList.length; i++) {
  1068. if (this.dataList[i].userid === (null || "")) {
  1069. return this.$message.error(`请输入明细列表第${i + 1}行的承做人`);
  1070. }
  1071. if (this.dataList[i].deptid === (null || "")) {
  1072. return this.$message.error(`请输入明细列表第${i + 1}行的任务部门`);
  1073. }
  1074. if (this.dataList[i].beginTime === (null || "")) {
  1075. return this.$message.error(`请输入明细列表第${i + 1}行的开始日期`);
  1076. }
  1077. if (this.dataList[i].actualDate === (null || "")) {
  1078. return this.$message.error(`请输入明细列表第${i + 1}行的结束`);
  1079. }
  1080. }
  1081. this.buttonLoading = true
  1082. const params = {
  1083. ...this.form,
  1084. ...this.formTwo,
  1085. itemList:this.dataList,
  1086. filesList:this.upLoadData
  1087. }
  1088. editMianProject(params).then(res =>{
  1089. if(res.data.success){
  1090. this.id = res.data.data
  1091. this.$message.success("操作成功!")
  1092. projectDetail(res.data.data,"0,1,2,3,4,5").then(res =>{
  1093. this.afterEcho(res.data.data)
  1094. })
  1095. }
  1096. }).finally(()=>{
  1097. this.buttonLoading = false
  1098. })
  1099. if(type === true){
  1100. this.$emit("goBack");
  1101. }
  1102. }
  1103. })
  1104. },
  1105. copyData(){
  1106. if(this.verificationData()){
  1107. delete this.form.id
  1108. delete this.formTwo.id
  1109. }
  1110. },
  1111. createData(){
  1112. if(this.verificationData()){
  1113. this.$confirm("确定创建新的单据吗?", "提示", {
  1114. confirmButtonText: "保存",
  1115. cancelButtonText: "取消",
  1116. type: "warning",
  1117. }).then(() => {
  1118. this.form = {}
  1119. this.oldForm = {}
  1120. this.formTwo = {}
  1121. this.oldFormTwo = {}
  1122. this.dataList = []
  1123. this.oldData = []
  1124. this.upLoadData = []
  1125. this.oldUpLoadData = []
  1126. this.$set(this.formTwo,"corpAttn",this.$store.getters.userInfo.user_name)
  1127. this.$set(this.formTwo,"salesName",this.$store.getters.userInfo.user_name)
  1128. this.$set(this.formTwo,"debitAmount",0)
  1129. this.$set(this.formTwo,"advanceAmount",0)
  1130. this.$set(this.formTwo,"settlmentAmount",0)
  1131. this.$set(this.formTwo,"balanceAmount",0)
  1132. this.$set(this.formTwo,"createUserName", this.$store.getters.userInfo.user_name)
  1133. let date = new Date();
  1134. let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  1135. this.$set(this.formTwo,"createTime",strDate)
  1136. })
  1137. }
  1138. },
  1139. //明细合集
  1140. detailsCollection(){
  1141. if(this.secondDisable === 0){
  1142. this.data = this.data_one
  1143. }
  1144. if(this.secondDisable === 1){
  1145. this.data = this.data_two
  1146. }
  1147. if(this.secondDisable === 2){
  1148. this.data = this.data_three
  1149. }
  1150. this.dataList = []
  1151. this.dataList.push(...this.data_one,...this.data_two,...this.data_three)
  1152. },
  1153. afterEcho(data){
  1154. this.form = data;
  1155. this.viewDisabled = this.form.status !== 0? true : false
  1156. this.option.column.forEach(item =>{
  1157. if( item.prop == "cname" ){
  1158. this.$set(item,"disabled",this.viewDisabled)
  1159. }
  1160. })
  1161. this.formTwo = Object.assign({},data);
  1162. delete this.formTwo.cname;
  1163. delete this.formTwo.corpId;
  1164. delete this.formTwo.corpAttn;
  1165. delete this.formTwo.salesName;
  1166. delete this.formTwo.sourceBusiness;
  1167. delete this.formTwo.remark;
  1168. this.oldForm = Object.assign({},data);
  1169. this.oldFormTwo = Object.assign({},data);
  1170. if(data.itemList){
  1171. this.dataList = data.itemList;
  1172. this.oldData = this.deepClone(data.itemList)
  1173. //根据状态区分三种明细
  1174. this.data_one=this.dataList.filter(item=>item.projectType === 0)
  1175. this.data_two=this.dataList.filter(item=>item.projectType === 1)
  1176. this.data_three=this.dataList.filter(item=>item.projectType === 2)
  1177. //判断当前所处哪个明细下 给data赋值
  1178. if(this.secondDisable === 0){
  1179. this.data = this.data_one
  1180. }
  1181. if(this.secondDisable === 1){
  1182. this.data = this.data_two
  1183. }
  1184. if(this.secondDisable === 2){
  1185. this.data = this.data_three
  1186. }
  1187. }
  1188. if(data.filesList){
  1189. this.upLoadData = data.filesList
  1190. this.oldUpLoadData = this.deepClone(data.filesList)
  1191. }
  1192. },
  1193. verificationData(){
  1194. this.detailsCollection()
  1195. if(contrastObj(this.form,this.oldForm)||contrastObj(this.formTwo,this.oldFormTwo) || contrastList(this.dataList,this.oldData)
  1196. || contrastList(this.upLoadData,this.oldUpLoadData)
  1197. ) {
  1198. this.$confirm("数据发生变化,请先提交保存!", "提示", {
  1199. confirmButtonText: "保存",
  1200. cancelButtonText: "取消",
  1201. type: "warning",
  1202. }).then(() => {
  1203. this.editMainProject()
  1204. }).catch(()=>{
  1205. return false
  1206. })
  1207. }else{
  1208. return true
  1209. }
  1210. },
  1211. //点击修改或保存时触发
  1212. rowCellTwo(row,index){
  1213. this.$refs.crud.rowCell(row, index);
  1214. },
  1215. //选择时
  1216. selectionChange(row){
  1217. this.crudSelection = row;
  1218. },
  1219. //新增修改时保存触发
  1220. rowSave(row, done, loading) {
  1221. done()
  1222. },
  1223. rowUpdate(row, index, done, loading) {
  1224. done(row)
  1225. },
  1226. searchChange(params, done) {
  1227. this.getList(this.page, params);
  1228. done();
  1229. },
  1230. sizeChange(val) {
  1231. this.page.pageSize = val;
  1232. this.getList();
  1233. },
  1234. currentChange(val) {
  1235. this.page.currentPage = val;
  1236. this.getList();
  1237. },
  1238. //上传文件保存
  1239. upLoadSave(row, done, loading){
  1240. this.upLoadData.push(row)
  1241. done()
  1242. },
  1243. //修改附件上传触发
  1244. upLoadUpdate(row, done){
  1245. done(row);
  1246. },
  1247. //删除附件上传触发
  1248. upLoadDel(row, index,){
  1249. this.$confirm("确定将选择数据删除?", {
  1250. confirmButtonText: "确定",
  1251. cancelButtonText: "取消",
  1252. type: "warning"
  1253. }).then(() => {
  1254. if (row.id){
  1255. corpsbank(row.id).then(res=>{
  1256. if(res.data.success){
  1257. this.$message({
  1258. type: "success",
  1259. message: "操作成功!"
  1260. });
  1261. this.bankOfDepositData.splice(index, 1);
  1262. }
  1263. })
  1264. }else {
  1265. this.$message({
  1266. type: "success",
  1267. message: "操作成功!"
  1268. });
  1269. this.bankOfDepositData.splice(index, 1);
  1270. }
  1271. })
  1272. },
  1273. //服务窗口事件
  1274. serviceNodeClick(data) {
  1275. this.serviceTreeDeptId = data.id;
  1276. this.serviceOnLoad(this.servicePage);
  1277. },
  1278. serviceRefreshChange(){
  1279. this.serviceOnLoad(this.servicePage, this.serviceSearch)
  1280. },
  1281. serviceSearchChange(params, done){
  1282. this.serviceOnLoad(this.servicePage, params)
  1283. done();
  1284. },
  1285. serviceSelectionChange(row){
  1286. this.serviceSelectList = row;
  1287. },
  1288. serviceOnLoad(page, params = {}) {
  1289. this.serviceLoading = true;
  1290. getServiceProjectList(page.currentPage, page.pageSize, params, this.serviceTreeDeptId).then(res => {
  1291. this.serviceData = res.data.data.records
  1292. this.servicePage.total = res.data.data.total
  1293. this.serviceLoading = false
  1294. })
  1295. },
  1296. serviceConfirm(){
  1297. if(this.serviceSelectList.length != 0){
  1298. this.serviceSelectList.forEach((item)=>{
  1299. const params = {
  1300. strStatus:"录入",
  1301. pname:item.cname,
  1302. remarks:item.remarks,
  1303. price:item.price,
  1304. unit:item.unit,
  1305. secondDisable:this.secondDisable,
  1306. frequency:item.rate,
  1307. projectType:this.secondDisable
  1308. }
  1309. this.$refs.crud.rowCellAdd(params);
  1310. this.$refs.crud.rowCell(item, this.optionFrom.length-1)
  1311. })
  1312. }
  1313. this.serviceSelectList = []
  1314. this.serviceDialog = false
  1315. this.$message({
  1316. type: "success",
  1317. message: "导入成功!"
  1318. });
  1319. },
  1320. //用户窗口事件
  1321. selectUser(row){
  1322. this.userDialog = true
  1323. this.detailsSelect = row.$index;
  1324. },
  1325. userSearchChange(params, done){
  1326. this.userOnLoad(this.userPage, params);
  1327. done()
  1328. },
  1329. userSearchReset(){
  1330. },
  1331. userRefreshChange(){
  1332. this.userOnLoad(this.userPage)
  1333. },
  1334. userSelectionChange(row){
  1335. this.userSelection = row;
  1336. },
  1337. userOnLoad(page,params={}){
  1338. this.userLoading = true;
  1339. getList(page.currentPage, page.pageSize, params, this.userTreeDeptId).then(res => {
  1340. this.userDataList = res.data.data.records
  1341. this.userPage.total = res.data.data.total
  1342. this.userLoading = false;
  1343. });
  1344. },
  1345. userNodeClick(data){
  1346. this.userTreeDeptId = data.id;
  1347. this.userOnLoad(this.userPage);
  1348. },
  1349. //确定
  1350. userConfirm(){
  1351. if(this.userSelection){
  1352. this.data[this.detailsSelect].userid = this.userSelection[0].id;
  1353. this.$set(this.data[this.detailsSelect],'userName',this.userSelection[0].realName)
  1354. this.userDialog = !this.userDialog
  1355. }
  1356. },
  1357. dialogProcessClose(){
  1358. this.processDialog = false
  1359. this.getProjectDetail()
  1360. },
  1361. //返回主营项目列表
  1362. backToList(){
  1363. this.detailsCollection()
  1364. if(contrastObj(this.form,this.oldForm) || contrastObj(this.formTwo,this.oldFormTwo) || contrastList(this.dataList,this.oldData)
  1365. || contrastList(this.upLoadData,this.oldUpLoadData)
  1366. ){
  1367. this.$confirm("当前页面有未保存数据,是否保存数据?", "提示", {
  1368. confirmButtonText: "保存",
  1369. cancelButtonText: "取消",
  1370. type: "warning",
  1371. }).then(() => {
  1372. this.editMainProject(true)
  1373. }).catch(()=>{
  1374. this.$emit("goBack");
  1375. })
  1376. }else{
  1377. this.$emit("goBack");
  1378. }
  1379. },
  1380. //列保存触发
  1381. async saveColumn() {
  1382. const inSave = await this.saveColumnData(
  1383. this.getColumnName(56),
  1384. this.optionTable
  1385. );
  1386. if (inSave) {
  1387. this.$message.success("保存成功");
  1388. //关闭窗口
  1389. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1390. }
  1391. },
  1392. async resetColumn() {
  1393. const inSave = await this.delColumnData(
  1394. this.getColumnName(56),
  1395. option
  1396. );
  1397. if (inSave) {
  1398. this.$message.success("重置成功");
  1399. this.optionTable = option;
  1400. //关闭窗口
  1401. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1402. }
  1403. },
  1404. //1.0版本注释内容
  1405. // operationDetailList(itemList){
  1406. // this.data = itemList;
  1407. // this.oldData = this.deepClone(itemList)
  1408. // let status = [];
  1409. // this.data.forEach(item =>{
  1410. // item.status == 0 ? status.push(true) : status.push(false)
  1411. // })
  1412. // //如果 明细列表存在 请核之后的状态 禁止编辑一些输入框
  1413. // if(status.findIndex(item => item == false) == 0){
  1414. // this.basicData.column.forEach(item =>{
  1415. // if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
  1416. // item.disabled = true
  1417. // this.configuration.disabled = true
  1418. // }
  1419. // })
  1420. // }else{
  1421. // this.basicData.column.forEach(item =>{
  1422. // if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
  1423. // item.disabled = false
  1424. // this.configuration.disabled = false
  1425. // }
  1426. // })
  1427. // }
  1428. // },
  1429. // openPleaseCheckDialog(){
  1430. // this.processDialog = true;
  1431. // this.itemId = this.crudSelection[0].id //记得不能写死
  1432. // },
  1433. // //请核之前
  1434. // beforePleaseCheck(){
  1435. // if(this.crudSelection){
  1436. // let id = [];
  1437. // let result = [];
  1438. // this.crudSelection.forEach(item=>{
  1439. // // 新录入状态下 才可提交审核
  1440. // item.id ? id.push(true) : id.push(false) //如果没有id并且为新录入 提示保存
  1441. // item.strStatus === "录入" ? result.push(true) : result.push(false) //判断所有的是否为录入状态
  1442. // })
  1443. // if(id.findIndex(item => item != true) == -1){
  1444. // if(result.findIndex(item => item != true) == -1){
  1445. // if(contrastObj(this.form,this.oldForm) || contrastList(this.data,this.oldData)){ //判断是否改动过此页面
  1446. // this.$confirm("您已改动此页面,请先保存之后在请核?", "提示", {
  1447. // confirmButtonText: "保存",
  1448. // cancelButtonText: "取消",
  1449. // type: "warning",
  1450. // }).then(() => {
  1451. // this.editMainProject();
  1452. // }).catch(()=>{
  1453. // return
  1454. // })
  1455. // }else{
  1456. // this.pleaseCheck()
  1457. // // this.openPleaseCheckDialog();
  1458. // }
  1459. // }else{
  1460. // this.$message({
  1461. // type: "error",
  1462. // message: "请核数据中存在已请核数据!"
  1463. // });
  1464. // return
  1465. // }
  1466. // }else{
  1467. // this.$confirm("列表内存在新录入数据,是否先保存此数据?", {
  1468. // confirmButtonText: "确定",
  1469. // cancelButtonText: "取消",
  1470. // type: "warning"
  1471. // }).then(() => {
  1472. // this.editMainProject();
  1473. // })
  1474. // }
  1475. // }
  1476. // },
  1477. // //请核
  1478. // pleaseCheck(){
  1479. // this.crudSelection.forEach(item =>{
  1480. // updateItemStatus(this.data[item.$index].id,1).then(res =>{
  1481. //
  1482. // })
  1483. // this.$message({
  1484. // type: "success",
  1485. // message: "请核成功!"
  1486. // });
  1487. // //刷新列表
  1488. // this.getProjectDetail();
  1489. // })
  1490. // },
  1491. },
  1492. watch:{
  1493. dataList:function (list) {
  1494. }
  1495. }
  1496. };
  1497. </script>
  1498. <style scoped lang="scss">
  1499. .main-head {
  1500. position: fixed;
  1501. top: 105px;
  1502. width: 100%;
  1503. margin-left: -10px;
  1504. height: 62px;
  1505. background: #ffffff;
  1506. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  1507. z-index: 999;
  1508. }
  1509. .upper_right_button{
  1510. display: flex;
  1511. position: fixed;
  1512. right: 12px;
  1513. top: 47px;
  1514. }
  1515. .main-back {
  1516. cursor: pointer;
  1517. line-height: 62px;
  1518. font-size: 16px;
  1519. color: #323233;
  1520. font-weight: 400;
  1521. }
  1522. .required_fields{
  1523. color: #F56C6C;
  1524. display:inline-block;
  1525. width: 7%
  1526. }
  1527. .avue-tree {
  1528. overflow: hidden;
  1529. max-height: 660px;
  1530. }
  1531. ::v-deep .el-form-item {
  1532. margin-bottom: 0;
  1533. }
  1534. ::v-deep .el-form-item__content{
  1535. line-height: 32px;
  1536. }
  1537. .trading-form ::v-deep .el-form-item {
  1538. margin-bottom: 8px !important;
  1539. }
  1540. .landConFrom-input{
  1541. display:flex;
  1542. justify-content:center;
  1543. }
  1544. </style>