upgrade.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-12 11:57:48
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-03-08 15:15:33
  6. * @Description: file content
  7. * @FilePath: \oms\pages\project\upgrade.vue
  8. -->
  9. <template>
  10. <view class="home">
  11. <view class="nav">
  12. <view :style="{ paddingTop }">
  13. <view class="title" :style="[{ height }, { lineHeight: height }]">
  14. <view class="back" @click="goBack()">
  15. <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
  16. </view>
  17. <text>项目升级</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="main">
  22. <u-form :model="addForm" :rules="rules" ref="addForm" label-width="0">
  23. <u-form-item prop="nboType" borderBottom customStyle="padding:40rpx 0 30rpx">
  24. <view class="form-label flex_l">
  25. <view class="label-tag"></view>
  26. 项目级别
  27. </view>
  28. <u-radio-group v-model="addForm.nboType" placement="row">
  29. <u-radio
  30. customStyle="margin-right:40rpx"
  31. :disabled="projectDetails.nboType === '10'"
  32. label="A"
  33. name="10"></u-radio>
  34. <u-radio
  35. customStyle="margin-right:40rpx"
  36. :disabled="projectDetails.nboType === '20'"
  37. label="B"
  38. name="20"></u-radio>
  39. <u-radio
  40. :disabled="['10', '20', '30'].includes(projectDetails.nboType)"
  41. customStyle="margin-right:40rpx"
  42. label="C"
  43. name="30"></u-radio>
  44. <!-- <u-radio v-if="projectDetails.nboType === '10'" label="储备" name="50"></u-radio> -->
  45. </u-radio-group>
  46. </u-form-item>
  47. <view v-if="addForm.nboType !== '30'">
  48. <u-form-item prop="nboBudget" borderBottom customStyle="padding:40rpx 0 30rpx">
  49. <view class="form-label flex_l">
  50. <view class="label-tag"></view>
  51. 项目预算
  52. </view>
  53. <u-input
  54. placeholder="输入项目预算"
  55. v-model="addForm.nboBudget"
  56. border="none"
  57. type="number"
  58. suffixIconStyle="color:#CDCDCD"
  59. clearable
  60. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  61. </u-form-item>
  62. <u-form-item
  63. prop="distributorName"
  64. borderBottom
  65. customStyle="padding:40rpx 0 30rpx"
  66. @click="$refs.dealer.open()">
  67. <view class="form-label flex_l">经销商/代理商</view>
  68. <u-input
  69. :readonly="true"
  70. placeholder="请选择经销商/代理商"
  71. v-model="addForm.distributorName"
  72. border="none"
  73. suffixIcon="arrow-down"
  74. suffixIconStyle="color:#CDCDCD"
  75. clearable
  76. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  77. </u-form-item>
  78. <u-form-item prop="parentReceiver" borderBottom customStyle="padding:40rpx 0 30rpx">
  79. <view class="form-label flex_l">总部对接人</view>
  80. <u-input
  81. placeholder="输入总部对接人"
  82. v-model="addForm.parentReceiver"
  83. border="none"
  84. suffixIconStyle="color:#CDCDCD"
  85. clearable
  86. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  87. </u-form-item>
  88. </view>
  89. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" v-if="addForm.nboType !== '30'">
  90. <view class="form-label flex_l">技术支持人员</view>
  91. <u-input
  92. placeholder="输入技术支持人员"
  93. v-model="addForm.technicalSupportName"
  94. border="none"
  95. suffixIconStyle="color:#CDCDCD"
  96. clearable
  97. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  98. </u-form-item>
  99. <u-form-item
  100. prop="technicalSupportContent"
  101. borderBottom
  102. customStyle="padding:40rpx 0 30rpx"
  103. v-if="addForm.nboType !== '30'">
  104. <view class="form-label flex_l">
  105. <view class="label-tag"></view>
  106. 技术支持内容
  107. </view>
  108. <u-input
  109. placeholder="输入技术支持内容"
  110. v-model="addForm.technicalSupportContent"
  111. border="none"
  112. suffixIconStyle="color:#CDCDCD"
  113. clearable
  114. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  115. </u-form-item>
  116. <u-form-item
  117. borderBottom
  118. customStyle="padding:40rpx 0 30rpx"
  119. @click="showSupportDate = true"
  120. v-if="addForm.nboType !== '30'">
  121. <view class="form-label flex_l">技术支持时间</view>
  122. <u-input
  123. :readonly="true"
  124. placeholder="请选择技术支持时间"
  125. v-model="addForm.technicalSupportTime"
  126. border="none"
  127. suffixIcon="arrow-down"
  128. suffixIconStyle="color:#CDCDCD"
  129. clearable
  130. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  131. </u-form-item>
  132. <view v-if="addForm.nboType !== '30'">
  133. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showBudgetDate = true">
  134. <view class="form-label flex_l">项目预算期限</view>
  135. <u-input
  136. :readonly="true"
  137. placeholder="请选择项目预算期限"
  138. v-model="addForm.nboBudgetTime"
  139. border="none"
  140. suffixIcon="arrow-down"
  141. suffixIconStyle="color:#CDCDCD"
  142. clearable
  143. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  144. </u-form-item>
  145. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
  146. <view class="form-label flex_l">资金来源</view>
  147. <u-input
  148. placeholder="输入资金来源"
  149. v-model="addForm.capitalSource"
  150. border="none"
  151. suffixIconStyle="color:#CDCDCD"
  152. clearable
  153. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  154. </u-form-item>
  155. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
  156. <view class="form-label flex_l">产品/方案满足情况</view>
  157. <u-input
  158. placeholder="输入产品/方案满足情况"
  159. v-model="addForm.productSatisfaction"
  160. border="none"
  161. suffixIconStyle="color:#CDCDCD"
  162. clearable
  163. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  164. </u-form-item>
  165. </view>
  166. <view v-if="addForm.nboType === '10'">
  167. <u-form-item
  168. prop="purchasingWayVal"
  169. borderBottom
  170. customStyle="padding:40rpx 0 30rpx"
  171. @click="showChasingWay = true">
  172. <view class="form-label flex_l">
  173. <view class="label-tag"></view>
  174. 采购方式
  175. </view>
  176. <u-input
  177. :readonly="true"
  178. placeholder="请选择采购方式"
  179. v-model="addForm.purchasingWayVal"
  180. border="none"
  181. suffixIcon="arrow-down"
  182. suffixIconStyle="color:#CDCDCD"
  183. clearable
  184. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  185. </u-form-item>
  186. <u-form-item
  187. prop="technicalSupportTime"
  188. borderBottom
  189. customStyle="padding:40rpx 0 30rpx"
  190. @click="showPurchasingDate = true">
  191. <view class="form-label flex_l">
  192. <view class="label-tag"></view>
  193. 采购时间
  194. </view>
  195. <u-input
  196. :readonly="true"
  197. placeholder="请选择采购时间"
  198. v-model="addForm.technicalSupportTime"
  199. border="none"
  200. suffixIcon="arrow-down"
  201. suffixIconStyle="color:#CDCDCD"
  202. clearable
  203. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  204. </u-form-item>
  205. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="selectContact()">
  206. <view class="form-label flex_l">决策人员</view>
  207. <u-input
  208. :readonly="true"
  209. placeholder="输入决策人员"
  210. v-model="addForm.makerName"
  211. border="none"
  212. suffixIconStyle="color:#CDCDCD"
  213. clearable
  214. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  215. </u-form-item>
  216. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
  217. <view class="form-label flex_l">决策部门</view>
  218. <u-input
  219. :readonly="true"
  220. placeholder="输入决策部门"
  221. v-model="addForm.makerDept"
  222. border="none"
  223. suffixIconStyle="color:#CDCDCD"
  224. clearable
  225. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  226. </u-form-item>
  227. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
  228. <view class="form-label flex_l">经销商与客户历史成交信息</view>
  229. <u-input
  230. placeholder="输入经销商与客户历史成交信息"
  231. v-model="addForm.historicalTransactionInfo"
  232. border="none"
  233. suffixIconStyle="color:#CDCDCD"
  234. clearable
  235. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  236. </u-form-item>
  237. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
  238. <view class="form-label flex_l">经销商销售人员</view>
  239. <u-input
  240. placeholder="输入经销商销售人员"
  241. v-model="addForm.dealerSalesName"
  242. border="none"
  243. suffixIconStyle="color:#CDCDCD"
  244. clearable
  245. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  246. </u-form-item>
  247. <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx">
  248. <view class="form-label flex_l">维护部门及人员</view>
  249. <u-input
  250. placeholder="输入维护部门及人员"
  251. v-model="addForm.accendant"
  252. border="none"
  253. suffixIconStyle="color:#CDCDCD"
  254. clearable
  255. customStyle="padding: 0 30rpx 0 12rpx"></u-input>
  256. </u-form-item>
  257. <u-form-item prop="isAdoptDashoo" borderBottom customStyle="padding:40rpx 0 30rpx">
  258. <view class="form-label flex_l">
  259. <view class="label-tag"></view>
  260. 是否采纳大数技术参数
  261. </view>
  262. <u-radio-group v-model="addForm.isAdoptDashoo" placement="row" @change="chooseRadio">
  263. <u-radio customStyle="margin-right:40rpx" label="是" name="10"></u-radio>
  264. <u-radio customStyle="margin-right:40rpx" label="否" name="20"></u-radio>
  265. </u-radio-group>
  266. </u-form-item>
  267. <u-form-item
  268. prop="file"
  269. borderBottom
  270. customStyle="padding:40rpx 0 30rpx"
  271. v-if="addForm.isAdoptDashoo == '10'">
  272. <view class="form-label flex_l">
  273. <view class="label-tag"></view>
  274. 文件
  275. </view>
  276. <uni-file-picker file-mediatype="all" mode="grid" @select="chooseFile($event)" ref="upload" limit="1">
  277. <view class="upload-btn">
  278. <u-icon name="plus-circle-fill" color="blue" size="28"></u-icon>
  279. </view>
  280. </uni-file-picker>
  281. </u-form-item>
  282. </view>
  283. <u-form-item
  284. prop="projConversionReason"
  285. customStyle="padding:40rpx 0 30rpx"
  286. v-if="addForm.isAdoptDashoo != '30'">
  287. <view class="form-label flex_l">升级原因</view>
  288. <u-textarea
  289. fontSize="26rpx"
  290. v-model="addForm.projConversionReason"
  291. placeholder="请输入升级原因"
  292. height="180"
  293. :count="true"
  294. maxlength="300"></u-textarea>
  295. </u-form-item>
  296. <u-form-item prop="remark" customStyle="padding:40rpx 0 30rpx" v-else>
  297. <view class="form-label flex_l">
  298. <view class="label-tag"></view>
  299. 转化原因
  300. </view>
  301. <u-textarea
  302. fontSize="26rpx"
  303. v-model="addForm.remark"
  304. placeholder="请输入转化原因"
  305. height="180"
  306. :count="true"
  307. maxlength="300"></u-textarea>
  308. </u-form-item>
  309. </u-form>
  310. <view class="save" @click="handleUpgrade">提交</view>
  311. </view>
  312. <!-- 技术支持时间 -->
  313. <u-datetime-picker
  314. v-if="showSupportDate"
  315. :show="showSupportDate"
  316. mode="date"
  317. v-model="addForm.technicalSupportTime"
  318. @cancel="showSupportDate = false"
  319. @confirm="pickSupportDate"></u-datetime-picker>
  320. <!-- 项目预算期限 -->
  321. <u-datetime-picker
  322. v-if="showBudgetDate"
  323. :show="showBudgetDate"
  324. mode="date"
  325. v-model="addForm.nboBudgetTime"
  326. @cancel="showBudgetDate = false"
  327. @confirm="pickBudgetDate"></u-datetime-picker>
  328. <!-- 采购时间 -->
  329. <u-datetime-picker
  330. v-if="showPurchasingDate"
  331. :show="showPurchasingDate"
  332. mode="date"
  333. v-model="addForm.purchasingTime"
  334. @cancel="showPurchasingDate = false"
  335. @confirm="pickPurchasingDate"></u-datetime-picker>
  336. <!-- 采购方式 -->
  337. <u-picker
  338. :show="showChasingWay"
  339. :columns="[purchasingWayOptions]"
  340. keyName="value"
  341. @cancel="showChasingWay = false"
  342. @confirm="pickModel"></u-picker>
  343. <!-- 选择经销商 -->
  344. <select-dealer ref="dealer" @close="closeDealer()"></select-dealer>
  345. <!-- 客户联系人 -->
  346. <customer-contact ref="contact" @close="closeContact()"></customer-contact>
  347. <u-notify ref="uNotify"></u-notify>
  348. <u-toast ref="uToast"></u-toast>
  349. <u-modal
  350. :show="showModal"
  351. content="确认进行项目升级?"
  352. :showCancelButton="true"
  353. @cancel="this.showModal = false"
  354. @confirm="this.handleUpgradeApi()"></u-modal>
  355. </view>
  356. </template>
  357. <script>
  358. import projectApi from '../../api/project'
  359. import to from 'await-to-js'
  360. import SelectDealer from 'components/SelectDealer'
  361. import CustomerContact from '../../components/CustomerContact'
  362. export default {
  363. name: 'omsIndex',
  364. components: { SelectDealer, CustomerContact },
  365. data() {
  366. return {
  367. height: '',
  368. paddingTop: '',
  369. showSupportDate: false, //技术支持时间
  370. showBudgetDate: false, //项目预算时间
  371. showPurchasingDate: false, //采购时间
  372. showChasingWay: false,
  373. purchasingWayOptions: [],
  374. addForm: {
  375. nboType: '', //项目及别
  376. nboBudget: 0, //项目预算
  377. distributorName: '', //经销商
  378. distributorId: '', //经销商ID
  379. parentReceiver: '', //项目对接人
  380. technicalSupportName: '', //技术支持人员
  381. technicalSupportContent: null, //技术支持内容
  382. technicalSupportTime: '', //技术支持时间
  383. nboBudgetTime: this.parseTime(new Date(), '{y}-{m}-{d}'), //项目预算时间
  384. capitalSource: '', //资金来源
  385. productSatisfaction: '', //产品方案满足情况
  386. purchasingWay: '', //采购方式id
  387. purchasingWayVal: '', //采购方式
  388. purchasingTime: this.parseTime(new Date(), '{y}-{m}-{d}'), //采购时间
  389. makerId: '', //决策人
  390. makerName: '', //决策人
  391. makerDept: '', //决策部门
  392. historicalTransactionInfo: '', //输入经销商与客户历史成交信息
  393. dealerSalesName: '', //经销商销售人员
  394. accendant: '', //维护部门及人员
  395. isAdoptDashoo: '', //是否采纳大数技术参数
  396. remark: '', //转化原因
  397. projConversionReason: '', //升级原因
  398. id: 0, //项目id
  399. file: '',
  400. tempFilePaths: '',
  401. },
  402. showModal: false,
  403. projectDetails: {},
  404. rules: {
  405. nboType: {
  406. type: 'string',
  407. required: true,
  408. message: '请选择项目级别',
  409. trigger: ['blur'],
  410. },
  411. technicalSupportContent: {
  412. type: 'string',
  413. required: true,
  414. message: '请输入技术支持内容',
  415. trigger: ['blur'],
  416. },
  417. nboBudget: {
  418. type: 'number',
  419. required: true,
  420. message: '请输入项目预算',
  421. trigger: ['blur'],
  422. },
  423. purchasingWayVal: {
  424. type: 'string',
  425. required: true,
  426. message: '请输入采购方式',
  427. trigger: ['blur'],
  428. },
  429. technicalSupportTime: {
  430. type: 'string',
  431. required: true,
  432. message: '请输入采购时间',
  433. trigger: ['blur'],
  434. },
  435. isAdoptDashoo: {
  436. type: 'string',
  437. required: true,
  438. message: '请选择是否采纳大数技术参数',
  439. trigger: ['blur'],
  440. },
  441. file: {
  442. type: 'object',
  443. required: true,
  444. message: '请上传文件',
  445. trigger: ['change'],
  446. },
  447. remark: {
  448. type: 'string',
  449. required: true,
  450. message: '请输入转化',
  451. trigger: ['blur'],
  452. },
  453. },
  454. }
  455. },
  456. created() {
  457. const navData = uni.getMenuButtonBoundingClientRect()
  458. this.height = navData.height + 'px'
  459. this.paddingTop = navData.top + 'px'
  460. },
  461. onLoad(option) {
  462. console.log(option.id) //打印出上个页面传递的参数。
  463. this.addForm.id = parseInt(option.id)
  464. },
  465. mounted() {
  466. this.getDetails()
  467. this.getOptions()
  468. },
  469. methods: {
  470. getOptions() {
  471. Promise.all([this.getDicts('proj_purchasing_way')])
  472. .then(([purchasing]) => {
  473. this.purchasingWayOptions = purchasing.data.values || []
  474. })
  475. .catch((err) => console.log(err))
  476. },
  477. async getDetails() {
  478. const [err, res] = await to(projectApi.getDetail({ id: this.addForm.id }))
  479. if (err) return
  480. if (res.code == 200) {
  481. this.projectDetails = res.data
  482. this.addForm = Object.assign(this.addForm, this.projectDetails)
  483. this.addForm.nboType = ''
  484. this.addForm.technicalSupportName = ''
  485. this.addForm.technicalSupportContent = ''
  486. this.addForm.technicalSupportTime = this.parseTime(new Date(), '{y}-{m}-{d}')
  487. this.addForm.nboBudgetTime = this.parseTime(new Date(), '{y}-{m}-{d}')
  488. this.addForm.projConversionReason = ''
  489. this.addForm.remark = ''
  490. }
  491. },
  492. // 选择采购方式
  493. pickModel(e) {
  494. this.addForm.purchasingWay = e.value[0].key
  495. this.addForm.purchasingWayVal = e.value[0].value
  496. this.showChasingWay = false
  497. },
  498. // 经销商
  499. closeDealer(dealer) {
  500. if (dealer) {
  501. console.log(dealer)
  502. this.addForm.distributorId = dealer.id
  503. this.addForm.distributorName = dealer.name
  504. }
  505. },
  506. selectContact() {
  507. if (!this.addForm.custId) {
  508. this.$refs.uNotify.show({
  509. top: this.height + this.paddingTop + 10,
  510. type: 'warning',
  511. message: '请先选择客户',
  512. duration: 1000 * 3,
  513. })
  514. return
  515. }
  516. this.$refs.contact.open(this.addForm.custId)
  517. },
  518. // 关闭选择客户联系人
  519. closeContact(user) {
  520. if (user) {
  521. console.log(user)
  522. this.addForm.makerId = user.id
  523. this.addForm.makerName = user.cuctName
  524. this.addForm.makerDept = user.dept
  525. // this.addForm.makerPost = user.postion
  526. // this.addForm.makerTelephone = user.telephone
  527. }
  528. },
  529. // 技术支持时间
  530. async pickSupportDate(e) {
  531. this.showSupportDate = false
  532. const timeFormat = uni.$u.timeFormat
  533. let timeValue = await timeFormat(e.value, 'yyyy-mm-dd hh:MM')
  534. this.addForm.technicalSupportTime = timeValue
  535. console.log(timeValue)
  536. },
  537. // 项目预算时间
  538. async pickBudgetDate(e) {
  539. this.showBudgetDate = false
  540. const timeFormat = uni.$u.timeFormat
  541. let timeValue = await timeFormat(e.value, 'yyyy-mm-dd hh:MM')
  542. this.addForm.nboBudgetTime = timeValue
  543. console.log(timeValue)
  544. },
  545. // 采购时间
  546. async pickPurchasingDate(e) {
  547. this.showPurchasingDate = false
  548. const timeFormat = uni.$u.timeFormat
  549. let timeValue = await timeFormat(e.value, 'yyyy-mm-dd hh:MM')
  550. this.addForm.purchasingTime = timeValue
  551. console.log(timeValue)
  552. },
  553. // 选择是否采用大数参数
  554. chooseRadio(e) {
  555. console.log(e)
  556. if (e == '20') {
  557. this.addForm.file = ''
  558. }
  559. },
  560. // // 选择上传触发函数
  561. chooseFile(e) {
  562. this.addForm.file = e.tempFiles[0].file
  563. this.addForm.tempFilePaths = e.tempFilePaths[0]
  564. },
  565. // 上传函数
  566. async upgradeA(data) {
  567. const basePath = process.uniEnv.VUE_APP_MicroSrvProxy_API + process.uniEnv.VUE_APP_ParentPath
  568. uni.uploadFile({
  569. url: basePath,
  570. filePath: data.tempFilePaths,
  571. name: 'file',
  572. formData: data,
  573. header: {
  574. Tenant: process.uniEnv.VUE_APP_TENANT,
  575. Authorization: 'Bearer ' + uni.getStorageSync('opms_token') || '',
  576. 'X-RPCX-SerializeType': '1',
  577. 'X-RPCX-ServicePath': 'BusinessHandler',
  578. 'X-RPCX-ServiceMethod': 'BusinessUpgradeA',
  579. SrvEnv: 'dev',
  580. },
  581. success: (res) => {
  582. console.log('success', res)
  583. this.$refs.uToast.show({
  584. type: 'success',
  585. message: '提交成功',
  586. complete: () => {
  587. this.goBack()
  588. },
  589. })
  590. },
  591. fail: (err) => {
  592. this.$refs.uToast.show({
  593. type: 'success',
  594. message: '提交失败',
  595. })
  596. console.log('error', err)
  597. },
  598. complete: () => {
  599. this.showModal = false
  600. },
  601. })
  602. },
  603. handleUpgrade() {
  604. this.$refs.addForm
  605. .validate()
  606. .then(async () => {
  607. this.showModal = true
  608. })
  609. .catch((err) => {
  610. console.log(err)
  611. this.$refs.uNotify.show({
  612. top: this.height + this.paddingTop + 10,
  613. type: 'warning',
  614. message: err[0].message,
  615. duration: 1000 * 3,
  616. })
  617. })
  618. },
  619. async handleUpgradeApi() {
  620. let params = this.addForm
  621. params.nboBudget = Number(params.nboBudget)
  622. if (this.addForm.nboType === '10' && this.addForm.isAdoptDashoo == '10') {
  623. this.upgradeA(params)
  624. } else {
  625. const [err, res] = await to(projectApi.upgrade(params))
  626. this.showModal = false
  627. if (err) return
  628. if (res && res.code == 200) {
  629. this.$refs.uToast.show({
  630. type: 'success',
  631. message: '提交成功',
  632. complete: () => {
  633. this.goBack()
  634. },
  635. })
  636. }
  637. }
  638. },
  639. closeUser(user) {
  640. if (user) {
  641. console.log(user)
  642. this.addForm.userId = user.id
  643. this.addForm.userName = user.label
  644. }
  645. },
  646. goBack() {
  647. uni.navigateBack({
  648. //关闭当前页面,返回上一页面或多级页面。
  649. delta: 1,
  650. })
  651. },
  652. },
  653. }
  654. </script>
  655. <style>
  656. page {
  657. background: #f2f3f5;
  658. }
  659. </style>
  660. <style lang="scss" scoped>
  661. .home {
  662. padding-top: 188rpx;
  663. .nav {
  664. position: absolute;
  665. left: 0;
  666. top: 0;
  667. width: 100%;
  668. height: 284rpx;
  669. background: #3e7ef8;
  670. .title {
  671. position: relative;
  672. text-align: center;
  673. font-size: 32rpx;
  674. font-weight: bold;
  675. color: #ffffff;
  676. .back {
  677. position: absolute;
  678. top: 0;
  679. bottom: 0;
  680. margin: auto;
  681. left: 70rpx;
  682. display: flex;
  683. }
  684. }
  685. }
  686. .main {
  687. position: absolute;
  688. width: 100%;
  689. height: calc(100vh - 188rpx);
  690. background: #ffffff;
  691. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  692. border-radius: 31rpx 31rpx 0 0;
  693. padding: 0 32rpx;
  694. overflow: auto;
  695. padding-bottom: 64rpx;
  696. .form-label {
  697. font-size: 32rpx;
  698. font-weight: bold;
  699. color: #323232;
  700. padding-bottom: 18rpx;
  701. .label-tag {
  702. width: 15rpx;
  703. height: 15rpx;
  704. background: #ff4d4f;
  705. border-radius: 50%;
  706. margin-right: 10rpx;
  707. }
  708. }
  709. .save {
  710. width: 569rpx;
  711. height: 92rpx;
  712. background: #3e7ef8;
  713. border-radius: 31rpx;
  714. margin: 116rpx auto 0;
  715. font-size: 32rpx;
  716. color: #ffffff;
  717. text-align: center;
  718. line-height: 92rpx;
  719. }
  720. }
  721. }
  722. </style>