| | |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="所属车间" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.WorkShop" |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <!-- @focus="getWareHouseSelect"--> |
| | | <el-option |
| | | v-for="item in WorkShopArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="工艺路线编码" style=" display: flex;"> |
| | | <el-input v-model="form.routecode" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="工艺描述" style=" display: flex;"> |
| | | <el-input v-model="form.description" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="创建人员" style=" display: flex;"> |
| | | <el-form-item v-show="isExpandForm" label="创建人员" style=" display: flex;"> |
| | | <el-input v-model="form.createuser" style="width: 200px" placeholder="请输入" /> |
| | | </el-form-item> |
| | | </div> |
| | |
| | | </el-form> |
| | | <div |
| | | class="bodyTopFormExpand" |
| | | /> |
| | | > |
| | | <svg-icon |
| | | v-show="mouseHoverType==='mouseout'" |
| | | style="cursor: pointer" |
| | | :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'" |
| | | @mouseenter="mouseHoverType=$event.type" |
| | | /> |
| | | <svg-icon |
| | | v-show="mouseHoverType==='mouseenter'" |
| | | style="cursor: pointer" |
| | | :icon-class="!isExpandForm?'doubleDown':'doubleUp'" |
| | | @click="isExpandForm=!isExpandForm" |
| | | @mouseout="mouseHoverType=$event.type" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | |
| | | :key="tableTimeStampKey" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="tableHeight" |
| | | :height="isExpandForm?tableHeight:(tableHeight+40)+'px'" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getRouteSearch" |
| | | /> |
| | |
| | | /> |
| | | </el-form-item> |
| | | </div> |
| | | <div style="display: flex"> |
| | | <el-form-item prop="wkshopcode" label="所属车间" style="margin-right: 20px"> |
| | | <el-select |
| | | v-model="dialogForm.wkshopcode" |
| | | filterable |
| | | :disabled="operation==='edit'" |
| | | :popper-append-to-body="false" |
| | | style="width: 220px" |
| | | placeholder="请选择" |
| | | @change="wkshopcodeChange" |
| | | > |
| | | <el-option |
| | | v-for="item in WorkShopArr" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | </div> |
| | | |
| | | <el-form-item label="工艺设置" prop="Data" style="margin-top: 30px"> |
| | | <div class="settingDiv"> |
| | | <!-- 实现工艺设置动态添加--> |
| | | <div v-for="(tag,index) in dynamicTags" :key="tag.seq" style="display: flex;align-items: center"> |
| | | <!-- v-if="false"--> |
| | | <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" |
| | |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import TableColumnSettings from '@/components/TableColumnSettings' |
| | | import { WorkShopSelect } from '@/api/deviceManager' |
| | | import { getCookie } from '@/utils/auth' |
| | | |
| | | export default { |
| | | name: 'GYLX', |
| | |
| | | data() { |
| | | return { |
| | | isIpad: false, |
| | | mouseHoverType: 'mouseout', |
| | | isExpandForm: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | routecode: '', // 工艺路线编码 |
| | | routename: '', // 工艺路线名称 |
| | | description: '', // 工艺路线描述 |
| | | WorkShop: this.$store.state.settings.orgType !== 'W' ? '' : getCookie('stu_torgcode'), // 所属车间 |
| | | createuser: '', // 创建人员 |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | |
| | | { label: '是', value: 'Y' }, |
| | | { label: '否', value: 'N' } |
| | | ], |
| | | WorkShopArr: [], // 所属车间数组 |
| | | total: 10, |
| | | tableData: [], |
| | | tableColumnSettingsArray: [ |
| | |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'org_code', |
| | | label: '所属车间编码', |
| | | id: 7, |
| | | show: false, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'org_name', |
| | | label: '所属车间', |
| | | id: 8, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | | }, |
| | | { |
| | | minWidth: 110, |
| | | width: false, |
| | | prop: 'lm_user', |
| | | label: '创建人员', |
| | | id: 7, |
| | | id: 9, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | |
| | | width: false, |
| | | prop: 'lm_date', |
| | | label: '创建时间', |
| | | id: 8, |
| | | id: 10, |
| | | show: true, |
| | | fixed: false, |
| | | sortable: true |
| | |
| | | name: '', |
| | | enable: 'Y', |
| | | description: '', |
| | | wkshopcode: this.$store.state.settings.orgType !== 'W' ? '' : getCookie('stu_torgcode'), // 所属车间 |
| | | Data: [] |
| | | }, |
| | | dynamicTags: [// 工艺设置数组 |
| | |
| | | ], |
| | | enable: [ |
| | | { required: true, message: '请选择使用状态', trigger: ['blur', 'change'] } |
| | | ], |
| | | wkshopcode: [ |
| | | { required: true, message: '请选择所属车间', trigger: ['blur', 'change'] } |
| | | ] |
| | | // Data: [ |
| | | // { required: true, message: '请设置工艺', trigger: ['blur', 'change'] } |
| | |
| | | }, |
| | | created() { |
| | | this.getRouteSearch() |
| | | this.getWorkShopSelect() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // 获取所属车间下拉 |
| | | async getWorkShopSelect() { |
| | | const { data: res } = await WorkShopSelect() |
| | | this.WorkShopArr = res |
| | | }, |
| | | tableColumnUpdate(val, isCopyTrue) { |
| | | if (isCopyTrue) { |
| | | this.tableColumnSettingsArray = val |
| | |
| | | return (res.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1) |
| | | } |
| | | }, |
| | | wkshopcodeChange() { |
| | | this.getStepSelectArr() |
| | | }, |
| | | // 工艺设置 下拉获取所有 |
| | | async getStepSelectArr() { |
| | | const { data: res } = await StepSelect() |
| | | const { data: res } = await StepSelect({ WorkShop: this.dialogForm.wkshopcode }) |
| | | this.routeArr = res |
| | | }, |
| | | // 处理下拉选择 |
| | |
| | | }, |
| | | // tag点击修改按钮 |
| | | tagEdit(tag) { |
| | | if (!this.dialogForm.wkshopcode) { |
| | | return this.$message.info('请先选择所属车间!') |
| | | } |
| | | if (this.routeArr.length === 0) { |
| | | return this.$message.info('该车间未设置工序!') |
| | | } |
| | | |
| | | this.autocompleteValue = '' |
| | | this.dynamicTags.forEach(item => { |
| | | item.stepname = item.stepname.trim() |
| | |
| | | this.form.routename = '' |
| | | this.form.description = '' |
| | | this.form.createuser = '' |
| | | this.form.WorkShop = this.$store.state.settings.orgType !== 'W' ? '' : getCookie('stu_torgcode') // 所属车间 |
| | | this.getRouteSearch() |
| | | }, |
| | | |
| | |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.getStepSelectArr() |
| | | |
| | | if (this.$store.state.settings.orgType === 'W') { |
| | | this.getStepSelectArr() |
| | | } |
| | | }, |
| | | // 工艺路线预览 |
| | | async edit(operation, row) { |
| | |
| | | this.dialogForm.name = res[0].name |
| | | this.dialogForm.enable = res[0].enable |
| | | this.dialogForm.description = res[0].description |
| | | this.dialogForm.wkshopcode = res[0].wkshopcode |
| | | |
| | | // this.dialogForm.Data = row.description |
| | | res[0].Data.forEach(item => { |
| | | this.dynamicTags.push( |
| | |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | |
| | | await this.getStepSelectArr() |
| | | if (this.$store.state.settings.orgType === 'W') { |
| | | await this.getStepSelectArr() |
| | | } |
| | | |
| | | const { data: res } = await ViewRoute({ routecode: row.code }) |
| | | // 待改 |
| | | this.dynamicTags = [] |
| | |
| | | this.dialogForm.name = res[0].name |
| | | this.dialogForm.enable = res[0].enable |
| | | this.dialogForm.description = res[0].description |
| | | this.dialogForm.wkshopcode = res[0].wkshopcode |
| | | res[0].Data.forEach((item, index) => { |
| | | this.dynamicTags.push( |
| | | { seq: item.seq, stepname: item.stepname, stepcode: item.stepcode, editDisabled: true, effect: index === res[0].Data.length - 1 ? 'dark' : 'light' } |
| | |
| | | this.dialogForm.name = '' |
| | | this.dialogForm.enable = 'Y' |
| | | this.dialogForm.description = '' |
| | | this.dialogForm.wkshopcode = this.$store.state.settings.orgType !== 'W' ? '' : getCookie('stu_torgcode'), // 所属车间 |
| | | this.dialogForm.Data = [] |
| | | |
| | | this.dynamicTags = [ |
| | |
| | | name: this.dialogForm.name, |
| | | enable: this.dialogForm.enable, |
| | | description: this.dialogForm.description, |
| | | wkshopcode: this.dialogForm.wkshopcode, |
| | | Data: Data |
| | | } |
| | | |
| | |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 195 |
| | | this.tableHeight = this.mainHeight - 255 |
| | | if (window.innerHeight < 769) { |
| | | this.tableHeight = this.tableHeight - 40 |
| | | } |