¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalAlertWindow :title="title" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm"> |
| | | <div class="tips-style">è°æ´æææåï¼å®¢æ·çæææä¼åçæ¹åï¼è¯·è°¨æ
æä½</div> |
| | | <el-form :model="form" ref="form" label-width="100px" label-suffix="ï¼" :rules="rules" inline> |
| | | <div class="short-line"> |
| | | <el-form-item label="ä¼ä¸åç§°" prop="name"> |
| | | <el-input v-model="form.name" disabled v-trim /> |
| | | </el-form-item> |
| | | </div> |
| | | <!-- <div class="item-line"> |
| | | <el-form-item label="客æ·ç±»å" prop="oepnType"> |
| | | <el-radio-group v-model="form.oepnType" @change="typeChange"> |
| | | <el-radio :label="1">æ£å¼è´¦å·</el-radio> |
| | | <el-radio :label="0">è¯ç¨è´¦å·</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </div> --> |
| | | |
| | | <div class="item-line"> |
| | | <el-form-item label="æææ" prop="oepnValidDate"> |
| | | <!-- <el-date-picker v-model="form.oepnValidDate" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd hh:mm:ss" |
| | | placeholder="éæ©æ¥æ"> --> |
| | | <el-date-picker type="date" v-model="form.oepnValidDate" value-format="yyyy-MM-dd" placeholder="éæ©æææ¥æ"> |
| | | </el-date-picker> |
| | | æææå
å«éæ©æ¥æ |
| | | </el-form-item> |
| | | </div> |
| | | <div class="short-line"> |
| | | <el-form-item label="ä¸»ææ°éå¶" prop="userNum"> |
| | | <el-input v-model="form.userNum" placeholder="请è¾å
¥ä¸»ææ°" v-trim /> |
| | | <span style="display:inline;font-size:10px;color:red">注ï¼ä¸º0ä¸éå¶äººæ°</span> |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | <!-- <div slot="footer"></div> --> |
| | | </GlobalAlertWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalAlertWindow from '@/components/common/GlobalAlertWindow' |
| | | import { update } from '@/api/business/company' |
| | | // import { create } from '@/api/business/companyChange' |
| | | export default { |
| | | name: 'OperaCompanyValidDateWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalAlertWindow }, |
| | | data() { |
| | | |
| | | return { |
| | | isUploading: false, |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | id: null, |
| | | name: '', |
| | | oepnValidDate: '', |
| | | userNum: 0 |
| | | }, |
| | | types: [], |
| | | // éªè¯è§å |
| | | rules: { |
| | | openUserNum: [ |
| | | { pattern: /^[0-9]+$/, message: 'åªå¯ä»¥è¾å
¥æ°å', trigger: 'change' } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.config({ |
| | | api: '/business/company', |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | methods: { |
| | | open(title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | // ç¼è¾ |
| | | this.$nextTick(() => { |
| | | this.$refs.form.clearValidate() |
| | | this.$refs.form.resetFields() |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | }) |
| | | }, |
| | | typeChange() { |
| | | let tempDate = new Date(); |
| | | tempDate.setDate(tempDate.getDate() + (this.form.oepnType ? 30 : 15)) |
| | | this.form.oepnValidDate = `${tempDate.getFullYear()}-${tempDate.getMonth() + 1}-${tempDate.getDate()} 00:00:00` |
| | | }, |
| | | confirm() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | this.isWorking = true |
| | | update(this.form) |
| | | .then(() => { |
| | | this.visible = false |
| | | this.$refs.form.resetFields() |
| | | this.$tip.apiSuccess('ä¿®æ¹ææææå') |
| | | this.$emit('success') |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .tips-style { |
| | | background-color: #f7f7f7; |
| | | height: 30px; |
| | | line-height: 30px; |
| | | |
| | | a { |
| | | text-decoration: none |
| | | } |
| | | |
| | | padding-left: 10px; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .item-line { |
| | | ::v-deep .el-form-item__content { |
| | | width: 480px; |
| | | } |
| | | } |
| | | |
| | | .short-line { |
| | | ::v-deep .el-form-item__content { |
| | | width: 286px; |
| | | } |
| | | } |
| | | |
| | | .pic-line { |
| | | ::v-deep .el-form-item__content { |
| | | width: 500px; |
| | | } |
| | | } |
| | | |
| | | .address { |
| | | display: flex; |
| | | |
| | | .line { |
| | | width: 10px; |
| | | } |
| | | } |
| | | |
| | | .sub-title { |
| | | font-size: 20px; |
| | | font-weight: 600; |
| | | margin-top: 10px; |
| | | margin-bottom: 10px; |
| | | } |
| | | </style> |