AuditApply.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. <template>
  2. <div v-loading="loading" style="width: 100%;height: 100%;padding: 5px" class="AuditApply1">
  3. <el-form ref="auditForm" :model="auditForm" style="width: 100%;padding: 5px" :rules="auditRules">
  4. <el-row v-if="auditTarget == 'Project' || auditTarget === 'BudgetMaking'">
  5. <el-col style="padding-bottom: 10px">
  6. <span class="card_title">基本信息</span>
  7. <el-card shadow="always">
  8. <el-row>
  9. <el-col :span="3" class="col-txt"><span>项目名称</span></el-col>
  10. <el-col :span="8" class="col-words">
  11. <span>{{ auditForm.proname }}</span>
  12. </el-col>
  13. <el-col :span="4" class="col-txt"><span>项目类型</span></el-col>
  14. <el-col :span="8" class="col-words">
  15. <span>{{ auditForm.protype }}</span>
  16. </el-col>
  17. </el-row>
  18. <el-row>
  19. <el-col :span="3" class="col-txt"><span>储备项目状态</span></el-col>
  20. <el-col :span="8" class="col-words">
  21. <span>{{ auditForm.signStatus }}</span>
  22. </el-col>
  23. <el-col :span="4" class="col-txt"><span>预计销售金额(元)</span></el-col>
  24. <el-col :span="8" class="col-words">
  25. <span>{{ auditForm.presales ? auditForm.presales + '(元)' : '' }}</span>
  26. </el-col>
  27. </el-row>
  28. </el-card>
  29. </el-col>
  30. </el-row>
  31. <el-row v-if="transForm.default.formType == 'Contract'">
  32. <el-col style="padding-bottom: 10px">
  33. <span class="card_title">表单内容</span>
  34. <el-card shadow="always">
  35. <contract-detail ref="contract" :trans-form="transForm?transForm.default:null" :renewal="renewal" @contentChang="ctrFormPassChange" />
  36. </el-card>
  37. </el-col>
  38. </el-row>
  39. <el-row v-if="transForm.default.formType == 'AccPay'">
  40. <el-col style="padding-bottom: 10px">
  41. <span class="card_title">表单内容</span>
  42. <el-card shadow="always">
  43. <acc-pay ref="accPay" step="add" @baseRefresh="baseRefresh" />
  44. </el-card>
  45. </el-col>
  46. </el-row>
  47. <el-row v-if="transForm.default.formType == 'RealApproval'">
  48. <el-col style="padding-bottom: 10px">
  49. <span class="card_title">表单内容</span>
  50. <el-card shadow="always">
  51. <approval-form ref="realApprove" :trans-form="transForm?transForm.default:null" @contentChang="realApprovalChange" />
  52. </el-card>
  53. </el-col>
  54. </el-row>
  55. <el-row>
  56. <el-col style="padding-bottom: 10px">
  57. <span class="card_title">申请内容</span>
  58. <el-card shadow="always" style="padding: 15px 5px 5px 15px">
  59. <el-row>
  60. <el-col :span="3" class="col-txt"><span>申请理由</span></el-col>
  61. <el-col :span="20" class="col-input">
  62. <el-form-item prop="reason">
  63. <el-input v-model="auditForm.reason" type="textarea" :rows="1">
  64. 启动储备项目
  65. </el-input>
  66. </el-form-item>
  67. </el-col>
  68. </el-row>
  69. <el-row>
  70. <el-col :span="3" class="col-txt"><span>备注说明</span></el-col>
  71. <el-col :span="20" class="col-input">
  72. <el-form-item>
  73. <el-input v-model="auditForm.comment" type="textarea" :rows="2" />
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. <el-row>
  78. <el-col :span="3" class="col-txt"><span>附件上传</span></el-col>
  79. <el-col :span="20" class="col-input">
  80. <el-form-item>
  81. <el-upload
  82. ref="upload"
  83. class="upload-demo"
  84. :action="$constant.BASE_URI + '/FileController/upload'"
  85. :http-request="uploadHandleFile"
  86. :before-remove="beforeRemove"
  87. :limit="3"
  88. multiple
  89. :file-list="fileUrlList"
  90. >
  91. <el-button size="small" type="primary">点击上传</el-button>
  92. <div slot="tip" class="el-upload__tip">请上传50MB以内的文件</div>
  93. <div slot="file" slot-scope="{file}">
  94. <a :href="file.url">{{ file.name }}</a>
  95. <span class="el-upload-list__item-actions">
  96. <i class="el-icon-delete" @click="handlePictureRemove(file,fileUrlList)" />
  97. </span>
  98. </div>
  99. </el-upload>
  100. </el-form-item>
  101. </el-col>
  102. </el-row>
  103. </el-card>
  104. </el-col>
  105. </el-row>
  106. <el-row>
  107. <el-col style="padding-bottom: 10px">
  108. <span class="card_title">审核相关</span>
  109. <el-card shadow="always" style="padding: 15px 5px 5px 15px">
  110. <el-row v-if="auditType.key === $constant.AUDIT_TYPE.PRO_APPROVE.key||auditType.key === $constant.AUDIT_TYPE.SIGN.key||auditType.key === $constant.AUDIT_TYPE.ENDING.key">
  111. <el-col :span="3" class="col-txt"><span>下一步审核人</span></el-col>
  112. <el-col :span="20" class="col-input">
  113. <el-form-item prop="currAuditBy">
  114. <el-select v-model="auditForm.currAuditBy" placeholder="审核人">
  115. <el-option
  116. v-for="item in UserData"
  117. :key="item.value"
  118. :label="item.label"
  119. :value="item.value"
  120. />
  121. </el-select>
  122. </el-form-item>
  123. </el-col>
  124. </el-row>
  125. <el-row v-else-if="auditType.key === $constant.AUDIT_TYPE.PRIOR_UP.key">
  126. <el-col :span="3" class="col-txt"><span>下一步审核人</span></el-col>
  127. <el-col :span="20" class="col-input">
  128. <el-form-item prop="currAuditBy">
  129. <el-select v-model="auditForm.currAuditBy" placeholder="审核人">
  130. <el-option
  131. v-for="item in UserData2"
  132. :key="item.value"
  133. :label="item.label"
  134. :value="item.value"
  135. />
  136. </el-select>
  137. </el-form-item>
  138. </el-col>
  139. </el-row>
  140. <el-row v-else>
  141. <el-col :span="3" class="col-txt"><span>下一步审核人</span></el-col>
  142. <el-col :span="20" class="col-input">
  143. <el-form-item prop="currAuditBy">
  144. <user-select :default-select="selectList" :disab="selectDisable" :multiple="false" width="700" @selectValue="parentMethod" />
  145. <!-- <el-select v-model="auditForm.currAuditBy" placeholder="审核人">
  146. <el-option
  147. v-for="item in UserData"
  148. :key="item.value"
  149. :label="item.label"
  150. :value="item.value"
  151. />
  152. </el-select>-->
  153. </el-form-item>
  154. </el-col>
  155. </el-row>
  156. <el-row>
  157. <el-col :span="3" class="col-txt"><span>创建日期</span></el-col>
  158. <el-col :span="8" class="col-input">
  159. <el-form-item>
  160. <el-input v-model="auditForm.applytimeStr" disabled />
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="3" class="col-txt"><span>创建人</span></el-col>
  164. <el-col :span="9" class="col-input">
  165. <el-form-item>
  166. <el-input v-model="auditForm.applyname" disabled />
  167. </el-form-item>
  168. </el-col>
  169. </el-row>
  170. </el-card>
  171. </el-col>
  172. </el-row>
  173. </el-form>
  174. <div class="el-dialog__footer">
  175. <el-button @click="handleClose()">取 消</el-button>
  176. <el-button v-preventReClick type="primary" @click.native="handleCommit()">{{ onceCommit?'重新申请':'确 定' }}</el-button>
  177. </div>
  178. </div>
  179. </template>
  180. <script>
  181. import channel, { upload } from '../../../static/utils/channel'
  182. import Constant from '../../../static/utils/constant'
  183. import UserSelect from '@/views/components/UserSelect'
  184. import ContractDetail from '../../form/ctrForm'
  185. import ApprovalForm from '../../project/proApprovalForm'
  186. import AccPay from '../../form/apForm'
  187. import Base from '@/views/base/base'
  188. import BaseData from '@/views/base/baseData'
  189. export default {
  190. name: 'AuditApplyNew',
  191. components: {
  192. ContractDetail,
  193. AccPay,
  194. UserSelect,
  195. ApprovalForm
  196. },
  197. mixins: [Base, BaseData],
  198. props: {
  199. referenceId: {
  200. type: String,
  201. default: ''
  202. },
  203. auditTarget: {
  204. type: String,
  205. default: 'Project'
  206. },
  207. auditType: {
  208. type: Object,
  209. default: null
  210. },
  211. formType: {
  212. type: String,
  213. default: ''
  214. },
  215. // 续签标记(1:为续签)
  216. renewal: {
  217. type: String,
  218. default: ''
  219. },
  220. // 表单过程数据 (预算编制审核)
  221. auditData: {
  222. type: Object,
  223. default() {
  224. return {}
  225. }
  226. }
  227. },
  228. data() {
  229. return {
  230. dc_key: ['PRO_TYPE'],
  231. enableStatus: '2',
  232. dc_project_status: Constant.dc_project_status,
  233. dc_sign_status_all: Constant.dc_sign_status_2,
  234. UserData: [],
  235. UserData2: [],
  236. selectList: [],
  237. fileUrlList: [],
  238. loading: false,
  239. selectDisable: false,
  240. UserMap: {},
  241. auditForm: this.getProjectForm(),
  242. auditRules: {
  243. reason: [{ required: true, trigger: 'blur', message: '请输入申请原因' }],
  244. currAuditBy: [{ required: true, trigger: 'blur', message: '请选择下一步审核人' }]
  245. },
  246. realApproval: false,
  247. ctrFormPass: false,
  248. onceCommit: false,
  249. transForm: this.getAuditForm(this.referenceId, this.auditType, true)
  250. }
  251. },
  252. watch: {
  253. referenceId: {
  254. deep: true,
  255. handler(val) {
  256. this.getData(val)
  257. }
  258. },
  259. // formType: {
  260. // deep: true,
  261. // handler(val) {
  262. // this.getData(this.referenceId)
  263. // }
  264. // },
  265. auditType: {
  266. deep: true,
  267. handler(val) {
  268. this.initForm(val)
  269. }
  270. }
  271. },
  272. mounted() {
  273. this.generateDcMap()
  274. this.initProType().then((res) => {
  275. this.$nextTick(() => {
  276. this.initUser().then(() => {
  277. this.getData(this.referenceId)
  278. this.initForm(this.auditType)
  279. })
  280. })
  281. })
  282. },
  283. methods: {
  284. parentMethod: function(val) {
  285. if (val.length > 0) {
  286. this.auditForm.currAuditBy = val.join(',')
  287. }
  288. },
  289. baseRefresh: function(val) {
  290. console.log(val)
  291. if (this.auditForm && val) {
  292. this.auditForm.proname = val.proName
  293. this.auditForm.custname = val.custName
  294. }
  295. },
  296. getData: function(val) {
  297. if (this.auditTarget === 'Project' || this.auditTarget === 'BudgetMaking') {
  298. const postData = {
  299. id: val
  300. }
  301. this.loading = true
  302. channel.globleRequest('ProMainController', 'selectVoByPrimaryKey', postData, 'Project').then((res) => {
  303. if (res.data) {
  304. this.auditForm = this.getProjectForm(res.data)
  305. console.log(this.auditForm)
  306. if (this.formType == 'Prior' && this.auditForm.managedby) {
  307. const manage = this.auditForm.managedby ? this.auditForm.managedby.split(',') : []
  308. // if (manage.length === 1) {
  309. // this.selectDisable = true
  310. // this.selectList = manage
  311. // } else if (manage.length > 1) {
  312. // this.selectDisable = false
  313. // this.selectList = manage
  314. // }
  315. this.initUser2(manage)
  316. } else if (this.formType === 'Ending') {
  317. channel.globleRequest('FlowAuditDetailController', 'getCheckUserByEnding', { groupId: this.$common.currUser().groupId }, 'Project').then((res) => {
  318. if (res.data) {
  319. this.selectList.push(res.data.id)
  320. this.auditForm.currAuditBy = res.data.id
  321. }
  322. })
  323. } else {
  324. this.selectDisable = false
  325. }
  326. }
  327. this.loading = false
  328. }).catch(() => {
  329. this.loading = false
  330. })
  331. } else if (this.auditTarget === 'OutSource') {
  332. this.auditForm = this.getAccPayForm()
  333. }
  334. },
  335. /* 辅助相关*/
  336. initUser2: function(userIds) {
  337. const _this = this
  338. this.UserData2 = []
  339. this.UserMap2 = {}
  340. const post = {
  341. groupId: _this.$common.currUser() ? _this.$common.currUser().groupId : ''
  342. }
  343. return channel.globleRequest('SysUserExtendController', 'listAll', post, 'Pending Audit get user').then((res) => {
  344. if (res.data) {
  345. res.data.forEach(function(item) {
  346. if (userIds.indexOf(item.id) > -1) {
  347. const json = {
  348. label: item.truename,
  349. value: item.id
  350. }
  351. _this.UserData2.push(json)
  352. _this.UserMap2[json.value] = json.label
  353. }
  354. })
  355. }
  356. }).catch(() => {
  357. })
  358. },
  359. initForm: function(_auditType) {
  360. this.transForm = this.getAuditForm(this.referenceId, _auditType, true)
  361. },
  362. handleClose: function() {
  363. this.$emit('handleApplyClose')
  364. },
  365. /* 申请立项*/
  366. handleCommit: function() {
  367. this.$refs.auditForm.validate(valid => {
  368. if (valid) {
  369. // @Todo 流程启动,表单及类型
  370. this.auditApplyAdd(this.auditForm, this.auditType)
  371. } else {
  372. return false
  373. }
  374. })
  375. },
  376. auditApplyAdd: function(_val, _auditType) {
  377. const _this = this
  378. // 构建子表单数据
  379. const form = this.getAuditForm(_val.id, _auditType, false)
  380. // 构建目标表单数据
  381. let tId = _val.id
  382. if (this.auditTarget === 'OutSource') {
  383. tId = form.default.id
  384. }
  385. const target = this.getTarget(tId, _auditType)
  386. target.protype = _val.protype
  387. target.protypeId = _val.protypeId
  388. // 通用信息项
  389. const content = {
  390. proName: _val.proname,
  391. cusName: _val.custname
  392. }
  393. // 审批信息项
  394. const auditData = {
  395. auditType: _auditType.key,
  396. auditName: _auditType.name,
  397. auditTarget: this.$common.castString(target),
  398. auditForm: this.$common.castString(form),
  399. referenceId: _val.id,
  400. referenceContent: this.$common.castString(content),
  401. applyBy: _val.applyBy,
  402. currAuditBy: _val.currAuditBy,
  403. groupId: this.$common.currUser().groupId,
  404. auditStatus: '0'
  405. }
  406. // 审批过程子项
  407. const auditDetailData = {
  408. reason: _val.reason,
  409. comment: _val.comment,
  410. auditedBy: _val.applyBy,
  411. nextTo: _val.currAuditBy,
  412. auditResult: '0',
  413. groupId: this.$common.currUser().groupId
  414. }
  415. if (this.fileUrlList.length) {
  416. auditDetailData.auditFile = JSON.stringify(this.fileUrlList)
  417. }
  418. if (_this.ctrFormPass) {
  419. _this.$message.warning('合同信息中带*项必填')
  420. return
  421. }
  422. if (_this.realApproval) {
  423. _this.$message.warning('请编制项目预算并且项目实施计划不能为空')
  424. return
  425. }
  426. channel.globleRequest('FlowAuditController', 'add', auditData, 'audit').then((res) => {
  427. if (res.data.auditId) {
  428. auditDetailData.auditId = res.data.auditId
  429. channel.globleRequest('FlowAuditDetailController', 'add', auditDetailData, 'audit detail')
  430. if (_this.transForm.default.formType === 'Contract') {
  431. _this.$refs.contract.addContract(form.default.id)
  432. } else if (_this.transForm.default.formType === 'AccPay') {
  433. _this.$refs.accPay.addAP(form.default.id)
  434. } else if (_this.transForm.default.formType === 'RealApproval') {
  435. _this.$refs.realApprove.addApproval(form.default.id)
  436. }
  437. if (target.processData) {
  438. channel.globleRequest(target.target, target.op, target.processData, target.target).then((res) => {
  439. _this.$emit('handleApplyCommit')
  440. })
  441. } else {
  442. _this.$emit('handleApplyCommit')
  443. }
  444. }
  445. }).catch(() => {
  446. _this.$emit('handleApplyCommit')
  447. })
  448. },
  449. getTarget: function(_id, _auditType) {
  450. const target = {
  451. id: _id
  452. }
  453. if (this.auditTarget === 'Project') {
  454. target.target = 'ProMainController'
  455. target.op = 'edit'
  456. if (_auditType.key === Constant.AUDIT_TYPE.PRO_APPROVE.key) {
  457. target.processData = {
  458. id: _id,
  459. validstatus: '1'
  460. }
  461. target.passData = {
  462. id: _id,
  463. validstatus: '2',
  464. realValidStatus: '0',
  465. validat: true
  466. }
  467. target.refuseData = {
  468. id: _id,
  469. validstatus: '3',
  470. validat: false
  471. }
  472. } else if (_auditType.key === Constant.AUDIT_TYPE.SIGN.key) {
  473. target.processData = {
  474. id: _id,
  475. signstatus: '1'
  476. }
  477. target.passData = {
  478. id: _id,
  479. signstatus: '3'
  480. }
  481. target.refuseData = {
  482. id: _id,
  483. signstatus: '0'
  484. }
  485. } else if (_auditType.key === Constant.AUDIT_TYPE.PRIOR_UP.key) {
  486. target.processData = {
  487. id: _id,
  488. signstatus: '1'
  489. }
  490. target.passData = {
  491. id: _id,
  492. signstatus: '2',
  493. signat: true
  494. }
  495. target.refuseData = {
  496. id: _id,
  497. signstatus: '0'
  498. }
  499. } else if (_auditType.key === Constant.AUDIT_TYPE.TENDER.key) {
  500. target.processData = {
  501. id: _id,
  502. bidstatus: '1'
  503. }
  504. target.passData = {
  505. id: _id,
  506. bidstatus: '2',
  507. bidat: true
  508. }
  509. target.refuseData = {
  510. id: _id,
  511. bidstatus: '0'
  512. }
  513. } else if (_auditType.key === Constant.AUDIT_TYPE.ENDING.key) {
  514. target.processData = {
  515. id: _id,
  516. enablestatus: '1'
  517. }
  518. target.passData = {
  519. id: _id,
  520. enablestatus: '2',
  521. signstatus: '4',
  522. prostatus: '2',
  523. endingat: true
  524. }
  525. target.refuseData = {
  526. id: _id,
  527. enablestatus: '0'
  528. }
  529. } else if (_auditType.key === Constant.AUDIT_TYPE.PRO_REAL_APPROVE.key) {
  530. target.processData = {
  531. id: _id,
  532. realValidStatus: '1'
  533. }
  534. target.passData = {
  535. id: _id,
  536. realValidStatus: '2',
  537. prostatus: '0',
  538. realValidAt: true
  539. }
  540. target.refuseData = {
  541. id: _id,
  542. realValidStatus: '3',
  543. realValidAt: false
  544. }
  545. }
  546. } else if (this.auditTarget === 'OutSource') {
  547. target.target = 'AccPayableController'
  548. target.op = 'edit'
  549. if (_auditType.key === Constant.AUDIT_TYPE.ACC_PAY.key) {
  550. target.passData = {
  551. id: _id,
  552. apStatus: '1'
  553. }
  554. target.refuseData = {
  555. id: _id,
  556. apStatus: '3'
  557. }
  558. }
  559. } else if (this.auditTarget === 'BudgetMaking') {
  560. target.target = 'BudgetMakingController'
  561. target.op = 'editAudit'
  562. if (_auditType.key === Constant.AUDIT_TYPE.PRO_BUDGET_CHANGE.key) {
  563. target.passData = {
  564. proId: _id,
  565. budgetStatus: '3'
  566. }
  567. target.refuseData = {
  568. proId: _id,
  569. budgetStatus: '4'
  570. }
  571. }
  572. }
  573. return target
  574. },
  575. getAuditForm: function(_referenceId, _auditType, isAdd) {
  576. const _this = this
  577. const form = {
  578. default: {
  579. referenceId: _referenceId,
  580. referenceType: this.auditTarget,
  581. isAdd: isAdd
  582. }
  583. }
  584. if (_auditType.key === Constant.AUDIT_TYPE.PRO_APPROVE.key) {
  585. form.default.controller = ''
  586. form.default.opQuery = ''
  587. form.default.formType = 'Approve'
  588. } else if (_auditType.key === Constant.AUDIT_TYPE.SIGN.key) {
  589. form.default.id = 'cid-' + String(new Date().getTime())
  590. form.default.controller = 'CtrMainController'
  591. form.default.opQuery = 'getById/' + form.default.id
  592. form.default.formType = 'Contract'
  593. form.default.opUpdate = 'edit'
  594. form.default.updateData = {
  595. valid: '1'
  596. }
  597. } else if (_auditType.key === Constant.AUDIT_TYPE.PRIOR_UP.key) {
  598. form.default.controller = ''
  599. form.default.opQuery = ''
  600. form.default.formType = 'Prior'
  601. } else if (_auditType.key === Constant.AUDIT_TYPE.TENDER.key) {
  602. form.default.controller = ''
  603. form.default.opQuery = ''
  604. form.default.formType = 'Tender'
  605. } else if (_auditType.key === Constant.AUDIT_TYPE.ENDING.key) {
  606. form.default.controller = ''
  607. form.default.opQuery = ''
  608. form.default.formType = 'Ending'
  609. } else if (_auditType.key === Constant.AUDIT_TYPE.ACC_PAY.key) {
  610. form.default.id = 'aid-' + String(new Date().getTime())
  611. form.default.controller = 'AccPayableController'
  612. form.default.opQuery = 'getById/' + form.default.id
  613. form.default.formType = 'AccPay'
  614. form.default.opUpdate = 'edit'
  615. form.default.updateData = {
  616. apStatus: '1'
  617. }
  618. } else if (_auditType.key === Constant.AUDIT_TYPE.PRO_REAL_APPROVE.key) {
  619. form.default.id = 'cid-' + String(new Date().getTime())
  620. form.default.controller = 'ProApprovalController'
  621. form.default.opQuery = 'getById/' + form.default.id
  622. form.default.formType = 'RealApproval'
  623. form.default.proId = _referenceId
  624. form.default.opUpdate = 'edit'
  625. form.default.updateData = {}
  626. this.getProApprovalByProId(_referenceId)
  627. } else if (_auditType.key === Constant.AUDIT_TYPE.PRO_BUDGET_CHANGE.key) {
  628. form.default.formType = 'BudgetMaking'
  629. form.default.cbList = this.auditData.cbList || []
  630. form.default.fyList = this.auditData.fyList || []
  631. }
  632. return form
  633. },
  634. getProjectForm: function(obj) {
  635. const currUser = this.$common.currUser()
  636. return {
  637. id: obj ? obj.id : '',
  638. proname: obj ? obj.proname : '',
  639. custname: obj ? obj.custname : '',
  640. protype: obj ? this.ProTypeMap[obj.protype] : '',
  641. protypeId: obj ? obj.protype : '',
  642. prostatus: obj ? this.dc_map.dc_project_status[obj.prostatus] : '',
  643. signStatus: obj ? this.dc_map.dc_sign_status_all[obj.signstatus] : '',
  644. presales: obj ? obj.presales : '',
  645. managedby: obj ? obj.managedby : '',
  646. reason: '',
  647. comment: '',
  648. currAuditBy: '',
  649. applyBy: currUser ? currUser.id : '',
  650. applyname: currUser ? currUser.truename : '',
  651. applytimeStr: this.$common.transDate(new Date().getTime())
  652. }
  653. },
  654. getAccPayForm: function(obj) {
  655. const currUser = this.$common.currUser()
  656. return {
  657. id: '',
  658. proname: '',
  659. custname: '',
  660. reason: '',
  661. comment: '',
  662. currAuditBy: '',
  663. applyBy: currUser ? currUser.id : '',
  664. applyname: currUser ? currUser.truename : '',
  665. applytimeStr: this.$common.transDate(new Date().getTime())
  666. }
  667. },
  668. realApprovalChange: function(val) {
  669. if (!val) {
  670. this.realApproval = true
  671. } else {
  672. this.realApproval = false
  673. }
  674. },
  675. ctrFormPassChange: function(val) {
  676. if (!val) {
  677. this.ctrFormPass = true
  678. } else {
  679. this.ctrFormPass = false
  680. }
  681. },
  682. generateDcMap: function() {
  683. this.dc_map['dc_project_status'] = this.$common.transDcMap(Constant.dc_project_status)
  684. this.dc_map['dc_sign_status_all'] = this.$common.transDcMap(Constant.dc_sign_status_2)
  685. },
  686. /* 辅助相关*/
  687. initUser: function() {
  688. const _this = this
  689. this.UserData = []
  690. this.UserMap = {}
  691. const post = {
  692. groupId: _this.$common.currUser() ? _this.$common.currUser().groupId : '',
  693. roleKey: 'XMCG'
  694. }
  695. return channel.globleRequest('SysUserExtendController', 'userByRoleData', post, 'Pending Audit get user').then((res) => {
  696. if (res.data) {
  697. res.data.forEach(function(item) {
  698. if (item.id) {
  699. const json = {
  700. label: item.trueName,
  701. value: item.id
  702. }
  703. _this.UserData.push(json)
  704. _this.UserMap[json.value] = json.label
  705. }
  706. })
  707. }
  708. }).catch(() => {
  709. })
  710. },
  711. getProApprovalByProId: async function(_referenceId) {
  712. const _this = this
  713. await this.$axios({
  714. headers: {
  715. 'MVVM-Key': String(new Date().getTime()),
  716. 'xx': 'anything'
  717. },
  718. method: 'post',
  719. url: _this.$constant.BASE_URI + '/ProApprovalController/getByProId/' + this.referenceId,
  720. data: {}
  721. }).then((res) => {
  722. if (res.data.id) {
  723. _this.onceCommit = true
  724. }
  725. })
  726. },
  727. uploadHandleFile(param) {
  728. this.loading = true
  729. upload(param, true).then((res) => {
  730. if (res.key === 200) {
  731. this.fileUrlList.push(res)
  732. this.$message.info('文件上传成功')
  733. } else {
  734. const uid = param.file.uid
  735. const idx = this.$refs.upload.uploadFiles.findIndex(item => item.uid === uid)
  736. this.$refs.upload.uploadFiles.splice(idx, 1)
  737. this.$message.error('文件上传失败')
  738. }
  739. this.loading = false
  740. }).catch(() => {
  741. this.$message.error('文件上传异常!')
  742. this.loading = false
  743. const uid = param.file.uid
  744. const idx = this.$refs.upload.uploadFiles.findIndex(item => item.uid === uid)
  745. this.$refs.upload.uploadFiles.splice(idx, 1)
  746. })
  747. }
  748. }
  749. }
  750. </script>
  751. <style scoped>
  752. .audit-card {
  753. width: 70%;
  754. }
  755. .self {
  756. background: #95ec69;
  757. }
  758. .title {
  759. line-height: 28px;
  760. }
  761. .comment{
  762. line-height: 24px;
  763. }
  764. .text {
  765. font-size: 14px;
  766. }
  767. </style>
  768. <style scoped lang="scss">
  769. .AuditApply1{
  770. .el-card__header {
  771. padding: 10px 20px;
  772. }
  773. .el-card__body {
  774. padding: 10px 20px;
  775. }
  776. .el-upload{
  777. width: 0 !important;
  778. }
  779. .el-upload-list li{
  780. text-align: left !important;
  781. }
  782. }
  783. </style>