applyLxSjWorkDetail.vue 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330
  1. <template>
  2. <!-- 发起付款申请 -->
  3. <el-dialog
  4. :close-on-click-modal="false"
  5. :close-on-press-escape="false"
  6. title="立项申请-详情"
  7. append-to-body
  8. :visible.sync="dialogLxVisible"
  9. top="50px"
  10. width="75%"
  11. :before-close="beforeClose"
  12. >
  13. <div class="tabsdom">
  14. <el-tabs v-model="activeName" @tab-click="handleClick">
  15. <el-tab-pane label="立项申请" name="first">
  16. <el-card shadow="always" style="padding: 15px 5px 5px 15px">
  17. <el-form
  18. ref="elformData"
  19. :model="formData"
  20. :rules="rules"
  21. class="payform"
  22. label-width="200px"
  23. size="medium"
  24. >
  25. <h3 style="margin-top: 0"><span style="color: red">*</span> 基本信息</h3>
  26. <el-card style="padding:0px 20px;margin-bottom: 25px">
  27. <el-row>
  28. <el-col :span="12">
  29. <el-form-item label="关联项目" prop="proId">
  30. <el-select v-model="formData.proId" disabled filterable placeholder="关联项目名称" @change="proChange">
  31. <el-option
  32. v-for="item in ProjectData"
  33. :key="item.value"
  34. :label="item.label"
  35. :value="item.value"
  36. >
  37. <span style="float: left">{{ item.label }}</span>
  38. <span style="float: right; color: #8492a6; font-size: 13px">{{
  39. item.custname
  40. }}</span>
  41. </el-option>
  42. </el-select>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="12">
  46. <el-form-item label="项目类型">
  47. <div style="line-height: 40px;height: 40px">{{ formData.protype }}</div>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="12">
  51. <el-form-item label="储备项目状态">
  52. <div style="line-height: 40px;height: 40px">{{ formData.signStatus }}</div>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="12">
  56. <el-form-item label="预计销售金额(元)">
  57. <div style="line-height: 40px;height: 40px">{{ formData.presales ? formData.presales + '(元)' : '' }}</div>
  58. </el-form-item>
  59. </el-col>
  60. </el-row>
  61. </el-card>
  62. <h3 style="margin-top: 0"><span style="color: red">*</span> 立项内容</h3>
  63. <el-card style="padding:0px 20px;margin-bottom: 25px">
  64. <el-row :gutter="15">
  65. <el-col :span="24">
  66. <el-form-item label="*项目概述" label-width="160px">
  67. <el-input type="textarea" v-model="formData.approval.proOverview" :rows="3" readonly/>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="12">
  71. <el-form-item label="*是否实现盈利" label-width="160px">
  72. <el-select v-model="formData.approval.isProfit" filterable clearable placeholder="是否实现盈利" disabled>
  73. <el-option v-for="item in billTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
  74. </el-select>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :span="12">
  78. <el-form-item label="*税率" label-width="160px">
  79. <el-input v-model="formData.approval.rate" readonly />
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="24">
  83. <el-form-item label="*项目实施计划" label-width="160px">
  84. <el-input v-model="formData.approval.implementationContent" type="textarea" :raws="2" readonly/>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="24">
  88. <el-form-item label="*项目工作实施方案" label-width="160px" prop="proId">
  89. <el-upload
  90. class="upload-demo"
  91. :action="$constant.BASE_URI + '/FileController/upload'"
  92. :http-request="upload"
  93. disabled
  94. :before-remove="beforeRemove"
  95. :file-list="fileUrlList"
  96. >
  97. <!-- <el-button v-if="!isView" size="small" type="primary">点击上传</el-button>-->
  98. <!-- <div v-if="!isView" slot="tip" class="el-upload__tip">请上传50MB以内的文件</div>-->
  99. <div slot="file" slot-scope="{file}">
  100. <a :href="file.url">{{ file.name }}</a>
  101. <span class="el-upload-list__item-actions">
  102. <i v-if="!isView" class="el-icon-delete" @click="handlePictureRemove(file,fileUrlList)" />
  103. </span>
  104. </div>
  105. </el-upload>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="24">
  109. <el-form-item label="*调研报告" label-width="160px" prop="proId">
  110. <el-upload
  111. class="upload-demo"
  112. :action="$constant.BASE_URI + '/FileController/upload'"
  113. :http-request="upload2"
  114. disabled
  115. :before-remove="beforeRemove"
  116. :file-list="fileUrlList2"
  117. >
  118. <!-- <el-button v-if="!isView" size="small" type="primary">点击上传</el-button>-->
  119. <!-- <div v-if="!isView" slot="tip" class="el-upload__tip">请上传50MB以内的文件</div>-->
  120. <div slot="file" slot-scope="{file}">
  121. <a :href="file.url">{{ file.name }}</a>
  122. <span class="el-upload-list__item-actions">
  123. <i v-if="!isView" class="el-icon-delete" @click="handlePictureRemove(file,fileUrlList2)" />
  124. </span>
  125. </div>
  126. </el-upload>
  127. </el-form-item>
  128. </el-col>
  129. <el-col :span="24">
  130. <el-form-item label="其他附件" label-width="160px" prop="proId">
  131. <el-upload
  132. class="upload-demo"
  133. :action="$constant.BASE_URI + '/FileController/upload'"
  134. :http-request="upload3"
  135. disabled
  136. :before-remove="beforeRemove"
  137. :file-list="fileUrlList3"
  138. >
  139. <!-- <el-button v-if="!isView" size="small" type="primary">点击上传</el-button>-->
  140. <!-- <div v-if="!isView" slot="tip" class="el-upload__tip">请上传50MB以内的文件</div>-->
  141. <div slot="file" slot-scope="{file}">
  142. <a :href="file.url">{{ file.name }}</a>
  143. <span class="el-upload-list__item-actions">
  144. <i v-if="!isView" class="el-icon-delete" @click="handlePictureRemove(file,fileUrlList3)" />
  145. </span>
  146. </div>
  147. </el-upload>
  148. </el-form-item>
  149. </el-col>
  150. <el-col :span="24">
  151. <span class="card_title">*回款计划</span>
  152. <el-card shadow="always">
  153. <el-row>
  154. <el-col :span="24">
  155. <el-table
  156. v-loading="planLoading"
  157. :data="SalsReturnPlanData"
  158. stripe
  159. row-class-name="g_table_row"
  160. >
  161. <el-table-column type="index" width="60" />
  162. <el-table-column label="应收日期" prop="ardateStr" />
  163. <el-table-column label="提醒日期" prop="noticedateStr" />
  164. <el-table-column label="应收金额(元)" prop="aramountStr" header-align="center" align="center" />
  165. <el-table-column label="已收金额(元)" prop="rcamountStr" header-align="center" align="center" />
  166. <el-table-column label="收款名称" prop="arname" header-align="center" align="center" />
  167. <el-table-column label="收款状态" prop="statusStr" header-align="center" align="center" />
  168. <!-- <el-table-column align="right" width="160">
  169. <template slot="header">
  170. <el-button
  171. size="mini"
  172. class="ch-button-warning"
  173. @click="addPlan(ctrId)"
  174. >添加回款计划</el-button>
  175. </template>
  176. <template scope="scope">
  177. <el-button
  178. size="mini"
  179. type="danger"
  180. @click="deletePlan(scope.row.index) "
  181. >删除</el-button>
  182. </template>
  183. </el-table-column>-->
  184. </el-table>
  185. </el-col>
  186. </el-row>
  187. </el-card>
  188. </el-col>
  189. </el-row>
  190. </el-card>
  191. <h3 style="margin-top: 0"><span style="color: red">*</span> 预算信息</h3>
  192. <el-card style="padding:0px 20px;margin-bottom: 25px">
  193. <el-row :gutter="15">
  194. <el-col :span="24">
  195. <bug-get ref="bids" :key="keys" :pro-id="formData.proId" :is-audit="isView?'true':''" />
  196. </el-col>
  197. </el-row>
  198. </el-card>
  199. <h3 style="margin-top: 0">
  200. 申请内容
  201. </h3>
  202. <el-card style="padding:0px 20px;margin-bottom: 25px">
  203. <el-row :gutter="15">
  204. <el-col :span="24">
  205. <el-form-item label="申请理由" label-width="160px" prop="reason">
  206. <el-input
  207. v-model="formData.reason"
  208. :style="{width: '100%'}"
  209. clearable
  210. placeholder="请输入申请理由"
  211. />
  212. </el-form-item>
  213. </el-col>
  214. <el-col :span="24">
  215. <el-form-item label="备注说明" label-width="160px" prop="comment">
  216. <el-input
  217. v-model="formData.comment"
  218. :style="{width: '100%'}"
  219. clearable
  220. />
  221. </el-form-item>
  222. </el-col>
  223. </el-row>
  224. </el-card>
  225. </el-form>
  226. <h3>流程历史</h3>
  227. <div class="tableDom">
  228. <el-table
  229. :data="tableData"
  230. :header-cell-style="{
  231. background:'#1890FF !important',
  232. color:'white'
  233. }"
  234. border
  235. style="width: 100%"
  236. >
  237. <el-table-column fixed label="序号" type="index" width="60"/>
  238. <el-table-column
  239. label="节点名称"
  240. prop="nodeName"
  241. width="180"
  242. />
  243. <el-table-column
  244. label="处理人"
  245. prop="auditUserName"
  246. width="180"
  247. />
  248. <el-table-column
  249. label="审核结果"
  250. prop="auditResultString"
  251. />
  252. <el-table-column
  253. label="审核意见"
  254. prop="auditContent"
  255. />
  256. <el-table-column
  257. label="发起/审核时间"
  258. prop="createdAt"
  259. >
  260. <template slot-scope="scope">
  261. {{ $common.transTime(scope.row.createdAt) }}
  262. </template>
  263. </el-table-column>
  264. </el-table>
  265. </div>
  266. </el-card>
  267. </el-tab-pane>
  268. <el-tab-pane label="流程图 " name="second">
  269. <lx-sj-work-canvas ref="lxWorkCanvas"/>
  270. </el-tab-pane>
  271. </el-tabs>
  272. </div>
  273. <div slot="footer">
  274. <el-button @click="dialogLxVisible = false">取 消</el-button>
  275. <!-- <el-button :loading="buttonLoading" type="primary" @click="confirmSubmit()">确 定</el-button>-->
  276. </div>
  277. </el-dialog>
  278. </template>
  279. <script>
  280. import { upload } from '@/static/utils/channel'
  281. import Base from '@/views/base/base'
  282. import BaseData from '@/views/base/baseData'
  283. import UserSelect from '@/views/components/UserSelect'
  284. import * as echarts from 'echarts'
  285. import Constant from '@/static/utils/constant'
  286. import BugGet from '@/views/workflow/components/myProcess/applyBudgetingApprove.vue'
  287. import LxSjWorkCanvas from '@/views/workflow/components/myProcess/lxSjWorkCanvas.vue'
  288. const lineStyle = {
  289. color: '#00116a',
  290. width: 2
  291. }
  292. const redLinestyle = {
  293. color: 'red',
  294. width: 2
  295. }
  296. const intiData = {}
  297. export default {
  298. name: 'ApplyPay',
  299. components: {
  300. UserSelect,
  301. BugGet,
  302. LxSjWorkCanvas
  303. },
  304. mixins: [Base, BaseData],
  305. data() {
  306. return {
  307. ProjectData: [],
  308. SalsReturnPlanData:[],
  309. tableData:[],
  310. formData: this.initForm(),
  311. dc_sign_status: Constant.dc_sign_status_2,
  312. hasRecord: false,
  313. planLoading: false,
  314. keys: 0,
  315. ctrId:'',
  316. fileUrlList:[],
  317. fileUrlList2:[],
  318. fileUrlList3:[],
  319. planForm: {
  320. id: '',
  321. planno: '',
  322. ctrid: '',
  323. ardate: '',
  324. aramount: '',
  325. arname: '',
  326. noticedate: '',
  327. updatedby: '',
  328. updatedname: '',
  329. updatedatStr: ''
  330. },
  331. planRules:{},
  332. isAdd:false,
  333. isView: false,
  334. dialogPlanVisible:false,
  335. dialogPlanTitle:'新增计划',
  336. hasNewTemplate:false,
  337. referenceId: '',
  338. fileError: false,
  339. bizByList: [],
  340. selectList: [],
  341. detailsForm: {},
  342. buttonLoading: false,
  343. // 查询的时候用的字典========================================
  344. dc_key: ['PAY_TYPE', 'BUDGET_CB', 'RECEIPT_TYPE'],
  345. fileDataIdsAction: 'https://jsonplaceholder.typicode.com/posts/',
  346. billTypeOptions: [
  347. { 'label': '是', 'value': '是' },
  348. { 'label': '否', 'value': '否'}
  349. ],
  350. nodeColor: [
  351. { name: '审核通过', nodeback: '#2A3980' },
  352. { name: '未经过', nodeback: '#999999' },
  353. { name: '退回', nodeback: '#E04242' },
  354. { name: '审核中', nodeback: '#E08E42' },
  355. { name: '撤回', nodeback: '#4294E0' }
  356. ],
  357. onlineForm: {},
  358. dialogTitle: '立项申请',
  359. dialogLxVisible: false,
  360. form: {},
  361. activeName: 'first',
  362. OutOrderList: [],
  363. rules: {
  364. fileDataIds: [{ required: false, message: '请上传发票文件', trigger: 'change' }],
  365. totalPayMoney: [{ required: true, message: '请输入订单累计已支付金额', trigger: 'change' }],
  366. payName: [{ required: true, message: '请输入付款名称', trigger: 'change' }],
  367. payMoney: [{ required: true, message: '请输入付款金额', trigger: 'change' }]
  368. // costsType: [{required: true, message: '请选择', trigger: 'change'}],
  369. }
  370. }
  371. },
  372. mounted() {
  373. this.initProType()
  374. this.generateDcMap()
  375. this.initDict(this.dc_key).then((res) => {
  376. this.initProject({ /* signstatus: '2,3'*/ })
  377. })
  378. // /webServer/BugLibraryController/listBizUserAll
  379. },
  380. methods: {
  381. generateDcMap: function() {
  382. this.dc_map['dc_sign_status'] = this.$common.transDcMap(Constant.dc_sign_status_2)
  383. },
  384. upload(param){
  385. this.uploadRp(param,'fileUrlList')
  386. },
  387. upload2(param){
  388. this.uploadRp(param,'fileUrlList2')
  389. },
  390. upload3(param){
  391. this.uploadRp(param,'fileUrlList3')
  392. },
  393. uploadRp: function(param,fileName) {
  394. const _this = this
  395. _this.fileError = true
  396. upload(param, true).then((res) => {
  397. if (res.key === 200) {
  398. if('fileUrlList'===fileName){
  399. _this.fileUrlList.push(res)
  400. }else if('fileUrlList2'===fileName){
  401. _this.fileUrlList2.push(res)
  402. }else if('fileUrlList3'===fileName){
  403. _this.fileUrlList3.push(res)
  404. }
  405. this.$message.info('文件上传成功')
  406. } else {
  407. this.$message.error('文件上传失败')
  408. }
  409. _this.fileError = false
  410. })
  411. },
  412. initForm(){
  413. return{
  414. id:'',
  415. proId:'',
  416. ctrId:'',
  417. approvalId:'',
  418. workReceivableId:'',
  419. reason:'',
  420. comment:'',
  421. status:'',
  422. approvalForm:'',
  423. approval:{},
  424. workReceivableForm:''
  425. }
  426. },
  427. ctrMainByProId(proId){
  428. const _this = this
  429. this.ctrMainRequest('getByProId',{proId:proId}).then(res=>{
  430. if(res.data){
  431. _this.ctrId = res.data.id
  432. _this.getPlanData(res.data.id)
  433. }
  434. })
  435. },
  436. getPlanData: function(ctrId) {
  437. const _this = this
  438. this.SalsReturnPlanData = []
  439. if (ctrId) {
  440. this.planLoading = true
  441. const postData = this.$qs.stringify({
  442. ctrid: ctrId,
  443. pageNum: this.currentPage,
  444. pageSize: this.pageSize
  445. })
  446. console.log(postData)
  447. this.$axios({
  448. headers: {
  449. 'MVVM-Key': String(new Date().getTime()),
  450. 'xx': 'anything'
  451. },
  452. method: 'post',
  453. url: _this.$constant.BASE_URI + '/AccountReceivableController/list',
  454. data: postData
  455. }).then((res) => {
  456. console.log('sales return plan list', res)
  457. _this.$common.checkLoginStatus(res.data.statusCode)
  458. if (res.data.rows) {
  459. res.data.rows.forEach(function(item) {
  460. const json = {
  461. planstatus: item.planstatus,
  462. arname: item.arname,
  463. // aramountStr: '¥' + _this.$common.formatMoney(item.aramount),
  464. // rcamountStr: '¥' + _this.$common.formatMoney(item.receiveamount),
  465. ardateStr: _this.$common.transDate(item.ardate),
  466. noticedateStr: _this.$common.transDate(item.noticedate),
  467. id: item.id
  468. }
  469. const ra = _this.$common.formatMoney(item.receiveamount)
  470. json.rcamountStr = ra ? '¥' + ra : ''
  471. item.ysAmount = parseInt(item.aramount || 0)
  472. const sr = _this.$common.formatMoney(item.ysAmount)
  473. json.ysAmountStr = sr ? '¥' + sr : ''
  474. item.aramount = parseInt(item.aramount || 0) + parseInt(item.adjustamount || 0)
  475. const r = _this.$common.formatMoney(item.aramount)
  476. json.aramountStr = r ? '¥' + r : ''
  477. json.statusStr = '未收款'
  478. if (item.planstatus === '1') {
  479. json.statusStr = '收款中'
  480. } else if (item.planstatus === '2') {
  481. json.statusStr = '收款完成'
  482. }
  483. _this.SalsReturnPlanData.push(json)
  484. })
  485. }
  486. _this.planLoading = false
  487. }).catch((err, x) => {
  488. console.log('sales return plan list error', err, x)
  489. })
  490. }
  491. },
  492. arDateChange: function(val) {
  493. // console.log('contract date change:' + val)
  494. if (!val) return
  495. const time = new Date(val)
  496. time.setTime(time.getTime() - 3600 * 1000 * 24 * 15)
  497. this.planForm.noticedate = time
  498. },
  499. confirmPlanSubmit: function() {
  500. const _this = this
  501. this.$refs.planForm.validate(valid => {
  502. if (valid) {
  503. var acting = this.$notify({
  504. title: '正在上传信息,喝杯咖啡等等',
  505. type: 'warning'
  506. })
  507. const postData = {
  508. id: this.planForm.id,
  509. ctrid: this.ctrId,
  510. ardate: this.$common.transDate(this.planForm.ardate, Constant.DATE_PATTERN.DATE_TIME_h),
  511. aramount: this.planForm.aramount,
  512. arname: this.planForm.arname,
  513. noticedate: this.$common.transDate(this.planForm.noticedate, Constant.DATE_PATTERN.DATE_TIME_h),
  514. updatedby: this.planForm.updatedby,
  515. updatedat: this.$common.transDate(new Date(), Constant.DATE_PATTERN.DATE_TIME_h)
  516. }
  517. postData.ardateStr= postData.ardate.split(' ')[0]
  518. postData.noticedateStr= postData.noticedate.split(' ')[0]
  519. const r = _this.$common.formatMoney(postData.aramount)
  520. postData.aramountStr = r ? '¥' + r : ''
  521. postData.planno = this.planForm.planno
  522. postData.planstatus = '0'
  523. postData.groupId = this.$common.currUser() ? this.$common.currUser().groupId : ''
  524. postData.statusStr = '未收款'
  525. _this.SalsReturnPlanData.push(postData)
  526. _this.dialogPlanVisible = false
  527. _this.$notify({
  528. title: '添加成功',
  529. type: 'info'
  530. })
  531. } else {
  532. console.log('error submit!!')
  533. return false
  534. }
  535. })
  536. },
  537. /* 删除*/
  538. deletePlan: function(pId,index) {
  539. this.SalsReturnPlanData.splice(index,1)
  540. },
  541. /* 新增*/
  542. addPlan: function(ctrId) {
  543. this.planForm = {
  544. id: '',
  545. planno: 'PLN-' + new Date().Format('yyyyMMddhhmm'),
  546. ctrid: ctrId,
  547. ardate: '',
  548. aramount: '',
  549. arname: '',
  550. noticedate: '',
  551. updatedby: '',
  552. updatedname: '',
  553. updatedatStr: ''
  554. }
  555. const currUser = this.$common.currUser()
  556. if (currUser) {
  557. this.planForm.updatedatStr = this.$common.transDate(new Date().getTime())
  558. this.planForm.updatedname = currUser.truename
  559. this.planForm.updatedby = currUser.id
  560. }
  561. this.isAdd = true
  562. this.dialogPlanVisible = true
  563. this.dialogPlanTitle = '新增计划'
  564. },
  565. getBudgetData() {
  566. const _this = this
  567. this.budGetingRequest('checkRecordApproval', { proId:this.formData.proId }).then(res => {
  568. if (res.data.hasRecord) {
  569. _this.hasRecord = true
  570. if (res.data.templateId) {
  571. const postData = {
  572. proId: _this.formData.proId,
  573. templateId: res.data.templateId
  574. }
  575. _this.budGetingRequest('checkNewTemplate', postData).then(res => {
  576. _this.hasNewTemplate = !res.data;
  577. _this.keys++
  578. _this.$nextTick(() => {
  579. this.$refs.bids.initData(_this.hasNewTemplate)
  580. })
  581. })
  582. }else {
  583. _this.keys++
  584. _this.$nextTick(() => {
  585. this.$refs.bids.initData(_this.hasNewTemplate)
  586. })
  587. }
  588. }else{
  589. _this.keys++
  590. _this.$nextTick(() => {
  591. this.$refs.bids.initData(_this.hasNewTemplate)
  592. })
  593. }
  594. })
  595. },
  596. proChange(){
  597. const _this = this
  598. _this.ProjectData.forEach(item=>{
  599. if(item.value===_this.formData.proId){
  600. _this.formData.protype = _this.ProTypeMap[item.protype]
  601. _this.formData.signStatus = _this.dc_map.dc_sign_status[item.signstatus]
  602. _this.formData.presales = item.presales
  603. _this.formData.proName = item.label
  604. }
  605. })
  606. _this.getBudgetData()
  607. _this.ctrMainByProId(_this.formData.proId)
  608. },
  609. beforeClose() {
  610. // this.formData = {
  611. // fileUrlList: []
  612. // }
  613. this.dialogLxVisible = false
  614. },
  615. handleClick(tab, event) {
  616. if (this.activeName == 'second'){
  617. this.$nextTick(() => {
  618. this.$refs.lxWorkCanvas.createNodeCanvas(this.row)
  619. })
  620. }
  621. },
  622. createNodeCanvas() {
  623. this.$nextTick(() => {
  624. let chartDom = document.getElementById('containerPay')
  625. var myCharts = echarts.init(chartDom)
  626. let charts = {
  627. nodes: [ // 节点
  628. {
  629. name: '申请人发起',
  630. value: [45, 100],
  631. symbol: 'image://' + require('../asste/huifangkuai.png'),
  632. symbolSize: [110, 60]
  633. },
  634. {
  635. name: '直接上级审核',
  636. value: [125, 100],
  637. symbol: 'image://' + require('../asste/huifangkuai.png'),
  638. symbolSize: [110, 60]
  639. },
  640. {
  641. name: '部门负责人审核',
  642. value: [205, 100],
  643. symbol: 'image://' + require('../asste/huifangkuai.png'),
  644. symbolSize: [110, 60]
  645. },
  646. {
  647. name: '财务负责人',
  648. value: [285, 100],
  649. symbol: 'image://' + require('../asste/huifangkuai.png'),
  650. symbolSize: [110, 60]
  651. },
  652. {
  653. name: '分管领导审核',
  654. value: [365, 100],
  655. symbol: 'image://' + require('../asste/huifangkuai.png'),
  656. symbolSize: [110, 60]
  657. },
  658. {
  659. name: '上级分管领导\n审核',
  660. value: [445, 100],
  661. symbol: 'image://' + require('../asste/huifangkuai.png'),
  662. symbolSize: [110, 60]
  663. },
  664. {
  665. name: '总经理(董事长)\n审核',
  666. value: [605, 100],
  667. symbol: 'image://' + require('../asste/huifangkuai.png'),
  668. symbolSize: [110, 60]
  669. },
  670. {
  671. name: '结束',
  672. value: [685, 100],
  673. symbol: 'image://' + require('../asste/huifangkuai.png'),
  674. symbolSize: [110, 60]
  675. },
  676. {
  677. label: {
  678. show: true,
  679. color: 'red', // 节点文字颜色
  680. backgroundColor: '#f5f5f5'
  681. },
  682. itemStyle: {
  683. color: '#f5f5f5'
  684. },
  685. name: ' 退回发起人 ',
  686. value: [450, 500],
  687. symbolSize: [70, 20]
  688. },
  689. // {
  690. // label: {
  691. // show: true,
  692. // color: 'red', // 节点文字颜色
  693. // backgroundColor: '#f5f5f5'
  694. // },
  695. // itemStyle: {
  696. // color: '#f5f5f5'
  697. // },
  698. // name: '退回发起人 ',
  699. // value: [400, 450],
  700. // symbolSize: [70, 20]
  701. // },
  702. {
  703. label: {
  704. show: true,
  705. color: 'red', // 节点文字颜色
  706. backgroundColor: '#f5f5f5'
  707. },
  708. itemStyle: {
  709. color: '#f5f5f5'
  710. },
  711. name: '退回发起人 ',
  712. value: [350, 400],
  713. symbolSize: [70, 20]
  714. },
  715. {
  716. label: {
  717. show: true,
  718. color: 'red', // 节点文字颜色
  719. backgroundColor: '#f5f5f5'
  720. },
  721. itemStyle: {
  722. color: '#f5f5f5'
  723. },
  724. name: ' 退回发起人 ',
  725. value: [300, 350],
  726. symbolSize: [20, 20]
  727. },
  728. {
  729. label: {
  730. show: true,
  731. color: 'red', // 节点文字颜色
  732. backgroundColor: '#f5f5f5'
  733. },
  734. itemStyle: {
  735. color: '#f5f5f5'
  736. },
  737. name: ' 退回发起人 ',
  738. value: [250, 300],
  739. symbolSize: [20, 20]
  740. },
  741. {
  742. label: {
  743. show: true,
  744. color: 'red', // 节点文字颜色
  745. backgroundColor: '#f5f5f5'
  746. },
  747. itemStyle: {
  748. color: '#f5f5f5'
  749. },
  750. name: ' 退回发起人 ',
  751. value: [250, 300],
  752. symbolSize: [20, 20]
  753. },
  754. {
  755. label: {
  756. show: true,
  757. color: 'red', // 节点文字颜色
  758. backgroundColor: '#f5f5f5'
  759. },
  760. itemStyle: {
  761. color: '#f5f5f5'
  762. },
  763. name: ' 退回发起人 ',
  764. value: [175, 250],
  765. symbolSize: [20, 20]
  766. },
  767. {
  768. label: {
  769. show: true,
  770. color: 'red', // 节点文字颜色
  771. backgroundColor: '#f5f5f5'
  772. },
  773. itemStyle: {
  774. color: 'rgb(0,0,0,0)'
  775. },
  776. name: ' 项目金额<200万 ',
  777. value: [525, 40],
  778. symbolSize: [20, 20]
  779. },
  780. {
  781. label: {
  782. show: true,
  783. color: 'red', // 节点文字颜色
  784. backgroundColor: '#f5f5f5'
  785. },
  786. itemStyle: {
  787. color: 'rgb(0,0,0,0)'
  788. },
  789. name: ' 项目金额≥200万 ',
  790. value: [525, 100],
  791. symbolSize: [110, 60]
  792. },
  793. {
  794. label: {
  795. show: true,
  796. color: 'red', // 节点文字颜色
  797. backgroundColor: '#f5f5f5'
  798. },
  799. itemStyle: {
  800. color: '#f5f5f5'
  801. },
  802. name: ' 退回发起人 ',
  803. value: [100, 200],
  804. symbolSize: [20, 20]
  805. }
  806. ],
  807. linesData: [ // 连线
  808. {
  809. lineStyle: lineStyle,
  810. coords: [[45, 100], [100, 100]]
  811. },
  812. {
  813. lineStyle: lineStyle,
  814. coords: [[125, 100], [180, 100]]
  815. },
  816. {
  817. lineStyle: lineStyle,
  818. coords: [[205, 100], [260, 100]]
  819. },
  820. {
  821. lineStyle: lineStyle,
  822. coords: [[285, 100], [340, 100]]
  823. },
  824. {
  825. lineStyle: lineStyle,
  826. coords: [[365, 100], [420, 100]]
  827. },
  828. {
  829. lineStyle: lineStyle,
  830. coords: [[445, 100], [580, 100]]
  831. },
  832. {
  833. lineStyle: lineStyle,
  834. coords: [[600, 100], [660, 100]]
  835. },
  836. {
  837. lineStyle: lineStyle,
  838. coords: [[610, 100], [610, 500]],
  839. symbol: 'none'
  840. },
  841. {
  842. lineStyle: lineStyle,
  843. coords: [[450, 70], [450, 40]],
  844. symbol: 'none'
  845. },
  846. {
  847. lineStyle: lineStyle,
  848. coords: [[450, 40], [685, 40]],
  849. symbol: 'none'
  850. },
  851. {
  852. lineStyle: lineStyle,
  853. coords: [[685, 40], [685, 70]]
  854. },
  855. {
  856. lineStyle: lineStyle,
  857. coords: [[450, 100], [450, 400]],
  858. symbol: 'none'
  859. },
  860. {
  861. lineStyle: lineStyle,
  862. coords: [[370, 100], [370, 350]],
  863. symbol: 'none'
  864. },
  865. {
  866. lineStyle: lineStyle,
  867. coords: [[290, 100], [290, 300]],
  868. symbol: 'none'
  869. },
  870. {
  871. lineStyle: lineStyle,
  872. coords: [[210, 100], [210, 250]],
  873. symbol: 'none'
  874. },
  875. {
  876. lineStyle: lineStyle,
  877. coords: [[130, 100], [130, 200]],
  878. symbol: 'none'
  879. },
  880. {
  881. lineStyle: lineStyle,
  882. coords: [[50, 500],[50, 130]]
  883. },
  884. // {
  885. // lineStyle: lineStyle,
  886. // coords: [[610, 500], [50, 500]],
  887. // symbol: 'none'
  888. // },
  889. // {
  890. // lineStyle: lineStyle,
  891. // coords: [[530, 450], [50, 450]],
  892. // symbol: 'none'
  893. // },
  894. {
  895. lineStyle: lineStyle,
  896. coords: [[450, 400], [50, 400]],
  897. symbol: 'none'
  898. },
  899. {
  900. lineStyle: lineStyle,
  901. coords: [[50, 400], [50, 100]]
  902. },
  903. {
  904. lineStyle: lineStyle,
  905. coords: [[370, 350], [50, 350]],
  906. symbol: 'none'
  907. },
  908. {
  909. lineStyle: lineStyle,
  910. coords: [[290, 300], [50, 300]],
  911. symbol: 'none'
  912. },
  913. {
  914. lineStyle: lineStyle,
  915. coords: [[210, 250], [50, 250]],
  916. symbol: 'none'
  917. },
  918. {
  919. lineStyle: lineStyle,
  920. coords: [[130, 200], [50, 200]],
  921. symbol: 'none'
  922. },
  923. {
  924. lineStyle: lineStyle,
  925. coords: [[50, 150], [50, 150]],
  926. symbol: 'none'
  927. }
  928. ]
  929. }
  930. let option = {
  931. xAxis: {
  932. min: 0,
  933. max: 760,
  934. padding: [0, 50, 0, 50],
  935. show: false,
  936. type: 'value'
  937. },
  938. yAxis: {
  939. min: 0,
  940. max: 650,
  941. show: false,
  942. type: 'value'
  943. },
  944. grid: {
  945. left: 50,
  946. right: 0,
  947. bottom: 0,
  948. top: 0
  949. },
  950. series: [
  951. {
  952. type: 'graph',
  953. coordinateSystem: 'cartesian2d',
  954. symbol: 'rect',
  955. symbolSize: [80, 40],
  956. itemStyle: {
  957. color: 'rgb(225,7,7)'
  958. },
  959. symbolOffset: [10, 0],
  960. // force: {
  961. // edgeLength: 100,//连线的长度
  962. // repulsion: 200 //子节点之间的间距
  963. // },
  964. label: {
  965. show: true,
  966. color: 'white' // 节点文字颜色
  967. },
  968. data: charts.nodes
  969. },
  970. {
  971. type: 'lines',
  972. polyline: false,
  973. coordinateSystem: 'cartesian2d',
  974. symbol: ['', 'arrow'],
  975. symbolSize: 10,
  976. data: charts.linesData
  977. }
  978. ]
  979. }
  980. myCharts.clear()
  981. myCharts.setOption(option)
  982. window.addEventListener('resize', () => {
  983. myCharts.resize()
  984. })
  985. })
  986. },
  987. handlePictureRemove(file, fileUrlList) {
  988. var index = fileUrlList.indexOf(file)
  989. fileUrlList.splice(index, 1)
  990. },
  991. uploadFile: function(param) {
  992. const _this = this
  993. upload(param, true).then((res) => {
  994. _this.formData.fileUrlList.push(res)
  995. })
  996. },
  997. downloadFaPiao(url) {
  998. window.open(url)
  999. },
  1000. parentMethod(val) {
  1001. if (val.length > 0) {
  1002. this.formData.ccList = val.join(',')
  1003. }
  1004. },
  1005. async getBizeUserList() {
  1006. const { data } = await this.baseRequest1('BugLibraryController', 'listBizUserAll', {})
  1007. this.bizByList = data
  1008. },
  1009. async selectOutOrderDetails(e) {
  1010. const postData = { id: e }
  1011. const { data } = await this.baseRequest1('OutOrderMainController', 'getVoById', postData)
  1012. // ApplyPaymentController/getTotalMoneyByProId
  1013. let index = this.OutOrderList.findIndex((a) => a.id == e)
  1014. const res = await this.baseRequest1('ApplyPaymentController', 'getTotalMoneyByProId', { proId: this.OutOrderList[index].proId })
  1015. const res2 = await this.baseRequest1('ApplyPaymentController', 'getTotalPayMoneyByOrderNo', { orderNo: this.OutOrderList[index].orderNo })
  1016. let fileUrlList = this.formData.fileUrlList
  1017. this.formData = { ...data, fileUrlList: fileUrlList }
  1018. this.formData.projectName = data.proName
  1019. this.formData.customerName = data.custName
  1020. // this.formData.supplierName = data.bizName
  1021. this.formData.bizBy = data.bizBy
  1022. this.formData.dealAt = this.$common.transServDate(data.dealAt)
  1023. this.formData.outTimeline = this.$common.transServDate(data.outTimeline)
  1024. this.formData.orderNo = data.custName + '-' + data.orderNo
  1025. this.formData.orderId = e
  1026. this.formData.totalReturnMoney = res.data.data
  1027. this.formData.totalPayMoney = res2.data.data
  1028. // this.formData.fileUrlList = []
  1029. },
  1030. // /webServer/OutOrderMainController/list
  1031. async getOutOrderList() {
  1032. // 获取采购订单号下拉数据
  1033. const postData = {
  1034. pageNum: 1,
  1035. pageSize: 10000,
  1036. shouldAmount: 0
  1037. }
  1038. const { data } = await this.baseRequest1('OutOrderMainController', 'list', postData)
  1039. this.OutOrderList = data.rows
  1040. },
  1041. baseRequest1(prefix, opUrl, postData) {
  1042. return this.$channel.globleRequest(prefix, opUrl, postData, 'project task')
  1043. },
  1044. async confirmSubmit() {
  1045. if(!this.formData.proId){
  1046. this.$message.warning('请选择项目')
  1047. return
  1048. }
  1049. if(!this.formData.approval.proOverview){
  1050. this.$message.warning('请输入项目概述')
  1051. return
  1052. }
  1053. if(!this.formData.approval.isProfit){
  1054. this.$message.warning('请选择是否实现盈利')
  1055. return
  1056. }
  1057. if(!this.formData.approval.rate){
  1058. this.$message.warning('请输入税率')
  1059. return
  1060. }
  1061. if(!this.formData.approval.implementationContent){
  1062. this.$message.warning('请输入项目实施计划')
  1063. return
  1064. }
  1065. if(this.fileUrlList&&this.fileUrlList.length>0){
  1066. this.formData.approval.implementationProgramme=JSON.stringify(this.fileUrlList)
  1067. }else{
  1068. this.$message.warning('请上传实施方案')
  1069. return
  1070. }
  1071. if(this.fileUrlList2&&this.fileUrlList2.length>0){
  1072. this.formData.approval.researchReport=JSON.stringify(this.fileUrlList2)
  1073. }else{
  1074. this.$message.warning('请上传调研报告')
  1075. return
  1076. }
  1077. if(this.fileUrlList3&&this.fileUrlList3.length>0){
  1078. this.formData.approval.otherFile=JSON.stringify(this.fileUrlList3)
  1079. }
  1080. if(this.SalsReturnPlanData&&this.SalsReturnPlanData.length>0){
  1081. this.formData.workReceivableForm= JSON.stringify(this.SalsReturnPlanData)
  1082. }else{
  1083. this.$message.warning('请添加回款计划')
  1084. return
  1085. }
  1086. this.formData.ctrId = this.ctrId
  1087. this.formData.approval.ctrId = this.ctrId
  1088. this.formData.approval.status = '0'
  1089. this.formData.approval.proId = this.formData.proId
  1090. this.formData.approval.groupId = this.$common.currUser().groupId
  1091. this.formData.groupId = this.$common.currUser().groupId
  1092. this.formData.approvalForm = JSON.stringify(this.formData.approval)
  1093. this.$refs.bids.toSave('1')
  1094. this.$refs.elformData.validate(async(valid) => {
  1095. if (valid) {
  1096. let formData = { ...this.formData }
  1097. this.buttonLoading = true
  1098. const { data } = await this.baseRequest1(
  1099. 'ApplyLxSjWorkController',
  1100. 'addApplyLxWork',
  1101. { ...formData })
  1102. this.buttonLoading = false
  1103. if (data.code == 200) {
  1104. this.$message.success('流程已发起')
  1105. this.dialogLxVisible = false
  1106. this.formData= this.initForm()
  1107. this.fileUrlList = []
  1108. this.fileUrlList2 = []
  1109. this.fileUrlList3 = []
  1110. this.ctrId =''
  1111. this.SalsReturnPlanData = []
  1112. this.$emit('getData')
  1113. }
  1114. //
  1115. } else {
  1116. }
  1117. })
  1118. },
  1119. async setVisible(status, row) {
  1120. const _this = this
  1121. this.row=row
  1122. this.activeName='first'
  1123. let { data } = await this.baseRequest1('ApplyLxSjWorkController', 'getInfoByFlowMainId', { flowMainId: row.id })
  1124. const { data: flowHistroy } = await this.baseRequest1('FlowMainController', 'getFlowHistroyByFlowMainId', { flowMainId: row.id })
  1125. this.tableData = flowHistroy
  1126. this.formData = data
  1127. row.prosale = data.presales
  1128. this.proChange()
  1129. this.fileUrlList = this.formData.approval.implementationProgramme?this.$common.castEval(this.formData.approval.implementationProgramme):[]
  1130. this.fileUrlList2 = this.formData.approval.researchReport?this.$common.castEval(this.formData.approval.researchReport):[]
  1131. this.fileUrlList3 = this.formData.approval.otherFile?this.$common.castEval(this.formData.approval.otherFile):[]
  1132. _this.SalsReturnPlanData = []
  1133. this.formData.applyWorkReceivables.forEach(function(item) {
  1134. const json = {
  1135. planstatus: item.planstatus,
  1136. arname: item.arname,
  1137. // aramountStr: '¥' + _this.$common.formatMoney(item.aramount),
  1138. // rcamountStr: '¥' + _this.$common.formatMoney(item.receiveamount),
  1139. ardateStr: _this.$common.transDate(item.ardate),
  1140. noticedateStr: _this.$common.transDate(item.noticedate),
  1141. id: item.id
  1142. }
  1143. const ra = _this.$common.formatMoney(item.receiveamount)
  1144. json.rcamountStr = ra ? '¥' + ra : ''
  1145. item.ysAmount = parseInt(item.aramount || 0)
  1146. const sr = _this.$common.formatMoney(item.ysAmount)
  1147. json.ysAmountStr = sr ? '¥' + sr : ''
  1148. item.aramount = parseInt(item.aramount || 0) + parseInt(item.adjustamount || 0)
  1149. const r = _this.$common.formatMoney(item.aramount)
  1150. json.aramountStr = r ? '¥' + r : ''
  1151. json.statusStr = '未收款'
  1152. if (item.planstatus === '1') {
  1153. json.statusStr = '收款中'
  1154. } else if (item.planstatus === '2') {
  1155. json.statusStr = '收款完成'
  1156. }
  1157. _this.SalsReturnPlanData.push(json)
  1158. })
  1159. this.dialogLxVisible = status
  1160. this.row = row
  1161. },
  1162. budGetingRequest(opUrl, postData) {
  1163. return this.$channel.globleRequest('BudgetMakingController', opUrl, postData, 'project')
  1164. },
  1165. ctrMainRequest(opUrl, postData) {
  1166. return this.$channel.globleRequest('CtrMainController', opUrl, postData, 'project')
  1167. }
  1168. }
  1169. }
  1170. </script>
  1171. <style lang="scss">
  1172. #containeraddworkdetail2 {
  1173. width: 100%;
  1174. height: 600px;
  1175. background: #F5F5F5;
  1176. }
  1177. .cclist {
  1178. .col-input {
  1179. padding: 0;
  1180. }
  1181. }
  1182. .pdr10px {
  1183. padding-right: 10px;
  1184. }
  1185. .mgb10px {
  1186. margin-bottom: 10px;
  1187. }
  1188. .mb25 {
  1189. margin-bottom: 25px;
  1190. }
  1191. .pdtopbottom16 {
  1192. padding: 0px 16px;
  1193. }
  1194. .pdtop16px {
  1195. padding-top: 16px;
  1196. }
  1197. .cost_form {
  1198. .col-input {
  1199. font-weight: 400;
  1200. }
  1201. .el-form-item__label .moneydetails {
  1202. text-align: right;
  1203. font-size: 16px;
  1204. font-family: 微软雅黑;
  1205. padding-right: 10px;
  1206. line-height: 40px;
  1207. word-break: keep-all;
  1208. white-space: nowrap;
  1209. color: #606266;
  1210. text-rendering: optimizeLegibility;
  1211. font-weight: 400;
  1212. }
  1213. .moneydetails {
  1214. text-align: right;
  1215. font-size: 16px;
  1216. font-family: 微软雅黑;
  1217. padding-right: 10px;
  1218. word-break: keep-all;
  1219. white-space: nowrap;
  1220. color: #606266;
  1221. text-rendering: optimizeLegibility;
  1222. font-weight: 400;
  1223. }
  1224. .moneydetails:before {
  1225. content: "*";
  1226. color: #ff4949;
  1227. }
  1228. }
  1229. .txtc {
  1230. text-align: center
  1231. }
  1232. .ml5 {
  1233. margin-left: 5px;
  1234. }
  1235. .eltype {
  1236. margin-bottom: 15px;
  1237. }
  1238. .tabsdom {
  1239. .el-input {
  1240. width: 100%;
  1241. }
  1242. .el-tabs__header {
  1243. text-align: center !important;
  1244. width: 139px !important;
  1245. text-align: center !important;
  1246. display: block !important;
  1247. margin: auto !important;
  1248. margin-bottom: 15px !important;
  1249. }
  1250. .el-tabs__nav-wrap::after {
  1251. display: none;
  1252. }
  1253. .el-upload {
  1254. width: 100%;
  1255. }
  1256. }
  1257. .feeMoneyTotal {
  1258. width: 100%;
  1259. height: 14px;
  1260. font-size: 14px;
  1261. font-weight: 400;
  1262. color: #1890FF;
  1263. margin-top: 31px;
  1264. margin-bottom: 13px;
  1265. }
  1266. </style>