From f466ae4fdc645c66c9f25e2e4598b9809e2b41af Mon Sep 17 00:00:00 2001 From: yangys <y_ys79@sina.com> Date: 星期六, 13 一月 2024 22:56:49 +0800 Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdc-front --- src/container/ledger/Manage-add-update.vue | 143 +++++------------------------------------------ 1 files changed, 17 insertions(+), 126 deletions(-) diff --git a/src/container/ledger/Manage-add-update.vue b/src/container/ledger/Manage-add-update.vue index 20e5800..94538bb 100644 --- a/src/container/ledger/Manage-add-update.vue +++ b/src/container/ledger/Manage-add-update.vue @@ -7,8 +7,8 @@ :visible.sync="addVisible"> <!-- 娣诲姞鍐呭--> <el-form :model="dataForm" label-width="100px" ref="dataForm"> - <!-- <el-row :gutter="20"> - <el-col :xs="24":sm="6":md="6":lg="6":xl="6"> + <el-row :gutter="20"> + <!-- <el-col :xs="24":sm="6":md="6":lg="6":xl="6"> <el-form-item label="鏈哄簥鍚�" prop="machineName"> <el-select filterable v-model="dataForm.machineName" placeholder="鏀寔妯$硦鏌ヨ" clearable> <el-option @@ -254,23 +254,23 @@ <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> </el-upload> </el-form-item> - </el-col> - </el-row> --> + </el-col> --> + </el-row> </el-form> <!-- 鎸夐挳 --> <span slot="footer" class="dialog-footer"> <el-button size="mini" @click="cancel">鍙栨秷</el-button> - <el-button size="mini" type="primary" @click="dataFormSubmit()">淇濆瓨</el-button> + <el-button size="mini" type="primary" style="background-color: #409EFF;" @click="dataFormSubmit()">淇濆瓨</el-button> </span> </el-dialog> </div> </template> <script> - import { getUseDpts,accountCreate } from '@/api/Api' + import { accountUpdate,accountCreate } from '@/api/Api' export default { - props: ['addVisible','deviceType','departmentlist'], + props: ['addVisible','deviceType','departmentlist','row','isselectlist','deviceStatus','financePro'], data() { return { visible: false, @@ -306,28 +306,6 @@ workshoplist: [], // 杞﹂棿list oldworkshoplist: [], sectionlist: [], // 宸ユ - isselectlist: [ - { - label: '鏄�', - value: '1' - }, - { - label: '鍚�', - value: '0' - } - ], - // 璁惧鐘舵�� - deviceStatus: [ - { value: 'STOP', label: '鍏虫満' }, - { value: 'RUN', label: '杩愯' }, - { value: 'IDLE', label: '绌洪棽' }, - { value: 'ALARM', label: '鎶ヨ' } - ], - // 璐﹀姟灞炴�� - financePro: [ - { value: '甯愬唴', label: '甯愬唴' }, - { value: '甯愬', label: '甯愬' } - ], userNamelist: [], // 鐢ㄦ埛list imageUrl: '', // 鍥剧墖 fileList: []// 鏂囨。涓婁紶list @@ -342,6 +320,9 @@ }, immediate: true } + }, + created () { + this.init(this.row) }, methods: { init(row) { @@ -376,108 +357,15 @@ this.dataForm.remark = row.remark this.dataForm.managType = row.managType this.dataForm.classes = row.classes - } else { this.dataForm.id = 0 } - this.visible = true - this.getMachineList() - this.queryuserlist() - this.queryworkshoplist() + } else { this.dataForm.id = '' } }, /* 鏌ヨ浣跨敤閮ㄩ棬*/ cancel () { this.$emit('close') }, - // ----------------- - // 鑾峰彇鏈哄簥lists - getMachineList() { - // getMachineList(this.currentPage, this.keyWord).then(res => { - // this.machineNamelist = [] - // if (res.list.length > 0) { - // res.list.map(item => { - // this.machineNamelist.push({ - // value: item.name, - // label: item.name - // }) - // }) - // } - // }) - }, - - /* 鑾峰彇鐢ㄦ埛list*/ - queryuserlist() { - // queryuserlist().then(res => { - // this.userNamelist = [] - // if (res.list.length > 0) { - // res.list.map(item => { - // this.userNamelist.push({ - // value: item.name, - // label: item.name - // }) - // }) - // } - // }) - }, - /* 鑾峰彇杞﹂棿鍚峫ist*/ - queryworkshoplist() { - // queryworkshoplist().then(res => { - // this.workshoplist = [] - // if (res.workshopList.length > 0) { - // this.oldworkshoplist = res.workshopList - // res.workshopList.map(item => { - // this.workshoplist.push({ - // value: item.name, - // label: item.name - // }) - // }) - // } - // }) - }, - /* 杞﹂棿鍚嶆敼鍙� 鑾峰彇宸ユ*/ - workshopchange() { - var cjname = this.dataForm.workshop - this.sectionlist = [] - this.oldworkshoplist.map(item => { - if (item.name === cjname) { - item.sectionList.map(items => { - this.sectionlist.push({ - value: items.name, - label: items.name - }) - }) - } - }) - }, - - /* 鍥剧墖*/ - handleAvatarSuccess(res, file) { - this.imageUrl = URL.createObjectURL(file.raw) - }, - beforeAvatarUpload(file) { - const isJPG = file.type === 'image/jpeg' - const isLt2M = file.size / 1024 / 1024 < 2 - if (!isJPG) { - this.$message.error('涓婁紶澶村儚鍥剧墖鍙兘鏄� JPG 鏍煎紡!') - } - if (!isLt2M) { - this.$message.error('涓婁紶澶村儚鍥剧墖澶у皬涓嶈兘瓒呰繃 2MB!') - } - return isJPG && isLt2M - }, - /* 鏂囨。 */ - handleRemove(file, fileList) { - // console.log(file, fileList) - }, - handlePreview(file) { - // console.log(file) - }, - handleExceed(files, fileList) { - this.$message.warning(`褰撳墠闄愬埗閫夋嫨 3 涓枃浠讹紝鏈閫夋嫨浜� ${files.length} 涓枃浠讹紝鍏遍�夋嫨浜� ${files.length + fileList.length} 涓枃浠禶) - }, - beforeRemove(file, fileList) { - return this.$confirm(`纭畾绉婚櫎 ${file.name}锛焋) - }, /* 鎻愪氦*/ dataFormSubmit() { - if (this.dataForm.id === 0) { // 鏂板 + if (this.dataForm.id === '') { // 鏂板 accountCreate(this.dataForm).then(res => { this.$message({ message: '鏂板鎴愬姛', @@ -490,7 +378,7 @@ }) }) } else { - accountCreate(this.dataForm).then(res => { + accountUpdate(this.dataForm).then(res => { this.$message({ message: '淇敼鎴愬姛', type: 'success', @@ -509,10 +397,13 @@ <style lang="scss"> .el-form-item__content { - .el-select { + .el-select,.el-input { width: 100%; } } + .el-dialog__body { + overflow: hidden; + } .avatar-uploader .el-upload { border: 1px dashed #d9d9d9; border-radius: 6px; -- Gitblit v1.9.3