detailsPage.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  1. <template>
  2. <div class="borderless">
  3. <div class="main-head">
  4. <div class="main-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. <el-button type="success"
  9. class="el-button--small-yh add-customer-btn-two"
  10. @click.stop="addMainProject">复制新单
  11. </el-button>
  12. <el-button class="el-button--small-yh add-customer-btn" type="primary"
  13. @click.stop="editMainProject"
  14. >{{this.id?"确认修改" :"确认新增"}}
  15. </el-button>
  16. </div>
  17. </div>
  18. <div style="margin-top: 60px">
  19. <containerTitle title="基础信息"></containerTitle>
  20. <basic-container>
  21. <el-form :model="form" ref="form" label-width="100px" class="demo-ruleForm">
  22. <el-row>
  23. <el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:6" :key="index">
  24. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  25. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" :disabled="item.disabled?true:false" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
  26. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"/>
  27. <el-select v-else-if="item.prop === 'paymentType'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
  28. <el-option v-for="(item,index) in paymentTerm" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  29. </el-select>
  30. <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
  31. <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
  32. <el-input type="age" v-else-if="item.prop === 'debitAmount'" v-model="form[item.prop]" @change="debitChange" :disabled="item.disabled?true:false" size="small" autocomplete="off" placeholder="请输入">
  33. <template slot="append">元</template>
  34. </el-input>
  35. <el-input type="age" v-else v-model="form[item.prop]" :disabled="item.disabled?true:false" size="small" value="0" autocomplete="off" placeholder="请输入">
  36. <template v-if="item.prop === 'debitAmount'|| item.prop === 'advanceAmount'||item.prop === 'settlmentAmount'||item.prop === 'balanceAmount'" slot="append">元</template>
  37. </el-input>
  38. </el-form-item>
  39. </el-col>
  40. </el-row>
  41. </el-form>
  42. </basic-container>
  43. <containerTitle title="明细列表"></containerTitle>
  44. <basic-container>
  45. <avue-crud
  46. ref="crud"
  47. :data="data"
  48. :option="optionTable"
  49. :page.sync="page"
  50. :table-loading="loading"
  51. v-model="optionFrom"
  52. @row-del="rowDel"
  53. @row-save="rowSave"
  54. @row-update="rowUpdate"
  55. @size-change="sizeChange"
  56. @current-change="currentChange"
  57. @selection-change="selectionChange"
  58. @search-change="searchChange"
  59. @saveColumn="saveColumn"
  60. >
  61. <template slot-scope="scope" slot="menuLeft">
  62. <el-button type="primary"
  63. size="small"
  64. icon="el-icon-plus"
  65. @click="serviceDialog = true">录入明细
  66. </el-button>
  67. <el-button type="info"
  68. size="small"
  69. @click.stop="beforePleaseCheck">请 核
  70. </el-button>
  71. </template>
  72. <template slot="menuRight">
  73. <el-button
  74. size="small"
  75. type="info"
  76. @click.stop="openReport()"
  77. >导出报表
  78. </el-button>
  79. </template>
  80. <template slot-scope="{row,index}" slot="menu">
  81. <el-button
  82. type="text"
  83. size="small"
  84. @click="rowCellTwo(row,index)"
  85. >{{row.$cellEdit?'修改完成':'修改'}}</el-button>
  86. </template>
  87. <template slot="userid" slot-scope="{row,index}">
  88. <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
  89. <span style="margin-left: 12px;padding-top: 2px">{{ row.userName }}</span>
  90. <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="selectUser(row)">选择</el-button>
  91. </template>
  92. </avue-crud>
  93. </basic-container>
  94. <containerTitle title="附件上传"></containerTitle>
  95. <basic-container style="margin-bottom: 40px">
  96. <avue-crud
  97. :option="upLoadOption"
  98. v-model="upLoadForm"
  99. :data="upLoadData"
  100. @row-save="upLoadSave"
  101. @row-update="upLoadUpdate"
  102. @row-del="upLoadDel"
  103. ></avue-crud>
  104. </basic-container>
  105. </div>
  106. <el-dialog
  107. title="导入服务项目"
  108. append-to-body
  109. class="el-dialogDeep"
  110. :visible.sync="serviceDialog"
  111. width="70%"
  112. :close-on-click-modal="false"
  113. :destroy-on-close="true"
  114. :close-on-press-escape="false">
  115. <el-row style="height: 0;">
  116. <el-col :span="5" >
  117. <div>
  118. <el-scrollbar>
  119. <basic-container>
  120. <avue-tree :option="serviceTreeOption" @node-click="serviceNodeClick"/>
  121. </basic-container>
  122. </el-scrollbar>
  123. </div>
  124. </el-col>
  125. <el-col :span="19">
  126. <basic-container>
  127. <avue-crud ref="serviceCrud"
  128. :page.sync="servicePage"
  129. :search.sync="serviceSearch"
  130. :option="serviceOption"
  131. :table-loading="serviceLoading"
  132. :data="serviceData"
  133. @refresh-change="serviceRefreshChange"
  134. @selection-change="serviceSelectionChange"
  135. @search-change="serviceSearchChange"
  136. @on-load="serviceOnLoad">
  137. </avue-crud>
  138. </basic-container>
  139. </el-col>
  140. </el-row>
  141. <span slot="footer" class="dialog-footer">
  142. <el-button type="primary" @click="serviceConfirm()" :disabled="this.serviceSelectList.length == 0">导 入</el-button>
  143. <el-button @click="serviceDialog = false">取 消</el-button>
  144. </span>
  145. </el-dialog>
  146. <el-dialog
  147. title="导入用户"
  148. :visible.sync="userDialog"
  149. class="el-dialogDeep"
  150. append-to-body
  151. width="80%">
  152. <el-row style="margin-top: -5px;height: 0">
  153. <el-col :span="5">
  154. <div class="box">
  155. <el-scrollbar>
  156. <basic-container>
  157. <avue-tree :option="userTreeOption" :data="userTreeData" @node-click="userNodeClick"/>
  158. </basic-container>
  159. </el-scrollbar>
  160. </div>
  161. </el-col>
  162. <el-col :span="19">
  163. <basic-container>
  164. <avue-crud ref="userCrud"
  165. :option="userOption"
  166. :data="userDataList"
  167. :table-loading="userLoading"
  168. :page.sync="userPage"
  169. v-model="userForm"
  170. @search-change="userSearchChange"
  171. @search-reset="userSearchReset"
  172. @refresh-change="userRefreshChange"
  173. @selection-change="userSelectionChange"
  174. @on-load="userOnLoad"
  175. >
  176. </avue-crud>
  177. </basic-container>
  178. </el-col>
  179. </el-row>
  180. <span slot="footer" class="dialog-footer">
  181. <el-button @click="userDialog = false">取 消</el-button>
  182. <el-button type="primary" :disabled="this.userSelection.length == 1 ? false:true" @click="userConfirm" >确 定</el-button>
  183. </span>
  184. </el-dialog>
  185. </div>
  186. </template>
  187. <script>
  188. import option from "./configuration/detailsPage.json";
  189. import { projectDetail,editMianProject,updateItemStatus,getSysNo } from "@/api/workManagement/mainProject";
  190. //上传文件json
  191. import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json"
  192. //服务列表接口
  193. import {getServiceProjectList,getServiceTypeTree,} from "@/api/workManagement/serviceProject";
  194. import serviceOption from "./configuration/serviceDialogList.json";
  195. //业务字典
  196. import { getDictionary } from "@/api/system/dictbiz";
  197. // 当前登录人
  198. import { getUserInfo } from "@/api/system/user";
  199. //用户组件
  200. import userOption from "./configuration/userList.json";
  201. import { getList } from "@/api/system/user";
  202. import { getDeptLazyTree} from "@/api/system/dept";
  203. //上传附件删除
  204. import { corpsbank } from "@/api/basicData/configuration"
  205. export default {
  206. data() {
  207. return {
  208. id:'',
  209. loading: false,
  210. form:{},
  211. optionFrom:{},
  212. data: [],
  213. crudSelection:[],
  214. deptDicData:[],//任务部门数据
  215. serviceDialog:false,//服务导入窗口
  216. userDialog:false,//用户导入窗口
  217. //客户组件配置控制
  218. configuration:{
  219. multipleChoices:false,
  220. multiple:false,
  221. disabled:false,
  222. searchShow:false,
  223. collapseTags:false,
  224. placeholder:'请点击右边按钮选择',
  225. dicData:[]
  226. },
  227. page: {
  228. currentPage: 1,
  229. total: 0,
  230. pageSize: 10
  231. },
  232. detailsSelect: {},
  233. paymentTerm:[],
  234. //顶部from数据
  235. basicData: {
  236. column: [
  237. {
  238. label: '系统编号',
  239. prop: 'sysNo',
  240. disabled: true,
  241. rules: [
  242. {
  243. required: true,
  244. message: ' ',
  245. trigger: 'blur'
  246. }
  247. ]
  248. }, {
  249. label: '项目编码',
  250. prop: 'code',
  251. rules: [
  252. {
  253. required: true,
  254. message: ' ',
  255. trigger: 'blur'
  256. }
  257. ]
  258. }, {
  259. label: '项目名称',
  260. prop: 'cname',
  261. rules: [
  262. {
  263. required: true,
  264. message: ' ',
  265. trigger: 'blur'
  266. }
  267. ]
  268. }, {
  269. label: '客户名称',
  270. prop: 'corpId',
  271. },{
  272. label: '合同金额',
  273. prop: 'debitAmount',
  274. rules: [
  275. {
  276. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  277. message: ' ',
  278. trigger: 'blur'
  279. },
  280. {
  281. required: true,
  282. message: ' ',
  283. trigger: 'blur'
  284. }
  285. ]
  286. },
  287. {
  288. label: '首付金额',
  289. prop: 'advanceAmount',
  290. rules: [
  291. {
  292. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  293. message: ' ',
  294. trigger: 'blur'
  295. }
  296. ]
  297. },
  298. {
  299. label: '已收金额',
  300. prop: 'settlmentAmount',
  301. disabled: true,
  302. rules: [
  303. {
  304. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  305. message: ' ',
  306. trigger: 'blur'
  307. }
  308. ]
  309. },
  310. {
  311. label: '未收金额',
  312. prop: 'balanceAmount',
  313. disabled: true,
  314. rules: [
  315. {
  316. pattern:/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  317. message: ' ',
  318. trigger: 'blur'
  319. }
  320. ]
  321. },
  322. {
  323. label: '责任人',
  324. prop: 'corpAttn',
  325. }, {
  326. label: '承揽人',
  327. prop: 'salesName',
  328. },
  329. {
  330. label: '制单人',
  331. prop: 'createUserName',
  332. disabled: true
  333. }, {
  334. label: '制单日期',
  335. prop: 'createTime',
  336. type: 'datetime',
  337. valueFormat:"yyyy-MM-dd HH:mm:ss",
  338. format:"yyyy-MM-dd",
  339. disabled: true
  340. },
  341. {
  342. label: '电话',
  343. prop: 'corpTel',
  344. },
  345. {
  346. label: '收款方式',
  347. prop: 'paymentType',
  348. type:'select',
  349. dataType: "number",
  350. width: 120,
  351. dicUrl: "/api/blade-system/dict-biz/dictionary?code=affair_payment_term",
  352. props: {
  353. label: "dictValue",
  354. value: "dictKey"
  355. },
  356. },
  357. {
  358. label: '开始日期',
  359. prop: 'beginTime',
  360. valueFormat:"yyyy-MM-dd HH:mm:ss",
  361. format:"yyyy-MM-dd",
  362. type:'datetime',
  363. },
  364. {
  365. label: '结束日期',
  366. prop: 'endTime',
  367. valueFormat:"yyyy-MM-dd HH:mm:ss",
  368. format:"yyyy-MM-dd",
  369. type:'datetime',
  370. },
  371. {
  372. label: '备注',
  373. span: 24,
  374. prop: 'remark'
  375. }
  376. ],
  377. },
  378. optionTable: option,
  379. //上传文件
  380. upLoadOption: upLoadOption,
  381. upLoadData:[],
  382. upLoadForm:{},
  383. //服务窗口定义
  384. serviceTreeOption: {
  385. nodeKey: 'id',
  386. lazy: true,
  387. treeLoad: function(node, resolve) {
  388. const parentId = node.level === 0 ? 0 : node.data.id;
  389. getServiceTypeTree(parentId).then(res => {
  390. resolve(
  391. res.data.data.map(item => {
  392. return {
  393. ...item,
  394. leaf: !item.hasChildren
  395. };
  396. })
  397. );
  398. });
  399. },
  400. addBtn: false,
  401. menu: false,
  402. size: 'small',
  403. props: {
  404. labelText: '标题',
  405. label: 'title',
  406. value: 'value',
  407. children: 'children'
  408. }
  409. },
  410. serviceOption:serviceOption,
  411. serviceLoading:false,
  412. serviceData:[],
  413. servicePage:{
  414. currentPage: 1,
  415. total: 0,
  416. pageSize: 10
  417. },
  418. serviceSearch:{},
  419. serviceTreeDeptId:"",
  420. serviceSelectList:[],
  421. //用户窗口定义
  422. userTreeOption: {
  423. nodeKey: 'id',
  424. lazy: true,
  425. treeLoad: function (node, resolve) {
  426. const parentId = (node.level === 0) ? 0 : node.data.id;
  427. getDeptLazyTree(parentId).then(res => {
  428. resolve(res.data.data.map(item => {
  429. return {
  430. ...item,
  431. leaf: !item.hasChildren
  432. }
  433. }))
  434. });
  435. },
  436. addBtn: false,
  437. menu: false,
  438. size: 'small',
  439. props: {
  440. labelText: '标题',
  441. label: 'title',
  442. value: 'value',
  443. children: 'children'
  444. }
  445. },
  446. userTreeData:[],
  447. userOption:userOption,
  448. userLoading:false,
  449. userDataList:[],
  450. userSelection:"",
  451. userTreeDeptId:"",
  452. userForm:{},
  453. userPage:{
  454. currentPage: 1,
  455. total: 0,
  456. pageSize: 10
  457. },
  458. };
  459. },
  460. created() {
  461. // 表格行编辑 输入框change事件
  462. //单价
  463. this.optionTable.column[5].change = function (val) {
  464. val.row.amount = val.row.quantity*val.value;
  465. }
  466. //数量
  467. this.optionTable.column[7].change = function (val) {
  468. val.row.amount = val.row.price*val.value;
  469. }
  470. this.$set(this.form,"debitAmount",0)
  471. this.$set(this.form,"advanceAmount",0)
  472. this.$set(this.form,"settlmentAmount",0)
  473. this.$set(this.form,"balanceAmount",0)
  474. this.id = BigInt(this.$route.query.id);//字符串转数字 超长用BigInt
  475. this.getProjectDetail();
  476. const params = {
  477. code : "affair_payment_term"
  478. }
  479. getDictionary(params).then(res =>{
  480. this.paymentTerm = res.data.data;
  481. })
  482. },
  483. mounted() {
  484. },
  485. methods: {
  486. //查询明细
  487. getProjectDetail(pleaseCheck){
  488. if(this.id){
  489. projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
  490. this.form = res.data.data;
  491. this.configuration.dicData = res.data.data.corpName;
  492. if(res.data.data.filesList){
  493. this.upLoadData = res.data.data.filesList
  494. }
  495. if(res.data.data.itemList){
  496. this.data = res.data.data.itemList;
  497. let status = [];
  498. this.data.forEach(item =>{
  499. item.status == 0 ? status.push(true) : status.push(false)
  500. })
  501. //如果 明细列表存在 请核之后的状态 禁止编辑一些输入框
  502. if(status.findIndex(item => item == false) == 0){
  503. this.basicData.column.forEach(item =>{
  504. if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
  505. item.disabled = true
  506. this.configuration.disabled = true
  507. }
  508. })
  509. }
  510. if(pleaseCheck === 10086){
  511. this.pleaseCheck();
  512. }
  513. }else{
  514. this.data = [];
  515. }
  516. })
  517. }else{
  518. getSysNo().then(res =>{
  519. this.$set(this.form,"sysNo", res.data.data)
  520. let date = new Date();
  521. let strDate = date.getFullYear() + "-" + date.getMonth() + 1 + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  522. this.$set(this.form,"createTime",strDate)
  523. });
  524. getUserInfo().then(res =>{
  525. this.$set(this.form,"createUserName", res.data.data.name)
  526. })
  527. }
  528. },
  529. //删除列表后面的删除按钮触发触发(row, index, done)
  530. rowDel(row, index, done) {
  531. this.$confirm("确定将此明细删除?", {
  532. confirmButtonText: "确定",
  533. cancelButtonText: "取消",
  534. type: "warning"
  535. }).then(() => {
  536. this.data.splice(index,0)
  537. // 数据回调进行刷新
  538. done(row);
  539. });
  540. },
  541. // 合同金额
  542. debitChange(val){
  543. if(val){
  544. if(!this.form.settlmentAmount){
  545. this.$set(this.form,"balanceAmount",val)
  546. }
  547. }
  548. },
  549. //点击修改或保存时触发
  550. rowCellTwo(row,index){
  551. this.$refs.crud.rowCell(row, index);
  552. },
  553. //选择时
  554. selectionChange(row){
  555. this.crudSelection = row;
  556. },
  557. //新增修改时保存触发
  558. rowSave(row, done, loading) {
  559. done()
  560. },
  561. rowUpdate(row, index, done, loading) {
  562. done(row)
  563. },
  564. searchChange(params, done) {
  565. this.getList(this.page, params);
  566. done();
  567. },
  568. sizeChange(val) {
  569. this.page.pageSize = val;
  570. this.getList();
  571. },
  572. currentChange(val) {
  573. this.page.currentPage = val;
  574. this.getList();
  575. },
  576. saveColumn(row, column) {
  577. console.log(row, column);
  578. },
  579. //新单
  580. addMainProject(){
  581. this.$confirm("需先将此单据保存", {
  582. confirmButtonText: "确定",
  583. cancelButtonText: "取消",
  584. type: "warning"
  585. }).then(()=>{
  586. this.editMainProject(10010);
  587. })
  588. },
  589. //请核
  590. beforePleaseCheck(){
  591. if(this.crudSelection.length!=0){
  592. let resultUserName = [];
  593. let result = [];
  594. this.crudSelection.forEach(item=>{
  595. // 新录入状态下 才可提交审核
  596. item.createUserName ? resultUserName.push(true) : resultUserName.push(false) //如果没有创建人并且为新录入 提示保存
  597. item.strStatus === "录入" ? result.push(true) : result.push(false) //判断所有的是否为录入状态
  598. })
  599. if(resultUserName.findIndex(item => item != true) == -1){
  600. // 如果数组内有一个 为false 则为false
  601. if(result.findIndex(item => item != true) == -1){
  602. this.editMainProject(10086);
  603. }else{
  604. this.$message({
  605. type: "error",
  606. message: "请核数据中存在已请核数据!"
  607. });
  608. return
  609. }
  610. }else{
  611. this.$confirm("列表内存在新录入数据,是否先保存此数据?", {
  612. confirmButtonText: "确定",
  613. cancelButtonText: "取消",
  614. type: "warning"
  615. }).then(() => {
  616. this.editMainProject();
  617. return
  618. })
  619. }
  620. }else{
  621. this.$message({
  622. type: "error",
  623. message: "请先选择一条数据!"
  624. });
  625. }
  626. },
  627. pleaseCheck(){
  628. this.crudSelection.forEach(item =>{
  629. updateItemStatus(this.data[item.$index].id,1).then(res =>{
  630. if(res.data.success){
  631. this.$message({
  632. type: "success",
  633. message: "请核成功!"
  634. });
  635. //刷新列表
  636. this.loading = true;
  637. projectDetail(this.id,"0,1,2,3,4,5").then(res =>{
  638. if(res.data.data.itemList){
  639. this.data = res.data.data.itemList;
  640. }else{
  641. this.data = [];
  642. }
  643. this.loading = false;
  644. })
  645. }
  646. })
  647. })
  648. },
  649. //新增 修改
  650. editMainProject(pleaseCheck){
  651. this.$refs["form"].validate((valid) => {
  652. //校验明细列表
  653. let valids = true;
  654. if(this.data.length !=0){
  655. this.data.forEach((item) =>{
  656. if((item.userid =="" || !item.deptid || !item.amount) && valids){
  657. this.$message({
  658. type: "warning",
  659. message: "请检查明细列表第 "+(item.$index +1 )+" 行必填项"
  660. });
  661. valids = false;
  662. }
  663. })
  664. }
  665. if(valid && valids){
  666. const params = {
  667. ...this.form,
  668. itemList:this.data,
  669. filesList:this.upLoadData
  670. }
  671. editMianProject(params).then(res =>{
  672. if(pleaseCheck !== 10086 && pleaseCheck !== 10010){
  673. this.$message({
  674. type: "success",
  675. message: "操作成功!"
  676. });
  677. this.getProjectDetail()
  678. }else if(pleaseCheck === 10010){ //新单
  679. this.$router.push({
  680. path: "/mainItems_detailsPage",
  681. query: {id: ''},
  682. });
  683. this.form = {}
  684. this.data = []
  685. this.upLoadData = []
  686. this.id = ''
  687. }else if(pleaseCheck === 10086){
  688. this.getProjectDetail(pleaseCheck)
  689. }
  690. })
  691. }
  692. })
  693. },
  694. //返回主营项目列表
  695. backToList(){
  696. this.$router.$avueRouter.closeTag();
  697. this.$router.push({
  698. path: '/workManagement/main-items/list',
  699. query: {}
  700. });
  701. },
  702. //上传文件保存
  703. upLoadSave(row, done, loading){
  704. this.upLoadData.push(row)
  705. done()
  706. },
  707. //修改附件上传触发
  708. upLoadUpdate(row, done){
  709. done(row);
  710. },
  711. //删除附件上传触发
  712. upLoadDel(row, index,){
  713. this.$confirm("确定将选择数据删除?", {
  714. confirmButtonText: "确定",
  715. cancelButtonText: "取消",
  716. type: "warning"
  717. }).then(() => {
  718. if (row.id){
  719. corpsbank(row.id).then(res=>{
  720. if(res.data.success){
  721. this.$message({
  722. type: "success",
  723. message: "操作成功!"
  724. });
  725. this.bankOfDepositData.splice(index, 1);
  726. }
  727. })
  728. }else {
  729. this.$message({
  730. type: "success",
  731. message: "操作成功!"
  732. });
  733. this.bankOfDepositData.splice(index, 1);
  734. }
  735. })
  736. },
  737. //服务窗口事件
  738. serviceNodeClick(data) {
  739. this.serviceTreeDeptId = data.id;
  740. this.serviceOnLoad(this.servicePage);
  741. },
  742. serviceRefreshChange(){
  743. this.serviceOnLoad(this.servicePage, this.serviceSearch)
  744. },
  745. serviceSearchChange(params, done){
  746. this.serviceOnLoad(this.servicePage, params)
  747. done();
  748. },
  749. serviceSelectionChange(row){
  750. this.serviceSelectList = row;
  751. },
  752. serviceOnLoad(page, params = {}) {
  753. this.serviceLoading = true;
  754. getServiceProjectList(page.currentPage, page.pageSize, params, this.serviceTreeDeptId).then(res => {
  755. this.serviceData = res.data.data.records
  756. this.servicePage.total = res.data.data.total
  757. this.serviceLoading = false
  758. })
  759. },
  760. serviceConfirm(){
  761. if(this.serviceSelectList.length != 0){
  762. this.serviceSelectList.forEach((item)=>{
  763. const params = {
  764. strStatus:"录入",
  765. pname:item.cname,
  766. remarks:item.remarks,
  767. price:item.price,
  768. unit:item.unit,
  769. frequency:item.rate,
  770. }
  771. this.$refs.crud.rowCellAdd(params);
  772. this.$refs.crud.rowCell(item, this.optionFrom.length-1)
  773. })
  774. }
  775. this.serviceSelectList = []
  776. this.serviceDialog = false
  777. this.$message({
  778. type: "success",
  779. message: "导入成功!"
  780. });
  781. },
  782. //用户窗口事件
  783. selectUser(row){
  784. this.userDialog = true
  785. this.detailsSelect = row.$index;
  786. },
  787. userSearchChange(params, done){
  788. this.userOnLoad(this.userPage, params);
  789. done()
  790. },
  791. userSearchReset(){
  792. },
  793. userRefreshChange(){
  794. this.userOnLoad(this.userPage)
  795. },
  796. userSelectionChange(row){
  797. this.userSelection = row;
  798. },
  799. userOnLoad(page,params={}){
  800. this.userLoading = true;
  801. getList(page.currentPage, page.pageSize, params, this.userTreeDeptId).then(res => {
  802. this.userDataList = res.data.data.records
  803. this.userPage.total = res.data.data.total
  804. this.userLoading = false;
  805. });
  806. },
  807. userNodeClick(data){
  808. this.userTreeDeptId = data.id;
  809. this.userOnLoad(this.userPage);
  810. },
  811. //确定
  812. userConfirm(){
  813. if(this.userSelection){
  814. this.data[this.detailsSelect].userid = this.userSelection[0].id;
  815. this.$set(this.data[this.detailsSelect],'userName',this.userSelection[0].realName)
  816. this.userDialog = !this.userDialog
  817. }
  818. }
  819. },
  820. };
  821. </script>
  822. <style scoped lang="scss">
  823. .main-head {
  824. position: fixed;
  825. top: 105px;
  826. width: 100%;
  827. margin-left: -10px;
  828. height: 62px;
  829. background: #ffffff;
  830. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  831. z-index: 999;
  832. }
  833. .main-back {
  834. cursor: pointer;
  835. line-height: 62px;
  836. font-size: 16px;
  837. color: #323233;
  838. font-weight: 400;
  839. }
  840. .avue-tree {
  841. overflow: hidden;
  842. max-height: 660px;
  843. }
  844. .add-customer-btn-two {
  845. position: fixed;
  846. right: 150px;
  847. top: 115px;
  848. }
  849. .add-customer-btn {
  850. position: fixed;
  851. right: 36px;
  852. top: 115px;
  853. }
  854. ::v-deep .el-form-item {
  855. margin-bottom: 0;
  856. }
  857. </style>