AuditApply.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  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 AccPay from '../../form/apForm'
  186. import Base from '@/views/base/base'
  187. import BaseData from '@/views/base/baseData'
  188. export default {
  189. name: 'AuditApplyNew',
  190. components: {
  191. ContractDetail,
  192. AccPay,
  193. UserSelect,
  194. },
  195. mixins: [Base, BaseData],
  196. props: {
  197. referenceId: {
  198. type: String,
  199. default: ''
  200. },
  201. auditTarget: {
  202. type: String,
  203. default: 'Project'
  204. },
  205. auditType: {
  206. type: Object,
  207. default: null
  208. },
  209. formType: {
  210. type: String,
  211. default: ''
  212. },
  213. // 续签标记(1:为续签)
  214. renewal: {
  215. type: String,
  216. default: ''
  217. },
  218. // 表单过程数据 (预算编制审核)
  219. auditData: {
  220. type: Object,
  221. default() {
  222. return {}
  223. }
  224. }
  225. },
  226. data() {
  227. return {
  228. dc_key: ['PRO_TYPE'],
  229. enableStatus: '2',
  230. dc_project_status: Constant.dc_project_status,
  231. dc_sign_status_all: Constant.dc_sign_status_2,
  232. UserData: [],
  233. UserData2: [],
  234. selectList: [],
  235. fileUrlList: [],
  236. loading: false,
  237. selectDisable: false,
  238. UserMap: {},
  239. auditForm: this.getProjectForm(),
  240. auditRules: {
  241. reason: [{ required: true, trigger: 'blur', message: '请输入申请原因' }],
  242. currAuditBy: [{ required: true, trigger: 'blur', message: '请选择下一步审核人' }]
  243. },
  244. realApproval: false,
  245. ctrFormPass: false,
  246. onceCommit: false,
  247. transForm: this.getAuditForm(this.referenceId, this.auditType, true)
  248. }
  249. },
  250. watch: {
  251. referenceId: {
  252. deep: true,
  253. handler(val) {
  254. this.getData(val)
  255. }
  256. },
  257. // formType: {
  258. // deep: true,
  259. // handler(val) {
  260. // this.getData(this.referenceId)
  261. // }
  262. // },
  263. auditType: {
  264. deep: true,
  265. handler(val) {
  266. this.initForm(val)
  267. }
  268. }
  269. },
  270. mounted() {
  271. this.generateDcMap()
  272. this.initProType().then((res) => {
  273. this.$nextTick(() => {
  274. this.initUser().then(() => {
  275. this.getData(this.referenceId)
  276. this.initForm(this.auditType)
  277. })
  278. })
  279. })
  280. },
  281. methods: {
  282. parentMethod: function(val) {
  283. if (val.length > 0) {
  284. this.auditForm.currAuditBy = val.join(',')
  285. }
  286. },
  287. baseRefresh: function(val) {
  288. console.log(val)
  289. if (this.auditForm && val) {
  290. this.auditForm.proname = val.proName
  291. this.auditForm.custname = val.custName
  292. }
  293. },
  294. getData: function(val) {
  295. if (this.auditTarget === 'Project' || this.auditTarget === 'BudgetMaking') {
  296. const postData = {
  297. id: val
  298. }
  299. this.loading = true
  300. channel.globleRequest('ProMainController', 'selectVoByPrimaryKey', postData, 'Project').then((res) => {
  301. if (res.data) {
  302. this.auditForm = this.getProjectForm(res.data)
  303. console.log(this.auditForm)
  304. if (this.formType == 'Prior' && this.auditForm.managedby) {
  305. const manage = this.auditForm.managedby ? this.auditForm.managedby.split(',') : []
  306. // if (manage.length === 1) {
  307. // this.selectDisable = true
  308. // this.selectList = manage
  309. // } else if (manage.length > 1) {
  310. // this.selectDisable = false
  311. // this.selectList = manage
  312. // }
  313. this.initUser2(manage)
  314. } else if (this.formType === 'Ending') {
  315. channel.globleRequest('FlowAuditDetailController', 'getCheckUserByEnding', { groupId: this.$common.currUser().groupId }, 'Project').then((res) => {
  316. if (res.data) {
  317. this.selectList.push(res.data.id)
  318. this.auditForm.currAuditBy = res.data.id
  319. }
  320. })
  321. } else {
  322. this.selectDisable = false
  323. }
  324. }
  325. this.loading = false
  326. }).catch(() => {
  327. this.loading = false
  328. })
  329. } else if (this.auditTarget === 'OutSource') {
  330. this.auditForm = this.getAccPayForm()
  331. }
  332. },
  333. /* 辅助相关*/
  334. initUser2: function(userIds) {
  335. const _this = this
  336. this.UserData2 = []
  337. this.UserMap2 = {}
  338. const post = {
  339. groupId: _this.$common.currUser() ? _this.$common.currUser().groupId : ''
  340. }
  341. return channel.globleRequest('SysUserExtendController', 'listAll', post, 'Pending Audit get user').then((res) => {
  342. if (res.data) {
  343. res.data.forEach(function(item) {
  344. if (userIds.indexOf(item.id) > -1) {
  345. const json = {
  346. label: item.truename,
  347. value: item.id
  348. }
  349. _this.UserData2.push(json)
  350. _this.UserMap2[json.value] = json.label
  351. }
  352. })
  353. }
  354. }).catch(() => {
  355. })
  356. },
  357. initForm: function(_auditType) {
  358. this.transForm = this.getAuditForm(this.referenceId, _auditType, true)
  359. },
  360. handleClose: function() {
  361. this.$emit('handleApplyClose')
  362. },
  363. /* 申请立项*/
  364. handleCommit: function() {
  365. this.$refs.auditForm.validate(valid => {
  366. if (valid) {
  367. // @Todo 流程启动,表单及类型
  368. this.auditApplyAdd(this.auditForm, this.auditType)
  369. } else {
  370. return false
  371. }
  372. })
  373. },
  374. auditApplyAdd: function(_val, _auditType) {
  375. const _this = this
  376. // 构建子表单数据
  377. const form = this.getAuditForm(_val.id, _auditType, false)
  378. // 构建目标表单数据
  379. let tId = _val.id
  380. if (this.auditTarget === 'OutSource') {
  381. tId = form.default.id
  382. }
  383. const target = this.getTarget(tId, _auditType)
  384. target.protype = _val.protype
  385. target.protypeId = _val.protypeId
  386. // 通用信息项
  387. const content = {
  388. proName: _val.proname,
  389. cusName: _val.custname
  390. }
  391. // 审批信息项
  392. const auditData = {
  393. auditType: _auditType.key,
  394. auditName: _auditType.name,
  395. auditTarget: this.$common.castString(target),
  396. auditForm: this.$common.castString(form),
  397. referenceId: _val.id,
  398. referenceContent: this.$common.castString(content),
  399. applyBy: _val.applyBy,
  400. currAuditBy: _val.currAuditBy,
  401. groupId: this.$common.currUser().groupId,
  402. auditStatus: '0'
  403. }
  404. // 审批过程子项
  405. const auditDetailData = {
  406. reason: _val.reason,
  407. comment: _val.comment,
  408. auditedBy: _val.applyBy,
  409. nextTo: _val.currAuditBy,
  410. auditResult: '0',
  411. groupId: this.$common.currUser().groupId
  412. }
  413. if (this.fileUrlList.length) {
  414. auditDetailData.auditFile = JSON.stringify(this.fileUrlList)
  415. }
  416. if (_this.ctrFormPass) {
  417. _this.$message.warning('合同信息中带*项必填')
  418. return
  419. }
  420. if (_this.realApproval) {
  421. _this.$message.warning('请编制项目预算并且项目实施计划不能为空')
  422. return
  423. }
  424. channel.globleRequest('FlowAuditController', 'add', auditData, 'audit').then((res) => {
  425. if (res.data.auditId) {
  426. auditDetailData.auditId = res.data.auditId
  427. channel.globleRequest('FlowAuditDetailController', 'add', auditDetailData, 'audit detail')
  428. if (_this.transForm.default.formType === 'Contract') {
  429. _this.$refs.contract.addContract(form.default.id)
  430. } else if (_this.transForm.default.formType === 'AccPay') {
  431. _this.$refs.accPay.addAP(form.default.id)
  432. } else if (_this.transForm.default.formType === 'RealApproval') {
  433. _this.$refs.realApprove.addApproval(form.default.id)
  434. }
  435. if (target.processData) {
  436. channel.globleRequest(target.target, target.op, target.processData, target.target).then((res) => {
  437. _this.$emit('handleApplyCommit')
  438. })
  439. } else {
  440. _this.$emit('handleApplyCommit')
  441. }
  442. }
  443. }).catch(() => {
  444. _this.$emit('handleApplyCommit')
  445. })
  446. },
  447. getTarget: function(_id, _auditType) {
  448. const target = {
  449. id: _id
  450. }
  451. if (this.auditTarget === 'Project') {
  452. target.target = 'ProMainController'
  453. target.op = 'edit'
  454. if (_auditType.key === Constant.AUDIT_TYPE.PRO_APPROVE.key) {
  455. target.processData = {
  456. id: _id,
  457. validstatus: '1'
  458. }
  459. target.passData = {
  460. id: _id,
  461. validstatus: '2',
  462. realValidStatus: '0',
  463. validat: true
  464. }
  465. target.refuseData = {
  466. id: _id,
  467. validstatus: '3',
  468. validat: false
  469. }
  470. } else if (_auditType.key === Constant.AUDIT_TYPE.SIGN.key) {
  471. target.processData = {
  472. id: _id,
  473. signstatus: '1'
  474. }
  475. target.passData = {
  476. id: _id,
  477. signstatus: '3'
  478. }
  479. target.refuseData = {
  480. id: _id,
  481. signstatus: '0'
  482. }
  483. } else if (_auditType.key === Constant.AUDIT_TYPE.PRIOR_UP.key) {
  484. target.processData = {
  485. id: _id,
  486. signstatus: '7'
  487. }
  488. target.passData = {
  489. id: _id,
  490. signstatus: '2',
  491. signat: true
  492. }
  493. target.refuseData = {
  494. id: _id,
  495. signstatus: '0'
  496. }
  497. } else if (_auditType.key === Constant.AUDIT_TYPE.TENDER.key) {
  498. target.processData = {
  499. id: _id,
  500. bidstatus: '1'
  501. }
  502. target.passData = {
  503. id: _id,
  504. bidstatus: '2',
  505. bidat: true
  506. }
  507. target.refuseData = {
  508. id: _id,
  509. bidstatus: '0'
  510. }
  511. } else if (_auditType.key === Constant.AUDIT_TYPE.ENDING.key) {
  512. target.processData = {
  513. id: _id,
  514. enablestatus: '1'
  515. }
  516. target.passData = {
  517. id: _id,
  518. enablestatus: '2',
  519. signstatus: '4',
  520. prostatus: '2',
  521. endingat: true
  522. }
  523. target.refuseData = {
  524. id: _id,
  525. enablestatus: '0'
  526. }
  527. } else if (_auditType.key === Constant.AUDIT_TYPE.PRO_REAL_APPROVE.key) {
  528. target.processData = {
  529. id: _id,
  530. realValidStatus: '1'
  531. }
  532. target.passData = {
  533. id: _id,
  534. realValidStatus: '2',
  535. prostatus: '0',
  536. realValidAt: true
  537. }
  538. target.refuseData = {
  539. id: _id,
  540. realValidStatus: '3',
  541. realValidAt: false
  542. }
  543. }
  544. } else if (this.auditTarget === 'OutSource') {
  545. target.target = 'AccPayableController'
  546. target.op = 'edit'
  547. if (_auditType.key === Constant.AUDIT_TYPE.ACC_PAY.key) {
  548. target.passData = {
  549. id: _id,
  550. apStatus: '1'
  551. }
  552. target.refuseData = {
  553. id: _id,
  554. apStatus: '3'
  555. }
  556. }
  557. } else if (this.auditTarget === 'BudgetMaking') {
  558. target.target = 'BudgetMakingController'
  559. target.op = 'editAudit'
  560. if (_auditType.key === Constant.AUDIT_TYPE.PRO_BUDGET_CHANGE.key) {
  561. target.passData = {
  562. proId: _id,
  563. budgetStatus: '3'
  564. }
  565. target.refuseData = {
  566. proId: _id,
  567. budgetStatus: '4'
  568. }
  569. }
  570. }
  571. return target
  572. },
  573. getAuditForm: function(_referenceId, _auditType, isAdd) {
  574. const _this = this
  575. const form = {
  576. default: {
  577. referenceId: _referenceId,
  578. referenceType: this.auditTarget,
  579. isAdd: isAdd
  580. }
  581. }
  582. if (_auditType.key === Constant.AUDIT_TYPE.PRO_APPROVE.key) {
  583. form.default.controller = ''
  584. form.default.opQuery = ''
  585. form.default.formType = 'Approve'
  586. } else if (_auditType.key === Constant.AUDIT_TYPE.SIGN.key) {
  587. form.default.id = 'cid-' + String(new Date().getTime())
  588. form.default.controller = 'CtrMainController'
  589. form.default.opQuery = 'getById/' + form.default.id
  590. form.default.formType = 'Contract'
  591. form.default.opUpdate = 'edit'
  592. form.default.updateData = {
  593. valid: '1'
  594. }
  595. } else if (_auditType.key === Constant.AUDIT_TYPE.PRIOR_UP.key) {
  596. form.default.controller = ''
  597. form.default.opQuery = ''
  598. form.default.formType = 'Prior'
  599. } else if (_auditType.key === Constant.AUDIT_TYPE.TENDER.key) {
  600. form.default.controller = ''
  601. form.default.opQuery = ''
  602. form.default.formType = 'Tender'
  603. } else if (_auditType.key === Constant.AUDIT_TYPE.ENDING.key) {
  604. form.default.controller = ''
  605. form.default.opQuery = ''
  606. form.default.formType = 'Ending'
  607. } else if (_auditType.key === Constant.AUDIT_TYPE.ACC_PAY.key) {
  608. form.default.id = 'aid-' + String(new Date().getTime())
  609. form.default.controller = 'AccPayableController'
  610. form.default.opQuery = 'getById/' + form.default.id
  611. form.default.formType = 'AccPay'
  612. form.default.opUpdate = 'edit'
  613. form.default.updateData = {
  614. apStatus: '1'
  615. }
  616. } else if (_auditType.key === Constant.AUDIT_TYPE.PRO_REAL_APPROVE.key) {
  617. form.default.id = 'cid-' + String(new Date().getTime())
  618. form.default.controller = 'ProApprovalController'
  619. form.default.opQuery = 'getById/' + form.default.id
  620. form.default.formType = 'RealApproval'
  621. form.default.proId = _referenceId
  622. form.default.opUpdate = 'edit'
  623. form.default.updateData = {}
  624. this.getProApprovalByProId(_referenceId)
  625. } else if (_auditType.key === Constant.AUDIT_TYPE.PRO_BUDGET_CHANGE.key) {
  626. form.default.formType = 'BudgetMaking'
  627. form.default.cbList = this.auditData.cbList || []
  628. form.default.fyList = this.auditData.fyList || []
  629. }
  630. return form
  631. },
  632. getProjectForm: function(obj) {
  633. const currUser = this.$common.currUser()
  634. return {
  635. id: obj ? obj.id : '',
  636. proname: obj ? obj.proname : '',
  637. custname: obj ? obj.custname : '',
  638. protype: obj ? this.ProTypeMap[obj.protype] : '',
  639. protypeId: obj ? obj.protype : '',
  640. prostatus: obj ? this.dc_map.dc_project_status[obj.prostatus] : '',
  641. signStatus: obj ? this.dc_map.dc_sign_status_all[obj.signstatus] : '',
  642. presales: obj ? obj.presales : '',
  643. managedby: obj ? obj.managedby : '',
  644. reason: '',
  645. comment: '',
  646. currAuditBy: '',
  647. applyBy: currUser ? currUser.id : '',
  648. applyname: currUser ? currUser.truename : '',
  649. applytimeStr: this.$common.transDate(new Date().getTime())
  650. }
  651. },
  652. getAccPayForm: function(obj) {
  653. const currUser = this.$common.currUser()
  654. return {
  655. id: '',
  656. proname: '',
  657. custname: '',
  658. reason: '',
  659. comment: '',
  660. currAuditBy: '',
  661. applyBy: currUser ? currUser.id : '',
  662. applyname: currUser ? currUser.truename : '',
  663. applytimeStr: this.$common.transDate(new Date().getTime())
  664. }
  665. },
  666. realApprovalChange: function(val) {
  667. if (!val) {
  668. this.realApproval = true
  669. } else {
  670. this.realApproval = false
  671. }
  672. },
  673. ctrFormPassChange: function(val) {
  674. if (!val) {
  675. this.ctrFormPass = true
  676. } else {
  677. this.ctrFormPass = false
  678. }
  679. },
  680. generateDcMap: function() {
  681. this.dc_map['dc_project_status'] = this.$common.transDcMap(Constant.dc_project_status)
  682. this.dc_map['dc_sign_status_all'] = this.$common.transDcMap(Constant.dc_sign_status_2)
  683. },
  684. /* 辅助相关*/
  685. initUser: function() {
  686. const _this = this
  687. this.UserData = []
  688. this.UserMap = {}
  689. const post = {
  690. groupId: _this.$common.currUser() ? _this.$common.currUser().groupId : '',
  691. roleKey: 'XMCG'
  692. }
  693. return channel.globleRequest('SysUserExtendController', 'userByRoleData', post, 'Pending Audit get user').then((res) => {
  694. if (res.data) {
  695. res.data.forEach(function(item) {
  696. if (item.id) {
  697. const json = {
  698. label: item.trueName,
  699. value: item.id
  700. }
  701. _this.UserData.push(json)
  702. _this.UserMap[json.value] = json.label
  703. }
  704. })
  705. }
  706. }).catch(() => {
  707. })
  708. },
  709. getProApprovalByProId: async function(_referenceId) {
  710. const _this = this
  711. await this.$axios({
  712. headers: {
  713. 'MVVM-Key': String(new Date().getTime()),
  714. 'xx': 'anything'
  715. },
  716. method: 'post',
  717. url: _this.$constant.BASE_URI + '/ProApprovalController/getByProId/' + this.referenceId,
  718. data: {}
  719. }).then((res) => {
  720. if (res.data.id) {
  721. _this.onceCommit = true
  722. }
  723. })
  724. },
  725. uploadHandleFile(param) {
  726. this.loading = true
  727. upload(param, true).then((res) => {
  728. if (res.key === 200) {
  729. this.fileUrlList.push(res)
  730. this.$message.info('文件上传成功')
  731. } else {
  732. const uid = param.file.uid
  733. const idx = this.$refs.upload.uploadFiles.findIndex(item => item.uid === uid)
  734. this.$refs.upload.uploadFiles.splice(idx, 1)
  735. this.$message.error('文件上传失败')
  736. }
  737. this.loading = false
  738. }).catch(() => {
  739. this.$message.error('文件上传异常!')
  740. this.loading = false
  741. const uid = param.file.uid
  742. const idx = this.$refs.upload.uploadFiles.findIndex(item => item.uid === uid)
  743. this.$refs.upload.uploadFiles.splice(idx, 1)
  744. })
  745. }
  746. }
  747. }
  748. </script>
  749. <style scoped>
  750. .audit-card {
  751. width: 70%;
  752. }
  753. .self {
  754. background: #95ec69;
  755. }
  756. .title {
  757. line-height: 28px;
  758. }
  759. .comment{
  760. line-height: 24px;
  761. }
  762. .text {
  763. font-size: 14px;
  764. }
  765. </style>
  766. <style scoped lang="scss">
  767. .AuditApply1{
  768. .el-card__header {
  769. padding: 10px 20px;
  770. }
  771. .el-card__body {
  772. padding: 10px 20px;
  773. }
  774. .el-upload{
  775. width: 0 !important;
  776. }
  777. .el-upload-list li{
  778. text-align: left !important;
  779. }
  780. }
  781. </style>