From a76c5c86ac9af71da45bf78c825a2c7aa843b4c8 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 26 一月 2024 15:35:54 +0800 Subject: [PATCH] Revert "Mr.Shi" --- platform/src/components/business/OperaCompanyValidDateWindow.vue | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 163 insertions(+), 0 deletions(-) diff --git a/platform/src/components/business/OperaCompanyValidDateWindow.vue b/platform/src/components/business/OperaCompanyValidDateWindow.vue new file mode 100644 index 0000000..cd1fa6f --- /dev/null +++ b/platform/src/components/business/OperaCompanyValidDateWindow.vue @@ -0,0 +1,163 @@ +<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">姝e紡璐﹀彿</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> -- Gitblit v1.9.3