detailsPage.vue 50 KB

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