From fcb6eb2c02f00b0da864a8915af2afcb285a63a8 Mon Sep 17 00:00:00 2001 From: gaosp <gaosp> Date: 星期二, 16 一月 2024 20:29:59 +0800 Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdc-front --- src/container/ledger/Manage-add-update.vue | 155 +++++++-------------------------------------------- 1 files changed, 21 insertions(+), 134 deletions(-) diff --git a/src/container/ledger/Manage-add-update.vue b/src/container/ledger/Manage-add-update.vue index 20e5800..7ed08aa 100644 --- a/src/container/ledger/Manage-add-update.vue +++ b/src/container/ledger/Manage-add-update.vue @@ -7,19 +7,13 @@ :visible.sync="addVisible"> <!-- 娣诲姞鍐呭--> <el-form :model="dataForm" label-width="100px" ref="dataForm"> - <!-- <el-row :gutter="20"> + <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 - v-for="item in machineNamelist" - :key="item.value" - :label="item.label" - :value="item.value"> - </el-option> - </el-select> + <el-input v-model="dataForm.machineName" placeholder="鏈哄簥鍚嶇О" clearable></el-input> </el-form-item> </el-col> + <!-- <el-col :xs="24":sm="6":md="6":lg="6":xl="6"> <el-form-item label="鏈哄簥ip" prop="machineIp"> <el-input v-model="dataForm.machineIp" placeholder="鏈哄簥ip" clearable></el-input> @@ -183,6 +177,7 @@ </el-select> </el-form-item> </el-col> + <!-- <el-col :xs="24":sm="6":md="6":lg="6":xl="6"> <el-form-item label="鐝" prop="classes"> <el-select v-model="dataForm.classes" placeholder="---璇烽�夋嫨---"> @@ -192,6 +187,7 @@ </el-select> </el-form-item> </el-col> + --> <el-col :xs="24":sm="6":md="6":lg="6":xl="6"> <el-form-item label="鐢熶骇鍘傚" prop="manufacturer"> <el-input v-model="dataForm.manufacturer" placeholder="鐢熶骇鍘傚" clearable></el-input> @@ -254,28 +250,28 @@ <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, dataForm: { - id: 0, // title鏄剧ず鏂板杩樻槸淇敼 + id: '', // title鏄剧ず鏂板杩樻槸淇敼 machineName: '', // 鏈哄簥鍚� machineIp: '', // 鏈哄簥ip workshop: '', // 杞﹂棿鍚� @@ -306,28 +302,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 +316,9 @@ }, immediate: true } + }, + created () { + this.init(this.row) }, methods: { init(row) { @@ -376,108 +353,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 +374,7 @@ }) }) } else { - accountCreate(this.dataForm).then(res => { + accountUpdate(this.dataForm).then(res => { this.$message({ message: '淇敼鎴愬姛', type: 'success', @@ -509,10 +393,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