BusinessGradation.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. <template>
  2. <div style="display: inline-block; margin: 0 10px">
  3. <!--未在审批中 且级别为 B、C、储备 可升级-->
  4. <el-button
  5. v-permissions="['proj:business:upgrade']"
  6. :disabled="!['20', '30', '50'].includes(businessInfo.nboType) || businessInfo.approStatus === '20'"
  7. type="primary"
  8. @click="handleClick('up')">
  9. 升级
  10. </el-button>
  11. <!--未在审批中 且级别为 A、B 可降级-->
  12. <el-button
  13. v-permissions="['proj:business:downgrade']"
  14. :disabled="!['10', '20'].includes(businessInfo.nboType) || businessInfo.approStatus === '20'"
  15. type="danger"
  16. @click="handleClick('down')">
  17. 降级
  18. </el-button>
  19. <el-dialog append-to-body :title="title" :visible.sync="dialogFormVisible" width="60%" @close="close">
  20. <el-form
  21. v-if="type === 'up'"
  22. ref="form"
  23. label-position="top"
  24. :model="form"
  25. :rules="rules"
  26. style="margin-top: -20px">
  27. <el-form-item label="项目类别" prop="nboType">
  28. <el-select v-model="form.nboType" placeholder="请选择项目类别" style="width: 100%">
  29. <el-option
  30. :disabled="
  31. (type === 'up' && businessInfo.nboType === '10') ||
  32. (type === 'down' && ['10', '20'].includes(businessInfo.nboType))
  33. "
  34. label="A"
  35. value="10" />
  36. <el-option :disabled="businessInfo.nboType === '20'" label="B" value="20" />
  37. <el-option
  38. :disabled="type === 'up' && ['10', '20', '30'].includes(businessInfo.nboType)"
  39. label="C"
  40. value="30" />
  41. <!-- <el-option v-if="type === 'down'" label="储备" value="50" />-->
  42. </el-select>
  43. </el-form-item>
  44. <!-- C-B 必填项:项目类别、项目预算、渠道销售人员、渠道销售电话、微信、预计出货金额(不填)、添加产品、上传报价单 -->
  45. <el-row v-if="form.nboType !== '30'" :gutter="20">
  46. <el-col :span="8">
  47. <el-form-item label="项目预算" prop="nboBudget">
  48. <amount-input v-model.trim="form.nboBudget" placeholder="请输入金额" />
  49. </el-form-item>
  50. </el-col>
  51. <div v-if="businessInfo.salesModel !== '10'">
  52. <el-col :span="8">
  53. <el-form-item label="渠道销售人员" prop="dealerSalesName">
  54. <el-input
  55. v-model="form.dealerSalesName"
  56. readonly
  57. suffix-icon="el-icon-search"
  58. @focus="handleSelectDistributorContact" />
  59. </el-form-item>
  60. </el-col>
  61. <el-col :span="8">
  62. <el-form-item label="渠道销售电话/微信" prop="dealerSalesContact">
  63. <el-input v-model="form.dealerSalesContact" />
  64. </el-form-item>
  65. </el-col>
  66. </div>
  67. <el-col :span="8">
  68. <el-form-item
  69. label="报价单"
  70. prop="quotationFile"
  71. :required="form.nboType === '10' || form.nboType === '20'">
  72. <el-upload
  73. :action="uploadFileUrl"
  74. :file-list="quotationFileList"
  75. :limit="1"
  76. :on-success="setQuotationFile">
  77. <el-button size="mini" type="primary">点击上传</el-button>
  78. </el-upload>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="24">
  82. <div style="float: right; margin-bottom: 10px">
  83. <span style="margin-right: 10px; color: red">预计出货金额:{{ formatPrice(form.estTransPrice) }}</span>
  84. <el-button size="mini" type="primary" @click="handleSelectProduct">添加产品</el-button>
  85. </div>
  86. <product-table
  87. ref="productTable"
  88. :product-data="productData"
  89. @changeProductData="changeProductData"
  90. @delProductData="delProductData" />
  91. </el-col>
  92. </el-row>
  93. <!-- B-A 必填项:采购方式、资金来源、计划采购时间、客户决策人、客户决策部分、客户联系人姓名、客户联系人电话/微信、是否采纳我司技术参数(是/否)、竞争公司、客户倾向厂家 -->
  94. <el-row v-if="form.nboType === '10'" :gutter="20">
  95. <el-col :span="8">
  96. <el-form-item label="采购方式" prop="purchasingWay" :required="type === 'up' && form.nboType === '10'">
  97. <el-select v-model="form.purchasingWay" placeholder="请选择" style="width: 100%">
  98. <el-option v-for="item in purchasingWayOptions" :key="item.key" :label="item.value" :value="item.key" />
  99. </el-select>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="8">
  103. <el-form-item label="资金来源" prop="capitalSource">
  104. <el-input v-model="form.capitalSource" />
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="8">
  108. <el-form-item
  109. label="计划采购时间"
  110. prop="planPurchaseTime"
  111. :required="type === 'up' && form.nboType === '10'">
  112. <el-date-picker
  113. v-model="form.planPurchaseTime"
  114. placeholder="选择日期"
  115. style="width: 100%"
  116. type="datetime"
  117. value-format="yyyy-MM-dd HH:mm:ss" />
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="8">
  121. <el-form-item label="客户决策人" prop="makerName">
  122. <el-input v-model="form.makerName" />
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="8">
  126. <el-form-item label="客户决策部门" prop="makerDept">
  127. <el-input v-model="form.makerDept" />
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="8">
  131. <el-form-item label="客户联系人" prop="contactName">
  132. <el-input
  133. v-model="form.contactName"
  134. readonly
  135. suffix-icon="el-icon-search"
  136. @focus="handleSelectCustomerContact" />
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="8">
  140. <el-form-item label="客户联系人电话/微信" prop="contactTelephone">
  141. <el-input v-model="form.contactTelephone" />
  142. </el-form-item>
  143. </el-col>
  144. <el-col :span="8">
  145. <el-form-item label="竞争公司" prop="competitor">
  146. <el-input v-model="form.competitor" />
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="8">
  150. <el-form-item label="客户倾向厂家" prop="customerIntentionFactory">
  151. <el-input v-model="form.customerIntentionFactory" />
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="8">
  155. <el-form-item
  156. label="是否采纳大数技术参数"
  157. prop="isAdoptDashoo"
  158. :required="type === 'up' && form.nboType === '10'">
  159. <el-radio-group v-model="form.isAdoptDashoo" style="width: 100%">
  160. <el-radio label="10">是</el-radio>
  161. <el-radio label="20">否</el-radio>
  162. </el-radio-group>
  163. </el-form-item>
  164. </el-col>
  165. <el-col v-if="form.isAdoptDashoo === '10'" :span="8">
  166. <el-form-item label="参数文件" prop="dashooParamFile" :required="form.isAdoptDashoo === '10'">
  167. <el-upload
  168. :action="uploadFileUrl"
  169. :file-list="dashooParamFileList"
  170. :limit="1"
  171. :on-success="setDashooParamFile">
  172. <el-button size="mini" type="primary">点击上传</el-button>
  173. </el-upload>
  174. </el-form-item>
  175. </el-col>
  176. </el-row>
  177. <el-row v-if="form.nboType === '30'">
  178. <el-form-item label="转化原因" prop="projConversionReason">
  179. <el-input
  180. v-model="form.projConversionReason"
  181. maxlength="300"
  182. placeholder="请输入转化原因"
  183. rows="3"
  184. show-word-limit
  185. type="textarea" />
  186. </el-form-item>
  187. </el-row>
  188. <el-row v-else>
  189. <el-col :span="24">
  190. <el-form-item label="升级原因" prop="remark">
  191. <el-input
  192. v-model="form.remark"
  193. maxlength="300"
  194. placeholder="请输入备注原因"
  195. rows="3"
  196. show-word-limit
  197. type="textarea" />
  198. </el-form-item>
  199. </el-col>
  200. </el-row>
  201. </el-form>
  202. <el-form
  203. v-if="type === 'down'"
  204. ref="form"
  205. label-position="top"
  206. :model="form"
  207. :rules="rules"
  208. style="margin-top: -20px">
  209. <el-form-item label="项目类别" prop="nboType">
  210. <el-select v-model="form.nboType" placeholder="请选择项目类别" style="width: 100%">
  211. <el-option
  212. :disabled="
  213. (type === 'up' && businessInfo.nboType === '10') ||
  214. (type === 'down' && ['10', '20'].includes(businessInfo.nboType))
  215. "
  216. label="A"
  217. value="10" />
  218. <el-option :disabled="businessInfo.nboType === '20'" label="B" value="20" />
  219. <el-option
  220. :disabled="type === 'up' && ['10', '20', '30'].includes(businessInfo.nboType)"
  221. label="C"
  222. value="30" />
  223. <!-- <el-option v-if="type === 'down'" label="储备" value="50" />-->
  224. </el-select>
  225. </el-form-item>
  226. <el-form-item label="降级原因" prop="remark" required>
  227. <el-input
  228. v-model="form.remark"
  229. maxlength="300"
  230. placeholder="请输入备注原因"
  231. rows="3"
  232. show-word-limit
  233. type="textarea" />
  234. </el-form-item>
  235. </el-form>
  236. <template #footer>
  237. <el-button @click="close">取 消</el-button>
  238. <el-button :loading="loading" type="primary" @click="save">确 定</el-button>
  239. </template>
  240. </el-dialog>
  241. <!-- 选择客户联系人弹窗 -->
  242. <select-customer-contact
  243. ref="selectCustomerContact"
  244. :default-customer="customerInfo"
  245. :query-params="queryCustomerContact"
  246. @save="selectCustomerContact" />
  247. <!-- 选择渠道销售人员弹窗 -->
  248. <select-distributor-contact
  249. ref="selectDistributorContact"
  250. :default-dist="distInfo"
  251. :query-params="queryDistContact"
  252. @save="selectDistributorContact" />
  253. <!-- 选择产品弹窗 -->
  254. <select-product ref="selectProduct" multiple @save="selectProduct" />
  255. </div>
  256. </template>
  257. <script>
  258. import to from 'await-to-js'
  259. import businessApi from '@/api/proj/business'
  260. import AmountInput from '@/components/currency/index.vue'
  261. import SelectCustomerContact from '@/components/select/SelectCustomerContact'
  262. import SelectDistributorContact from '@/components/select/SelectDistributorContact'
  263. import ProductTable from '@/views/proj/business/components/ProductTable.vue'
  264. import SelectProduct from '@/components/select/SelectProduct'
  265. export default {
  266. name: 'BusinessGradation',
  267. components: {
  268. SelectProduct,
  269. ProductTable,
  270. AmountInput,
  271. SelectCustomerContact,
  272. SelectDistributorContact,
  273. },
  274. props: {
  275. // 项目Id
  276. busId: {
  277. type: Number,
  278. required: true,
  279. },
  280. // 项目类别
  281. businessInfo: {
  282. type: Object,
  283. required: true,
  284. },
  285. },
  286. data() {
  287. const validateDowngrade = (rule, value, callback) => {
  288. if (!value && this.type === 'down') callback(new Error('不能为空'))
  289. else callback()
  290. }
  291. const validateNboBudget = (rule, value, callback) => {
  292. if (parseInt(value) <= 0) callback(new Error())
  293. else callback()
  294. }
  295. const validateAdoptDashoo = (rule, value, callback) => {
  296. if (this.form.isAdoptDashoo === '10' && !value) callback(new Error())
  297. else callback()
  298. }
  299. return {
  300. title: '项目',
  301. type: '',
  302. loading: false,
  303. form: {
  304. id: undefined,
  305. nboType: undefined,
  306. // C => B
  307. nboBudget: undefined,
  308. dealerSalesId: undefined,
  309. dealerSalesName: undefined,
  310. dealerSalesContact: undefined,
  311. estTransPrice: undefined,
  312. quotationFile: undefined,
  313. products: [],
  314. // B => A
  315. purchasingWay: undefined,
  316. capitalSource: undefined,
  317. planPurchaseTime: undefined,
  318. contactId: undefined,
  319. contactName: undefined,
  320. contactTelephone: undefined,
  321. contactWechat: undefined,
  322. makerId: undefined,
  323. makerName: undefined,
  324. makerDept: undefined,
  325. makerPost: undefined,
  326. makerTelephone: undefined,
  327. customerIntentionFactory: undefined,
  328. competitor: undefined,
  329. isAdoptDashoo: undefined,
  330. dashooParamFile: undefined,
  331. projConversionReason: undefined,
  332. remark: undefined,
  333. },
  334. rules: {
  335. nboType: [{ required: true, trigger: ['blur', 'change'], message: '请选择项目类别' }],
  336. // C => B
  337. nboBudget: [
  338. { required: true, trigger: ['blur', 'change'], message: '请输入项目预算' },
  339. { validator: validateNboBudget, trigger: ['blur', 'change'], message: '项目预算应大于0' },
  340. ],
  341. dealerSalesId: [{ required: true, trigger: ['blur', 'change'], message: '请选择渠道销售' }],
  342. dealerSalesName: [{ required: true, trigger: ['blur', 'change'], message: '请选择项渠道销售人员' }],
  343. dealerSalesContact: [{ required: true, trigger: ['blur', 'change'], message: '请输入渠道销售电话/微信' }],
  344. estTransPrice: [{ required: true, trigger: ['blur', 'change'], message: '请选择预计出货金额' }],
  345. quotationFile: [{ required: true, trigger: ['blur', 'change'], message: '请选择报价单' }],
  346. products: [{ required: true, trigger: ['blur', 'change'], message: '请选择产品' }],
  347. // B => A
  348. purchasingWay: [{ required: true, trigger: ['blur', 'change'], message: '请选择采购方式' }],
  349. capitalSource: [{ required: true, trigger: ['blur', 'change'], message: '请输入资金来源' }],
  350. planPurchaseTime: [{ required: true, trigger: ['blur', 'change'], message: '请选择计划采购时间' }],
  351. contactId: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户联系人' }],
  352. contactName: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户联系人姓名' }],
  353. contactTelephone: [{ required: true, trigger: ['blur', 'change'], message: '请输入客户联系人电话/微信' }],
  354. makerId: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策人' }],
  355. makerName: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策人姓名' }],
  356. makerDept: [{ required: true, trigger: ['blur', 'change'], message: '请选择客户决策部门' }],
  357. customerIntentionFactory: [{ required: true, trigger: ['blur', 'change'], message: '请输入客户倾向厂家' }],
  358. competitor: [{ required: true, trigger: ['blur', 'change'], message: '请输入竞争公司' }],
  359. isAdoptDashoo: [{ required: true, trigger: ['blur', 'change'], message: '请选择是或否' }],
  360. dashooParamFile: [{ validator: validateAdoptDashoo, trigger: ['blur', 'change'], message: '请选择上传文件' }],
  361. projConversionReason: [{ required: true, trigger: ['blur', 'change'], message: '请输入转化原因' }],
  362. remark: [{ validator: validateDowngrade, trigger: ['blur', 'change'], message: '请输入原因' }],
  363. },
  364. dialogFormVisible: false,
  365. purchasingWayOptions: [],
  366. // 大数参数文件
  367. dashooParamFileList: [],
  368. quotationFileList: [],
  369. uploadFileUrl: process.env.VUE_APP_UPLOAD_FILE_WEED,
  370. fileSettings: {
  371. // 文件配置信息
  372. fileSize: 52428800,
  373. fileTypes: '.doc,.docx,.zip,.xls,.xlsx,.rar,.jpg,.jpeg,.gif,.png,.jfif,.txt',
  374. pictureSize: 52428800,
  375. pictureTypes: '.jpg,.jpeg,.gif,.png,.jfif,.txt',
  376. types: '.doc,.docx,.zip,.xls,.xlsx,.rar,.jpg,.jpeg,.gif,.png,.jfif,.mp4,.txt',
  377. videoSize: 104857600,
  378. videoType: '.mp4',
  379. },
  380. queryCustomerContact: {},
  381. customerInfo: {},
  382. queryDistContact: {},
  383. distInfo: {},
  384. productData: [],
  385. }
  386. },
  387. mounted() {
  388. this.getDicts('proj_purchasing_way').then((response) => {
  389. this.purchasingWayOptions = response.data.values || []
  390. })
  391. },
  392. methods: {
  393. selectProduct(data) {
  394. let projData = data.map((item) => ({
  395. prodId: item.id,
  396. prodCode: item.prodCode,
  397. prodName: item.prodName,
  398. prodClass: item.prodClass,
  399. guidPrice: item.guidPrice,
  400. prodPrice: item.marketPrice,
  401. prodNum: 1,
  402. }))
  403. this.productData.push(...projData)
  404. this.productData = this.removeDuplicateObj(this.productData)
  405. this.getEstTransPrice()
  406. },
  407. // 数组对象去重
  408. removeDuplicateObj(arr) {
  409. let newArrId = []
  410. let newArrObj = []
  411. arr.forEach((item) => {
  412. if (!newArrId.includes(item.prodId)) {
  413. newArrId.push(item.prodId)
  414. newArrObj.push(item)
  415. }
  416. })
  417. return newArrObj
  418. },
  419. handleSelectProduct() {
  420. this.$refs.selectProduct.open()
  421. },
  422. // 修改产品列表数据
  423. changeProductData(data) {
  424. this.productData = this.productData.map((item) => {
  425. return item.prodId === data.prodId ? data : item
  426. })
  427. this.getEstTransPrice()
  428. },
  429. delProductData(data) {
  430. this.productData = this.productData.filter((item) => item.prodId !== data.prodId)
  431. this.getEstTransPrice()
  432. },
  433. getEstTransPrice() {
  434. this.form.estTransPrice = 0
  435. for (let item of this.productData) {
  436. console.log(item, '--------------------')
  437. this.form.estTransPrice += parseFloat(item.prodNum) * parseFloat(item.prodPrice)
  438. }
  439. },
  440. async getProductData(busId) {
  441. const { data } = await businessApi.getProductByBusinessId({ id: busId })
  442. if (data) {
  443. this.productData = data
  444. }
  445. },
  446. // 上传文件
  447. setDashooParamFile(res) {
  448. // 如果上传成功
  449. if (res.Code === 200) {
  450. this.form.dashooParamFile = res.Data
  451. } else {
  452. this.$message.error('上传文件失败')
  453. }
  454. },
  455. setQuotationFile(res) {
  456. // 如果上传成功
  457. if (res.Code === 200) {
  458. this.form.quotationFile = res.Data
  459. } else {
  460. this.$message.error('上传文件失败')
  461. }
  462. },
  463. handleSelectCustomerContact() {
  464. if (!this.queryCustomerContact.custId) {
  465. this.$message.warning('请先选择客户')
  466. return
  467. }
  468. this.$refs.selectCustomerContact.open()
  469. },
  470. selectCustomerContact(val) {
  471. if (val && val.length > 0) {
  472. this.form.contactId = val[0].id
  473. this.form.contactName = val.map((item) => item.cuctName).join()
  474. this.form.contactPostion = val.map((item) => item.postion).join()
  475. this.form.contactTelephone = val.map((item) => {
  476. if (item.telephone !== '' && item.wechat !== '') {
  477. return item.telephone + '/' + item.wechat
  478. }
  479. if (item.telephone !== '') {
  480. return item.telephone
  481. }
  482. if (item.wechat !== '') {
  483. return item.wechat
  484. }
  485. }).join()
  486. }
  487. },
  488. handleSelectDistributorContact() {
  489. this.$refs.selectDistributorContact.open()
  490. },
  491. selectDistributorContact(val) {
  492. if (val && val.length > 0) {
  493. this.form.dealerSalesId = val[0].id
  494. this.form.dealerSalesName = val.map((item) => item.name).join()
  495. this.form.dealerSalesContact = val
  496. .map((item) => {
  497. if (item.phone !== '' && item.wechat !== '') {
  498. return item.phone + '/' + item.wechat
  499. }
  500. if (item.phone !== '') {
  501. return item.phone
  502. }
  503. if (item.wechat !== '') {
  504. return item.wechat
  505. }
  506. })
  507. .join()
  508. }
  509. },
  510. // 业务调级(升级、降级)
  511. handleClick(type) {
  512. this.form.id = this.busId
  513. this.form = Object.assign(this.form, this.businessInfo)
  514. if (type === 'up') {
  515. this.title = '升级'
  516. if (this.form.nboType === '50') {
  517. this.form.nboType = '30'
  518. }
  519. if (this.form.nboType === '30') {
  520. this.form.nboType = '20'
  521. }
  522. if (this.form.nboType === '20') {
  523. this.form.nboType = '10'
  524. }
  525. }
  526. if (type === 'down') {
  527. this.title = '降级'
  528. if (this.form.nboType === '30') {
  529. this.form.nboType = '50'
  530. }
  531. if (this.form.nboType === '20') {
  532. this.form.nboType = '30'
  533. }
  534. if (this.form.nboType === '10') {
  535. this.form.nboType = '20'
  536. }
  537. }
  538. this.type = type
  539. this.form.isAdoptDashoo = '20'
  540. this.customerInfo = { custId: this.form.custId, custName: this.form.custName }
  541. this.queryCustomerContact = { custId: this.form.custId }
  542. this.distInfo = { distId: this.form.distributorId, distName: this.form.distributorName }
  543. this.queryDistContact = { distId: this.form.distributorId }
  544. this.productData = this.form.products || []
  545. if (this.form.quotationFileList) {
  546. this.quotationFileList = this.form.quotationFileList.map((item) => {
  547. this.form.quotationFile = item.fileUrl
  548. return { name: item.fileName, url: item.fileUrl }
  549. })
  550. }
  551. this.dialogFormVisible = true
  552. this.$nextTick(() => this.$refs['form'].clearValidate())
  553. },
  554. open(row) {
  555. this.form.id = row.id
  556. this.form = Object.assign(this.form, row)
  557. this.dialogFormVisible = true
  558. this.loading = false
  559. this.$refs['form'].clearValidate()
  560. },
  561. close() {
  562. this.$refs['form'].resetFields()
  563. this.$refs['form'].clearValidate()
  564. this.form = this.$options.data().form
  565. this.productData = []
  566. this.quotationFileList = []
  567. this.dashooParamFileList = []
  568. this.dialogFormVisible = false
  569. this.loading = false
  570. },
  571. save() {
  572. this.form.products = this.productData
  573. this.$refs['form'].validate(async (valid) => {
  574. if (valid) {
  575. this.$baseConfirm('你确定要对当前项目' + this.title + '吗', null, async () => {
  576. this.loading = true
  577. let err, res
  578. if (this.type === 'up') {
  579. ;[err, res] = await to(businessApi.businessUpgrade(this.form))
  580. }
  581. if (this.type === 'down') {
  582. ;[err, res] = await to(businessApi.businessDowngrade(this.form))
  583. }
  584. if (err) {
  585. this.$baseMessage(res.msg, 'error')
  586. } else {
  587. this.$baseMessage(res.msg, 'success')
  588. }
  589. this.loading = false
  590. this.$emit('fetch-data')
  591. this.close()
  592. })
  593. }
  594. })
  595. },
  596. },
  597. }
  598. </script>
  599. <style lang="scss" scoped>
  600. .el-form-item--small.el-form-item {
  601. margin-bottom: 10px;
  602. }
  603. .el-col-8 {
  604. height: 75px;
  605. }
  606. </style>