| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <template>
- <view>
- <!-- 转储备项目 -->
- <u-modal
- :show="modelVisible"
- :showCancelButton="true"
- @confirm="handleConfirm()"
- @cancel="close()"
- :asyncClose="true"
- title="转储备项目">
- <view class="slot-content" style="width: 100%">
- <view class="flex">
- <text>转化原因:</text>
- <u-textarea
- v-model="addFrom.projConversionReason"
- placeholder="请输入转化原因"
- height="180"
- :count="true"
- maxlength="500"></u-textarea>
- </view>
- </view>
- </u-modal>
- </view>
- </template>
- <script>
- import projectApi from '../../../api/project'
- import to from 'await-to-js'
- export default {
- data() {
- return {
- flag: true,
- modelVisible: false,
- addFrom: {
- projConversionReason: '',
- id: null,
- },
- }
- },
- methods: {
- open(id) {
- this.addFrom.id = id
- this.modelVisible = true
- },
- // 移入公海
- async handleConfirm() {
- if (!this.flag) return
- let params = this.addFrom
- this.flag = false
- const [err, res] = await to(projectApi.toReserve(params))
- this.flag = true
- if (err) return this.close()
- if (res.code == 200) {
- this.$refs.uToast.show({
- type: 'loading',
- message: '转储备成功',
- complete: () => {
- this.modelVisible = false
- this.$emit('fetchList')
- },
- })
- } else {
- this.close()
- }
- },
- // 关闭移入公海模块
- close() {
- this.addFrom.id = []
- this.addFrom.projConversionReason = ''
- this.modelVisible = false
- },
- },
- }
- </script>
- <style></style>
|