From 95af123562c0a05ae8955d53fcdcd4c8b310ced8 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 29 六月 2022 17:32:00 +0800
Subject: [PATCH] 1.制造模型:工艺路线(新增、删除、预览)功能开发 2.制造模型:工序定义(查询) 功能开发 3.系统设置:编码规则(查询)功能开发4.修改实施部提出的bug
---
src/views/zzmx/gylx.vue | 431 ++++++++++++++++++++++++++++++++---------------------
1 files changed, 263 insertions(+), 168 deletions(-)
diff --git a/src/views/zzmx/gylx.vue b/src/views/zzmx/gylx.vue
index 375570a..8535de9 100644
--- a/src/views/zzmx/gylx.vue
+++ b/src/views/zzmx/gylx.vue
@@ -40,6 +40,7 @@
:data="tableData"
:height="tableHeight"
border
+ stripe
:style="{width: 100+'%',height:tableHeight+'px',}"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
@@ -96,7 +97,8 @@
<template slot-scope="{row}">
<div class="operationClass">
<!-- <el-button type="text" @click="edit('edit',row)">淇敼</el-button>-->
- <el-button type="text" @click="del(row.id)">鍒犻櫎</el-button>
+ <el-button type="text" @click="edit('edit',row)">棰勮</el-button>
+ <el-button type="text" @click="del(row)">鍒犻櫎</el-button>
</div>
</template>
</el-table-column>
@@ -116,26 +118,28 @@
</div>
<el-dialog
- :title="operation==='add'?'鏂板':'淇敼'"
+ :title="operation==='add'?'鏂板':'棰勮'"
:visible.sync="dialogVisible"
width="70%"
+ :close-on-click-modal="false"
top="15vh"
@closed="handleClose"
@close="handleClose"
>
- <el-form ref="dialogForm" :rules="dialogFormRules" :model="dialogForm" label-width="80px">
+ <el-form ref="dialogForm" style="height: 500px" :rules="dialogFormRules" :model="dialogForm" label-width="80px">
<div style="display: flex">
- <el-form-item label="宸ヨ壓缂栫爜" prop="OrgCode" style="margin-right: 20px">
- <el-input v-model="dialogForm.OrgCode" :disabled="operation!=='add'" style="width: 220px" />
+ <el-form-item label="宸ヨ壓缂栫爜" prop="code" style="margin-right: 20px">
+ <el-input v-model="dialogForm.code" :disabled="operation!=='add'" style="width: 220px" />
</el-form-item>
- <el-form-item label="宸ヨ壓鍚嶇О" prop="OrgName">
- <el-input v-model="dialogForm.OrgName" style="width: 220px" />
+ <el-form-item label="宸ヨ壓鍚嶇О" prop="name">
+ <el-input v-model="dialogForm.name" :disabled="operation==='edit'" style="width: 220px" />
</el-form-item>
</div>
<div style="display: flex">
- <el-form-item prop="SupUnit" label="浣跨敤鐘舵��" style="margin-right: 20px">
+ <el-form-item prop="enable" label="浣跨敤鐘舵��" style="margin-right: 20px">
<el-select
- v-model="dialogForm.isEnable"
+ v-model="dialogForm.enable"
+ :disabled="operation==='edit'"
:popper-append-to-body="false"
style="width: 220px"
placeholder="璇烽�夋嫨"
@@ -148,14 +152,14 @@
/>
</el-select>
</el-form-item>
- <el-form-item label="宸ヨ壓鎻忚堪" prop="OrgName">
- <el-input v-model="dialogForm.OrgName" type="textarea" style="width: 220px" />
+ <el-form-item label="宸ヨ壓鎻忚堪" prop="description">
+ <el-input v-model="dialogForm.description" :disabled="operation==='edit'" type="textarea" style="width: 220px" />
</el-form-item>
</div>
- <el-form-item label="宸ヨ壓璁剧疆" prop="OrgName" style="margin-top: 30px">
+ <el-form-item label="宸ヨ壓璁剧疆" prop="Data" style="margin-top: 30px">
<div class="settingDiv">
<!-- 瀹炵幇宸ヨ壓璁剧疆鍔ㄦ�佹坊鍔�-->
- <div v-for="(tag,index) in dynamicTags" :key="tag.id" style="display: flex;align-items: center">
+ <div v-for="(tag,index) in dynamicTags" :key="tag.seq" style="display: flex;align-items: center">
<div style="display: flex;align-items: center;position: relative;">
<div
class="orderNumber"
@@ -163,54 +167,73 @@
backgroundColor:index===0?'#f8f8fa':'#409EFF',
color:index===0?'#c6bbc4':'#FFFFFF',
border:index===0?'1px solid #c6bbc4':'1px solid #409EFF',
- zIndex:!flag&&tag.label===flagSelected?0:2
+ zIndex:tag.label===selectedName?0:2
}"
>
- {{ index+1 }}</div>
- <el-tooltip class="item" effect="dark" :content="tag.label" placement="top">
- <!-- @close="handleTagClose(tag.label)"-->
- <!-- :closable="index!==0"-->
- <el-tag
- v-if="flag||tag.label!==flagSelected"
- :disable-transitions="false"
- class="elTag"
- :class="tagClass(tag.label)"
- :effect="tag.effect"
- @click="elTagClick(tag)"
- >
- <!-- <div class="orderNumber">{{ index }}</div>-->
- {{ tag.label }}
- <i class="el-icon-edit" @click="tagEdit(tag)" />
- </el-tag>
- </el-tooltip>
+ {{ index+1 }}
+ </div>
+
+ <!-- <el-tooltip-->
+ <!-- class="item"-->
+ <!-- effect="dark"-->
+ <!-- :content="tag.stepname"-->
+ <!-- placement="top"-->
+ <!-- >-->
+ <!-- @close="handleTagClose(tag.stepname)"-->
+ <!-- :closable="index!==0"-->
+
+ <el-tag
+ v-if="tag.stepname!==selectedName"
+ :disable-transitions="false"
+ class="elTag"
+ :effect="tag.effect"
+ @click="elTagClick(tag)"
+ >
+ {{ tag.stepname }}
+ <i
+ v-if="tag.editDisabled&&operation!=='edit'"
+ class="el-icon-edit"
+ @click="tagEdit(tag)"
+ />
+ </el-tag>
+ <!-- </el-tooltip>-->
+
+ <!-- left:tag.stepname===selectedName?'191px':'141px',-->
<i
- v-if="index!==0"
+ v-if="index!==0&&tag.editDisabled&&operation!=='edit'"
:style="{
- left:!flag&&tag.label===flagSelected?'191px':'91px',
- top:!flag&&tag.label===flagSelected?'-2px':'-8px',
+ top:tag.stepname===selectedName?'-2px':'-8px',
}"
class="el-icon-close"
- @click="handleTagClose(tag.label)"
+ @click="handleTagClose(tag)"
/>
<el-autocomplete
- v-if="!flag&&tag.label===flagSelected"
- :ref="'saveTagInput'+tag.id"
- v-model="tagValue"
+ v-if="tag.stepname===selectedName"
+ :ref="'saveTagInput'+tag.seq"
+ v-model="autocompleteValue"
class="input-new-tag"
size="small"
:fetch-suggestions="querySearch"
- style="margin-left: 0;width: 200px;transform: translate(1)"
+ style="margin-left: 0;width: 150px;transform: translate(1)"
autofocus
+ :debounce="300"
+ :popper-append-to-body="false"
+ popper-class="autocompleteClass"
@select="handleSelect"
- @keyup.enter.native="handleInputConfirm2"
+ @keyup.enter.native="handleInputConfirm(tag)"
/>
<!-- @blur="handleBlur2"-->
- <div v-if="index!==dynamicTags.length-1" style="width: 40px;height: 1px;border: 1px solid #42b983" />
+ <div
+ v-if="index!==dynamicTags.length-1"
+ style="width: 40px;height: 1px;border: 1px solid #42b983"
+ />
</div>
</div>
- <!-- :disabled="addDisabled"-->
+
<el-button
+ v-if="operation!=='edit'"
type="success"
+ :disabled="addDisabled"
class="tagSuccess"
size="small"
icon="el-icon-plus"
@@ -222,8 +245,9 @@
</el-form>
<span slot="footer" class="dialog-footer">
<div class="footerButton">
- <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
- <el-button type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
+ <el-button v-if="operation==='edit'" @click="dialogVisibleCancel">杩� 鍥�</el-button>
+ <el-button v-if="operation!=='edit'" @click="dialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button v-if="operation!=='edit'" type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>
</div>
</span>
</el-dialog>
@@ -232,9 +256,7 @@
<script>
import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
-import { RouteSearch } from '@/api/zzmx'
+import { AddUpdateRoute, DeleteRoute, RouteSearch, RouteSelect, StepSelect, ViewRoute } from '@/api/zzmx'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -252,13 +274,6 @@
} else {
callback()
}
- }
- }
- const validateTypeCode = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('璇烽�夋嫨涓婄骇'))
- } else {
- callback()
}
}
return {
@@ -282,37 +297,39 @@
tableData: [],
dialogVisible: false,
dialogForm: {
- OrgType: '',
- OrgCode: '',
- OrgName: '',
- SupUnit: ''// 涓婄骇鍗曚綅
+ id: '',
+ code: '',
+ name: '',
+ enable: '',
+ description: '',
+ Data: []
},
dynamicTags: [// 宸ヨ壓璁剧疆鏁扮粍
- { id: 1, label: '鏍囩涓�鏍囩涓�鏍囩涓�鏍囩涓�鏍囩涓�鏍囩涓�', effect: 'light' },
- { id: 2, label: '鏍囩浜�', effect: 'light' },
- { id: 3, label: '鏍囩涓�', effect: 'light' }
+ { editDisabled: true, stepcode: 'Step01', seq: 1, stepname: ' ', effect: 'light' }
+ // { editDisabled: true, stepcode: 'Step02', seq: 2, stepname: '濂�', effect: 'light' },
+ // { editDisabled: true, stepcode: 'Step03', seq: 3, stepname: '澶�', effect: 'light' }
],
- tagSelectedId: '', // tag閫夋嫨涓璱d
- flag: true,
- flagSelected: '', // 鍒ゆ柇鏄惁閫変腑
- tagValue: '',
- restaurants: [],
- addDisabled: false,
-
+ clickSelected: '', // 榧犳爣鐐瑰嚮閫変腑鐨勫��
+ selectedName: '', // 閫変腑鐨勫悕绉�
+ autocompleteValue: '', // 鍙悳绱㈣緭鍏ユ涓殑鍊�
+ routeArr: [], // 宸ヨ壓璁剧疆涓嬫媺鎵�鏈夊��
+ addDisabled: false, // 娣诲姞鎸夐挳鏄惁鍙偣鍑�
+ editDisabled: true, // 淇敼鎸夐挳鏄惁鍙偣鍑�
+ mouseFocusPosition: 0, // 榧犳爣鑱氱劍鐨勪綅缃�
operation: '',
dialogFormRules: {
- OrgType: [
- { required: true, message: '璇疯緭鍏ラ�夋嫨绫诲瀷', trigger: ['blur', 'change'] }
- ],
- OrgCode: [
+ code: [
{ required: true, validator: validateName, trigger: ['blur', 'change'] }
],
- OrgName: [
+ name: [
{ required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
],
- SupUnit: [
- { required: true, validator: validateTypeCode, trigger: ['blur', 'change'] }
+ enable: [
+ { required: true, message: '璇烽�夋嫨浣跨敤鐘舵��', trigger: ['blur', 'change'] }
]
+ // Data: [
+ // { required: true, message: '璇疯缃伐鑹�', trigger: ['blur', 'change'] }
+ // ]
}
}
@@ -323,68 +340,94 @@
mounted() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
- this.restaurants = this.loadAll()
},
methods: {
+ // 杩滅▼鎼滅储
querySearch(queryString, cb) {
- var restaurants = this.restaurants
- var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
+ const routeArr = this.routeArr
+ routeArr.forEach(item => {
+ item.value = item.stepname
+ })
+ const results = queryString ? routeArr.filter(this.createFilter(queryString)) : routeArr
// 璋冪敤 callback 杩斿洖寤鸿鍒楄〃鐨勬暟鎹�
cb(results)
},
+ // 杩囨护
createFilter(queryString) {
- return (restaurant) => {
- // return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
- return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
+ return (res) => {
+ return (res.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
}
},
- loadAll() {
- return [
- { 'value': '涓夊叏椴滈锛堝寳鏂版尘搴楋級', 'address': '闀垮畞鍖烘柊娓旇矾144鍙�' },
- { 'value': 'Hot honey 棣栧皵鐐搁浮锛堜粰闇炶矾锛�', 'address': '涓婃捣甯傞暱瀹佸尯娣炶櫣璺�661鍙�' },
- { 'value': '鏂版椇瑙掕尪椁愬巺', 'address': '涓婃捣甯傛櫘闄�鍖虹湡鍖楄矾988鍙峰垱閭戦噾娌欒胺6鍙锋ゼ113' },
- { 'value': '娉峰崈瀹�(澶╁北瑗胯矾搴�)', 'address': '澶╁北瑗胯矾438鍙�' },
- { 'value': '鑳栦粰濂崇焊鏉泲绯曪紙涓婃捣鍑岀┖搴楋級', 'address': '涓婃捣甯傞暱瀹佸尯閲戦挓璺�968鍙�1骞�18鍙锋ゼ涓�灞傚晢閾�18-101' },
- { 'value': '璐¤尪', 'address': '涓婃捣甯傞暱瀹佸尯閲戦挓璺�633鍙�' },
- { 'value': '璞ぇ澶ч楦℃帓瓒呯骇濂剁埜', 'address': '涓婃捣甯傚槈瀹氬尯鏇瑰畨鍏矾鏇瑰畨璺�1685鍙�' },
- { 'value': '鑼惰姖鍏帮紙濂惰尪锛屾墜鎶撻ゼ锛�', 'address': '涓婃捣甯傛櫘闄�鍖哄悓鏅矾1435鍙�' }
- ]
+ // 宸ヨ壓璁剧疆 涓嬫媺鑾峰彇鎵�鏈�
+ async getStepSelectArr() {
+ const { data: res } = await StepSelect()
+ this.routeArr = res
},
+ // 澶勭悊涓嬫媺閫夋嫨
handleSelect(item) {
- console.log(item)
- },
- handleInputConfirm2() {
- console.log(this.flagSelect, 111)
- // this.dynamicTags.forEach((item,index) => {
- // if (item === this.flagSelect) {
- // console.log(item, 111)
- // item = this.flagSelect
- // }
- // })
- console.log(this.value)
- this.addDisabled = false
- this.flagSelect = ''
- this.tagValue = ''
- this.flag = !this.flag
- },
- tagEdit(tag) {
- console.log(tag, 2)
-
- this.addDisabled = true
- this.flagSelected = tag.label
- this.tagValue = tag.label
- this.flag = !this.flag
+ this.autocompleteValue = item.value
this.$nextTick(_ => {
- this.$refs['saveTagInput' + tag.id][0].focus()
+ this.$refs['saveTagInput' + this.mouseFocusPosition][0].focus()
})
},
+ // 杈撳叆妗嗙‘璁や簨浠�
+ handleInputConfirm(tag) {
+ console.log(tag, 111)
+ console.log(this.autocompleteValue, 2)
+ // 1.閫夋嫨鍐呭涓嶈兘涓虹┖
+ if (this.autocompleteValue.trim().length < 1) {
+ return this.$message.info('閫夋嫨鍐呭涓嶈兘涓虹┖锛�')
+ }
+ // 2.杈撳叆妗嗗唴瀹逛笌涓嬫媺閫夐」鍐呭涓嶅尮閰�
+ let flag = false
+ this.routeArr.forEach(item => {
+ if (item.stepname === this.autocompleteValue) {
+ flag = true
+ }
+ })
+ if (!flag) {
+ return this.$message.info('杈撳叆妗嗗唴瀹逛笌涓嬫媺閫夐」鍐呭涓嶅尮閰嶏紒')
+ }
+
+ // 灏嗗�兼浛鎹㈠埌鍘焧ag浣嶇疆涓�
+ this.dynamicTags.forEach((item, index) => {
+ if ((index + 1) === tag.seq) {
+ console.log(tag)
+ item.stepname = this.autocompleteValue
+ }
+ item.editDisabled = true
+ })
+ console.log(this.dynamicTags, 234)
+ this.addDisabled = false
+ this.editDisabled = true
+ this.selectedName = ''
+ },
+ // tag鐐瑰嚮淇敼鎸夐挳
+ tagEdit(tag) {
+ console.log(tag, 2)
+ this.autocompleteValue = ''
+ this.dynamicTags.forEach(item => {
+ item.stepname = item.stepname.trim()
+ if (item.seq !== tag.seq) {
+ item.editDisabled = false
+ // return this.$message.info('璇峰厛濉啓鎴栭�夋嫨宸ヨ壓锛�')
+ }
+ })
+ this.addDisabled = true
+ this.selectedName = tag.stepname
+ this.autocompleteValue = tag.stepname
+ this.$nextTick(_ => {
+ this.$refs['saveTagInput' + tag.seq][0].focus()
+ })
+ this.mouseFocusPosition = tag.seq
+ },
+ // tag鐐瑰嚮浜嬩欢
elTagClick(tag) {
console.log(tag, 1)
-
- this.tagSelectedId = tag.id
+ this.clickSelected = tag.seq
if (tag.effect === 'dark') {
tag.effect = 'light'
- this.tagSelectedId = ''
+ this.clickSelected = ''
} else {
this.dynamicTags.forEach(item => {
item.effect = 'light'
@@ -395,46 +438,69 @@
tag.effect = 'light'
}
}
-
console.log(this.$el)
// console.log(this.$el.style.color = 'red')
},
-
- tagClass() {
- // this.tagSelect.style({ backgroundColor: 'red' })
- // return { backgroundColor: 'red' }
- },
+ // 澶勭悊tag鍏抽棴浜嬩欢
handleTagClose(tag) {
- // this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1)
+ console.log(tag)
+
+ // 褰撻�変腑鐨勬楠よ鍒犻櫎鏃�
+ if (tag.seq === this.clickSelected) {
+ this.clickSelected = ''
+ }
this.dynamicTags.forEach((item, index) => {
- if (item.label === tag) {
- console.log(item.label === tag)
+ if (item.seq === tag.seq) {
this.dynamicTags.splice(index, 1)
}
})
+ // 閲嶆柊鎺掑簭
+ this.dynamicTags.forEach((item, index) => {
+ item.editDisabled = true
+ item.seq = index + 1
+ item.stepcode = 'Step' + ((index + 1).toString().length === 2 ? (index + 1) : '0' + (index + 1))
+ })
+ if (this.clickSelected === '') {
+ this.selectedName = ''
+ }
this.addDisabled = false
},
-
+ // tag娣诲姞鎸夐挳
showInput() {
- // this.inputVisible = true
+ this.autocompleteValue = ''
this.addDisabled = true
- if (this.tagSelectedId === '' || this.tagSelectedId === this.dynamicTags.length) {
+ this.editDisabled = false
+ let seq = 0
+ // 1.绗竴绉嶆儏鍐� 褰撴湭閫変腑鎯呭喌涓嬫垨鑰呴�変腑鏈�鍚庝竴涓殑鎯呭喌涓�
+ if (this.clickSelected === '' || this.clickSelected === this.dynamicTags.length) {
+ seq = this.dynamicTags.length + 1
this.dynamicTags.push(
- { id: (this.dynamicTags.length + 1), label: '', effeft: 'light' }
+ { editDisabled: true, seq: seq, stepname: '', effect: 'light', stepcode: ('Step' + (seq.toString().length === 2 ? seq : '0' + seq)) }
)
} else {
- console.log(this.tagSelectedId, 31)
- this.dynamicTags.splice(this.tagSelectedId, 0, { id: this.dynamicTags.length + 1, label: '', effect: 'light' })
+ // 2.绗簩绉嶆儏鍐� 褰撻�変腑鏌愪釜tag 灏嗗湪tag鍚庨潰娣诲姞
+ seq = this.clickSelected + 1
+ this.dynamicTags.splice(this.clickSelected, 0, { editDisabled: true, seq: seq, stepname: '', effect: 'light' })
+ this.dynamicTags.forEach((item, index) => {
+ item.seq = index + 1
+ item.stepcode = 'Step' + ((index + 1).toString().length === 2 ? (index + 1) : '0' + (index + 1))
+ })
}
- this.flag = !this.flag
+
this.$nextTick(_ => {
- this.$refs['saveTagInput' + this.dynamicTags.length][0].focus()
+ this.$refs['saveTagInput' + seq][0].focus()
})
- // this.$nextTick(_ => {
- // console.log(this.$refs['saveTagInput'], 321)
- // this.$refs.saveTagInput.$refs.input.focus()
- // })
+
+ this.mouseFocusPosition = seq
+
+ this.dynamicTags.forEach((item, index) => {
+ item.editDisabled = seq === index + 1
+ })
+
+ console.log(this.dynamicTags, 1)
},
+
+ // 鑾峰彇宸ヨ壓璺嚎鍒楄〃娓呭崟
async getRouteSearch() {
const res = await RouteSearch(this.form)
this.tableData = res.data
@@ -473,26 +539,37 @@
add(operation) {
this.operation = operation
this.dialogVisible = true
+ this.getStepSelectArr()
},
- // 淇敼鎸夐挳
- edit(operation, row) {
+ // 宸ヨ壓璺嚎棰勮
+ async edit(operation, row) {
this.operation = operation
this.dialogVisible = true
+ const { data: res } = await ViewRoute({ routecode: row.code })
+
+ this.dynamicTags = []
this.$nextTick(() => {
- this.dialogForm.OrgCode = row.org_code
- this.dialogForm.OrgName = row.org_name
- this.dialogForm.SupUnit = row.parent_id
+ this.dialogForm.code = res[0].code
+ this.dialogForm.name = res[0].name
+ this.dialogForm.enable = res[0].enable
+ this.dialogForm.description = res[0].description
+ // this.dialogForm.Data = row.description
+ res[0].Data.forEach(item => {
+ this.dynamicTags.push(
+ { seq: item.seq, stepname: item.stepname, stepcode: item.stepcode, editDisabled: true, effect: 'light' }
+ )
+ })
})
},
// 鍒犻櫎鎸夐挳
- async del(id) {
+ async del(row) {
this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- DeleteOrganization({ orgid: id }).then(res => {
+ DeleteRoute({ routecode: row.code }).then(res => {
if (res.code === '200') {
this.$message.success('鍒犻櫎鎴愬姛!')
this.getRouteSearch()
@@ -504,10 +581,14 @@
},
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
- this.dialogForm.OrgType = ''
- this.dialogForm.OrgCode = ''
- this.dialogForm.OrgName = ''
- this.dialogForm.SupUnit = ''
+ this.dialogForm.code = ''
+ this.dialogForm.name = ''
+ this.dialogForm.enable = ''
+ this.dialogForm.description = ''
+ this.dialogForm.Data = []
+ this.dynamicTags = [
+ { editDisabled: true, stepcode: 'Step01', seq: 1, stepname: ' ', effect: 'light' }
+ ]
this.$refs.dialogForm.clearValidate()
},
// 瀵硅瘽妗嗗彇娑�
@@ -516,25 +597,33 @@
},
// 瀵硅瘽妗嗙‘璁�
dialogVisibleConfirm() {
+ if (this.dynamicTags[0].stepname.trim() === '') {
+ return this.$message.info('宸ヨ壓璁剧疆绗竴椤逛笉鑳戒负绌猴紒')
+ }
+ console.log(this.dynamicTags, 3)
+ const Data = []
+ this.dynamicTags.forEach(item => {
+ Data.push({ seq: item.seq, stepcode: item.stepcode, stepname: item.stepname })
+ })
this.$refs.dialogForm.validate(valid => {
if (valid) {
const data = {
- OrganType: this.dialogFormOrgTypeSelected,
- OrganCode: this.dialogForm.OrgCode,
- OrganName: this.dialogForm.OrgName,
- SupUnit: this.dialogFormOrgTypeSelected === 'F' ? '0' : this.dialogForm.SupUnit,
- OperType: this.operation === 'add' ? 'Add' : 'Update',
- Operator: getCookie('admin')
+ code: this.dialogForm.code,
+ name: this.dialogForm.name,
+ enable: this.dialogForm.enable,
+ description: this.dialogForm.description,
+ Data: Data
}
- // AddUpdateOrganization(data).then(res => {
- // if (res.code === '200') {
- // this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
- // this.dialogVisible = false
- // this.getRouteSearch()
- // } else {
- // this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
- // }
- // })
+ console.log(data, 2)
+ AddUpdateRoute(this.dialogForm.id, this.operation === 'add' ? 'Add' : 'Update', data).then(res => {
+ if (res.code === '200') {
+ this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.dialogVisible = false
+ this.getRouteSearch()
+ } else {
+ this.$message.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ }
+ })
}
})
},
@@ -748,7 +837,7 @@
position: absolute;
top: -8px;
z-index: 2;
- left: 91px;
+ left: 141px;
cursor: pointer;
color: #FFFFFF;
border-radius: 50%;
@@ -803,15 +892,21 @@
overflow-x: scroll;
overflow-y: hidden;
align-items: center;
+ background: aliceblue;
}
.elTag {
margin-left: 0;
- width: 100px;
+ width: 150px;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
+.autocompleteClass{
+ .el-autocomplete-suggestion li{
+ //color: red;
+ }
+}
</style>
--
Gitblit v1.9.3