|
|
@@ -2,7 +2,7 @@
|
|
|
* @Author: liuzhenlin 461480418@qq.ocm
|
|
|
* @Date: 2023-01-12 11:57:48
|
|
|
* @LastEditors: liuzhenlin
|
|
|
- * @LastEditTime: 2023-03-08 15:15:33
|
|
|
+ * @LastEditTime: 2023-05-08 10:24:04
|
|
|
* @Description: file content
|
|
|
* @FilePath: \oms\pages\project\upgrade.vue
|
|
|
-->
|
|
|
@@ -20,12 +20,13 @@
|
|
|
</view>
|
|
|
<view class="main">
|
|
|
<u-form :model="addForm" :rules="rules" ref="addForm" label-width="0">
|
|
|
+ <!-- 项目级别 -->
|
|
|
<u-form-item prop="nboType" borderBottom customStyle="padding:40rpx 0 30rpx">
|
|
|
<view class="form-label flex_l">
|
|
|
<view class="label-tag"></view>
|
|
|
项目级别
|
|
|
</view>
|
|
|
- <u-radio-group v-model="addForm.nboType" placement="row">
|
|
|
+ <u-radio-group v-model="addForm.nboType" placement="row" @change="changeLevel">
|
|
|
<u-radio
|
|
|
customStyle="margin-right:40rpx"
|
|
|
:disabled="projectDetails.nboType === '10'"
|
|
|
@@ -44,6 +45,7 @@
|
|
|
<!-- <u-radio v-if="projectDetails.nboType === '10'" label="储备" name="50"></u-radio> -->
|
|
|
</u-radio-group>
|
|
|
</u-form-item>
|
|
|
+ <!-- A/B -->
|
|
|
<view v-if="addForm.nboType !== '30'">
|
|
|
<u-form-item prop="nboBudget" borderBottom customStyle="padding:40rpx 0 30rpx">
|
|
|
<view class="form-label flex_l">
|
|
|
@@ -52,7 +54,7 @@
|
|
|
</view>
|
|
|
<u-input
|
|
|
placeholder="输入项目预算"
|
|
|
- v-model="addForm.nboBudget"
|
|
|
+ v-model.number="addForm.nboBudget"
|
|
|
border="none"
|
|
|
type="number"
|
|
|
suffixIconStyle="color:#CDCDCD"
|
|
|
@@ -85,51 +87,44 @@
|
|
|
clearable
|
|
|
customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
</u-form-item>
|
|
|
- </view>
|
|
|
- <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" v-if="addForm.nboType !== '30'">
|
|
|
- <view class="form-label flex_l">技术支持人员</view>
|
|
|
- <u-input
|
|
|
- placeholder="输入技术支持人员"
|
|
|
- v-model="addForm.technicalSupportName"
|
|
|
- border="none"
|
|
|
- suffixIconStyle="color:#CDCDCD"
|
|
|
- clearable
|
|
|
- customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item
|
|
|
- prop="technicalSupportContent"
|
|
|
- borderBottom
|
|
|
- customStyle="padding:40rpx 0 30rpx"
|
|
|
- v-if="addForm.nboType !== '30'">
|
|
|
- <view class="form-label flex_l">
|
|
|
- <view class="label-tag"></view>
|
|
|
- 技术支持内容
|
|
|
- </view>
|
|
|
- <u-input
|
|
|
- placeholder="输入技术支持内容"
|
|
|
- v-model="addForm.technicalSupportContent"
|
|
|
- border="none"
|
|
|
- suffixIconStyle="color:#CDCDCD"
|
|
|
- clearable
|
|
|
- customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
- </u-form-item>
|
|
|
- <u-form-item
|
|
|
- borderBottom
|
|
|
- customStyle="padding:40rpx 0 30rpx"
|
|
|
- @click="showSupportDate = true"
|
|
|
- v-if="addForm.nboType !== '30'">
|
|
|
- <view class="form-label flex_l">技术支持时间</view>
|
|
|
- <u-input
|
|
|
- :readonly="true"
|
|
|
- placeholder="请选择技术支持时间"
|
|
|
- v-model="addForm.technicalSupportTime"
|
|
|
- border="none"
|
|
|
- suffixIcon="arrow-down"
|
|
|
- suffixIconStyle="color:#CDCDCD"
|
|
|
- clearable
|
|
|
- customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
- </u-form-item>
|
|
|
- <view v-if="addForm.nboType !== '30'">
|
|
|
+ <u-form-item prop="technicalSupportName" borderBottom customStyle="padding:40rpx 0 30rpx">
|
|
|
+ <view class="form-label flex_l">
|
|
|
+ <view class="label-tag"></view>
|
|
|
+ 技术支持人员
|
|
|
+ </view>
|
|
|
+ <u-input
|
|
|
+ placeholder="输入技术支持人员"
|
|
|
+ v-model="addForm.technicalSupportName"
|
|
|
+ border="none"
|
|
|
+ suffixIconStyle="color:#CDCDCD"
|
|
|
+ clearable
|
|
|
+ customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item prop="technicalSupportContent" borderBottom customStyle="padding:40rpx 0 30rpx">
|
|
|
+ <view class="form-label flex_l">
|
|
|
+ <view class="label-tag"></view>
|
|
|
+ 技术支持内容
|
|
|
+ </view>
|
|
|
+ <u-input
|
|
|
+ placeholder="输入技术支持内容"
|
|
|
+ v-model="addForm.technicalSupportContent"
|
|
|
+ border="none"
|
|
|
+ suffixIconStyle="color:#CDCDCD"
|
|
|
+ clearable
|
|
|
+ customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
+ </u-form-item>
|
|
|
+ <u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showSupportDate = true">
|
|
|
+ <view class="form-label flex_l">技术支持时间</view>
|
|
|
+ <u-input
|
|
|
+ :readonly="true"
|
|
|
+ placeholder="请选择技术支持时间"
|
|
|
+ v-model="addForm.technicalSupportTime"
|
|
|
+ border="none"
|
|
|
+ suffixIcon="arrow-down"
|
|
|
+ suffixIconStyle="color:#CDCDCD"
|
|
|
+ clearable
|
|
|
+ customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
+ </u-form-item>
|
|
|
<u-form-item borderBottom customStyle="padding:40rpx 0 30rpx" @click="showBudgetDate = true">
|
|
|
<view class="form-label flex_l">项目预算期限</view>
|
|
|
<u-input
|
|
|
@@ -162,7 +157,26 @@
|
|
|
clearable
|
|
|
customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
</u-form-item>
|
|
|
+ <!-- 上传报价单文件 -->
|
|
|
+ <u-form-item prop="quotationFile" borderBottom customStyle="padding:40rpx 0 30rpx">
|
|
|
+ <view class="form-label flex_l">
|
|
|
+ <view class="label-tag"></view>
|
|
|
+ 报价单
|
|
|
+ </view>
|
|
|
+ <uni-file-picker
|
|
|
+ file-mediatype="all"
|
|
|
+ mode="grid"
|
|
|
+ @select="chooseFile($event, 'baojia')"
|
|
|
+ @delete="delQuotationFile"
|
|
|
+ ref="upload"
|
|
|
+ limit="1">
|
|
|
+ <view class="upload-btn">
|
|
|
+ <u-icon name="plus-circle-fill" color="blue" size="28"></u-icon>
|
|
|
+ </view>
|
|
|
+ </uni-file-picker>
|
|
|
+ </u-form-item>
|
|
|
</view>
|
|
|
+ <!-- A -->
|
|
|
<view v-if="addForm.nboType === '10'">
|
|
|
<u-form-item
|
|
|
prop="purchasingWayVal"
|
|
|
@@ -184,7 +198,7 @@
|
|
|
customStyle="padding: 0 30rpx 0 12rpx"></u-input>
|
|
|
</u-form-item>
|
|
|
<u-form-item
|
|
|
- prop="technicalSupportTime"
|
|
|
+ prop="purchasingTime"
|
|
|
borderBottom
|
|
|
customStyle="padding:40rpx 0 30rpx"
|
|
|
@click="showPurchasingDate = true">
|
|
|
@@ -195,7 +209,7 @@
|
|
|
<u-input
|
|
|
:readonly="true"
|
|
|
placeholder="请选择采购时间"
|
|
|
- v-model="addForm.technicalSupportTime"
|
|
|
+ v-model="addForm.purchasingTime"
|
|
|
border="none"
|
|
|
suffixIcon="arrow-down"
|
|
|
suffixIconStyle="color:#CDCDCD"
|
|
|
@@ -264,8 +278,9 @@
|
|
|
<u-radio customStyle="margin-right:40rpx" label="否" name="20"></u-radio>
|
|
|
</u-radio-group>
|
|
|
</u-form-item>
|
|
|
+ <!-- 上传大数参数文件 -->
|
|
|
<u-form-item
|
|
|
- prop="file"
|
|
|
+ prop="dashooParamFile"
|
|
|
borderBottom
|
|
|
customStyle="padding:40rpx 0 30rpx"
|
|
|
v-if="addForm.isAdoptDashoo == '10'">
|
|
|
@@ -273,7 +288,13 @@
|
|
|
<view class="label-tag"></view>
|
|
|
文件
|
|
|
</view>
|
|
|
- <uni-file-picker file-mediatype="all" mode="grid" @select="chooseFile($event)" ref="upload" limit="1">
|
|
|
+ <uni-file-picker
|
|
|
+ file-mediatype="all"
|
|
|
+ mode="grid"
|
|
|
+ @delete="deldashooParamFile"
|
|
|
+ @select="chooseFile($event)"
|
|
|
+ ref="upload"
|
|
|
+ limit="1">
|
|
|
<view class="upload-btn">
|
|
|
<u-icon name="plus-circle-fill" color="blue" size="28"></u-icon>
|
|
|
</view>
|
|
|
@@ -355,6 +376,12 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
+ import {
|
|
|
+ multipartUpload as upload,
|
|
|
+ uploadTask as task, //上传任务对象,同requestTask js_sdk\xp-multipart\xp-multipart\xp-multipart.js
|
|
|
+
|
|
|
+ // D:\work\oms\js_sdk\xp-multipart\xp-multipart\xp-multipart.js
|
|
|
+ } from '@/js_sdk/xp-multipart/xp-multipart/xp-multipart'
|
|
|
import projectApi from '../../api/project'
|
|
|
import to from 'await-to-js'
|
|
|
import SelectDealer from 'components/SelectDealer'
|
|
|
@@ -396,8 +423,10 @@
|
|
|
remark: '', //转化原因
|
|
|
projConversionReason: '', //升级原因
|
|
|
id: 0, //项目id
|
|
|
- file: '',
|
|
|
- tempFilePaths: '',
|
|
|
+ dashooParamFile: '',
|
|
|
+ dashooParamFilePaths: '',
|
|
|
+ quotationFilePaths: '',
|
|
|
+ quotationFile: '',
|
|
|
},
|
|
|
showModal: false,
|
|
|
projectDetails: {},
|
|
|
@@ -408,6 +437,12 @@
|
|
|
message: '请选择项目级别',
|
|
|
trigger: ['blur'],
|
|
|
},
|
|
|
+ technicalSupportName: {
|
|
|
+ type: 'string',
|
|
|
+ required: true,
|
|
|
+ message: '请输入技术支持人员',
|
|
|
+ trigger: ['blur'],
|
|
|
+ },
|
|
|
technicalSupportContent: {
|
|
|
type: 'string',
|
|
|
required: true,
|
|
|
@@ -438,12 +473,18 @@
|
|
|
message: '请选择是否采纳大数技术参数',
|
|
|
trigger: ['blur'],
|
|
|
},
|
|
|
- file: {
|
|
|
+ dashooParamFile: {
|
|
|
type: 'object',
|
|
|
required: true,
|
|
|
message: '请上传文件',
|
|
|
trigger: ['change'],
|
|
|
},
|
|
|
+ quotationFile: {
|
|
|
+ type: 'object',
|
|
|
+ required: true,
|
|
|
+ message: '请上传报价单',
|
|
|
+ trigger: ['change'],
|
|
|
+ },
|
|
|
remark: {
|
|
|
type: 'string',
|
|
|
required: true,
|
|
|
@@ -489,6 +530,17 @@
|
|
|
this.addForm.remark = ''
|
|
|
}
|
|
|
},
|
|
|
+ changeLevel(e) {
|
|
|
+ if (e == '20') {
|
|
|
+ this.addForm.dashooParamFile = ''
|
|
|
+ this.addForm.dashooParamFilePaths = ''
|
|
|
+ } else if (e == '30') {
|
|
|
+ this.addForm.dashooParamFile = ''
|
|
|
+ this.addForm.dashooParamFilePaths = ''
|
|
|
+ this.addForm.quotationFile = ''
|
|
|
+ this.addForm.quotationFilePaths = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
// 选择采购方式
|
|
|
pickModel(e) {
|
|
|
this.addForm.purchasingWay = e.value[0].key
|
|
|
@@ -548,46 +600,71 @@
|
|
|
// 选择是否采用大数参数
|
|
|
chooseRadio(e) {
|
|
|
if (e == '20') {
|
|
|
- this.addForm.file = ''
|
|
|
+ this.addForm.dashooParamFile = ''
|
|
|
+ this.addForm.dashooParamFilePaths = ''
|
|
|
}
|
|
|
},
|
|
|
// // 选择上传触发函数
|
|
|
- chooseFile(e) {
|
|
|
- this.addForm.file = e.tempFiles[0].file
|
|
|
- this.addForm.tempFilePaths = e.tempFilePaths[0]
|
|
|
+ chooseFile(e, type = null) {
|
|
|
+ if (type == 'baojia') {
|
|
|
+ this.addForm.quotationFile = e.tempFiles[0].file
|
|
|
+ this.addForm.quotationFilePaths = e.tempFilePaths[0]
|
|
|
+ } else {
|
|
|
+ this.addForm.dashooParamFile = e.tempFiles[0].file
|
|
|
+ this.addForm.dashooParamFilePaths = e.tempFilePaths[0]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 删除报价单
|
|
|
+ delQuotationFile() {
|
|
|
+ this.addForm.quotationFile = ''
|
|
|
+ this.addForm.quotationFilePaths = ''
|
|
|
+ },
|
|
|
+ // 删除大数参数文件
|
|
|
+ deldashooParamFile() {
|
|
|
+ this.addForm.dashooParamFile = ''
|
|
|
+ this.addForm.dashooParamFilePaths = ''
|
|
|
},
|
|
|
// 上传函数
|
|
|
- async upgradeA(data) {
|
|
|
+ async upgradeAorB(data) {
|
|
|
const basePath = process.uniEnv.VUE_APP_MicroSrvProxy_API + process.uniEnv.VUE_APP_ParentPath
|
|
|
- uni.uploadFile({
|
|
|
- url: basePath,
|
|
|
- filePath: data.tempFilePaths,
|
|
|
- name: 'file',
|
|
|
- formData: data,
|
|
|
+ upload({
|
|
|
+ url: basePath, //后端接口
|
|
|
+ fields: data,
|
|
|
+ files: {
|
|
|
+ quotationFile: this.addForm.quotationFilePaths,
|
|
|
+ dashooParamFile: this.addForm.dashooParamFilePaths,
|
|
|
+ },
|
|
|
header: {
|
|
|
Tenant: process.uniEnv.VUE_APP_TENANT,
|
|
|
Authorization: 'Bearer ' + uni.getStorageSync('opms_token') || '',
|
|
|
'X-RPCX-SerializeType': '1',
|
|
|
'X-RPCX-ServicePath': 'BusinessHandler',
|
|
|
- 'X-RPCX-ServiceMethod': 'BusinessUpgradeA',
|
|
|
+ 'X-RPCX-ServiceMethod': 'BusinessUpgradeAorB',
|
|
|
SrvEnv: 'dev',
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- this.$refs.uToast.show({
|
|
|
- type: 'success',
|
|
|
- message: '提交成功',
|
|
|
- complete: () => {
|
|
|
- this.goBack()
|
|
|
- },
|
|
|
- })
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'success',
|
|
|
+ message: '提交成功',
|
|
|
+ complete: () => {
|
|
|
+ this.goBack()
|
|
|
+ },
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.msg,
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
this.$refs.uToast.show({
|
|
|
- type: 'success',
|
|
|
+ type: 'error',
|
|
|
message: '提交失败',
|
|
|
})
|
|
|
},
|
|
|
- complete: () => {
|
|
|
+ complete: (ret) => {
|
|
|
this.showModal = false
|
|
|
},
|
|
|
})
|
|
|
@@ -610,8 +687,8 @@
|
|
|
async handleUpgradeApi() {
|
|
|
let params = this.addForm
|
|
|
params.nboBudget = Number(params.nboBudget)
|
|
|
- if (this.addForm.nboType === '10' && this.addForm.isAdoptDashoo == '10') {
|
|
|
- this.upgradeA(params)
|
|
|
+ if (this.addForm.nboType === '10' || this.addForm.nboType === '20') {
|
|
|
+ this.upgradeAorB(params)
|
|
|
} else {
|
|
|
const [err, res] = await to(projectApi.upgrade(params))
|
|
|
this.showModal = false
|
|
|
@@ -627,13 +704,6 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- // closeUser(user) {
|
|
|
- // if (user) {
|
|
|
- // console.log(user)
|
|
|
- // this.addForm.userId = user.id
|
|
|
- // this.addForm.userName = user.label
|
|
|
- // }
|
|
|
- // },
|
|
|
goBack() {
|
|
|
uni.navigateBack({
|
|
|
//关闭当前页面,返回上一页面或多级页面。
|