| | |
| | | <el-form-item label="产品名称" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.partcode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | |
| | | @change="partChange" |
| | | > |
| | | <!-- @focus="getPartSelect"--> |
| | | <el-option |
| | | v-for="item in partArr" |
| | | :key="item.partcode" |
| | |
| | | <el-form-item label="工艺路线" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.routecode" |
| | | filterable |
| | | :disabled="form.partcode===''" |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | |
| | | <el-form-item label="关联设备" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.eqpcode" |
| | | filterable |
| | | :disabled="form.stepcode===''" |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | |
| | | prop="RowNum" |
| | | width="50" |
| | | label="序号" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | min-width="160" |
| | | label="产品编码" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="产品名称" |
| | | min-width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | label="产品规格" |
| | | width="110" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="wksp_name" |
| | | label="生产车间" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="route_name" |
| | | label="工艺路线" |
| | | sortable="custom" |
| | | min-width="120" |
| | | /> |
| | | <el-table-column |
| | | prop="stepname" |
| | | label="加工工序" |
| | | sortable="custom" |
| | | min-width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="eqp_name" |
| | | label="加工设备" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | |
| | | |
| | | <el-table-column |
| | | label="操作" |
| | | fixed="right" |
| | | width="120" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | |
| | | <el-dialog |
| | | :title="operation==='add'?'新增':'编辑'" |
| | | :visible.sync="dialogVisible" |
| | | width="1200px" |
| | | top="15vh" |
| | | :fullscreen="isFullscreen" |
| | | width="1000px" |
| | | :top="isIpad?'5vh':'15vh'" |
| | | :close-on-click-modal="false" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | |
| | | <el-select |
| | | v-show="operation==='add'" |
| | | v-model="dialogForm.partcode" |
| | | filterable |
| | | style="width: 220px" |
| | | placeholder="请选择" |
| | | :popper-append-to-body="false" |
| | | |
| | | @change="partDialogChange" |
| | | > |
| | | <!-- @focus="getPartSelect2"--> |
| | | <el-option |
| | | v-for="item in partArr" |
| | | v-for="item in partArr2" |
| | | :key="item.partcode" |
| | | :label="item.partname" |
| | | :value="item.partcode" |
| | |
| | | v-show="operation==='add'" |
| | | v-model="dialogForm.routecode" |
| | | style="width: 220px" |
| | | filterable |
| | | :disabled="dialogForm.partcode===''" |
| | | placeholder="请选择" |
| | | :popper-append-to-body="false" |
| | |
| | | |
| | | <el-table |
| | | :data="eqpDialogArr" |
| | | height="400" |
| | | :height="tableHeight" |
| | | :style="{width: 100+'%',height:tableHeight-50+'px',}" |
| | | border |
| | | stripe |
| | | highlight-current-row |
| | |
| | | prop="eqpcode" |
| | | label="设备编码" |
| | | sortable="custom" |
| | | min-width="110" |
| | | /> |
| | | <el-table-column |
| | | prop="eqpname" |
| | | label="设备名称" |
| | | min-width="110" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="wksp_name" |
| | | sortable="custom" |
| | | label="生产车间" |
| | | min-width="110" |
| | | /> |
| | | <el-table-column |
| | | sortable="custom" |
| | |
| | | :page.sync="eqpTable.page" |
| | | :limit.sync="eqpTable.rows" |
| | | align="right" |
| | | style="padding-top: 20px" |
| | | style="padding-top: 20px;" |
| | | layout="prev, pager, next,sizes" |
| | | popper-class="select_bottom" |
| | | @pagination="getEqpTable" |
| | | /> |
| | | </div> |
| | | <div v-if="eqpTableLength===0" style="width: 100px;height: 84px;" /> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { AddUpdateOrganization, DeleteOrganization } from '@/api/jcsz' |
| | | import { getCookie } from '@/utils/auth' |
| | | import { |
| | | BeatRateSearch, DeleteBeatRate, |
| | | PartSelect, |
| | |
| | | |
| | | const SER_HZ = /^[\u4e00-\u9fa5]+$/ |
| | | export default { |
| | | name: 'Zzjg', |
| | | name: 'JPGJ', |
| | | components: { |
| | | Pagination |
| | | }, |
| | |
| | | } |
| | | } |
| | | return { |
| | | isFullscreen: false, |
| | | isIpad: false, |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | |
| | | rows: 20 // 每页多少条 |
| | | }, |
| | | partArr: [], // 产品集合 |
| | | partArr2: [], // 产品集合对话框 |
| | | routeArr: [], // 产品集合 |
| | | stepArr: [], // 产品集合 |
| | | eqpArr: [], // 产品集合 |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getBeatRateSearch() |
| | | this.getPartSelect() |
| | | this.handleRequest() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | |
| | | handleRequest() { |
| | | this.getBeatRateSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getPartSelect() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | async getBeatRateSearch() { |
| | | const res = await BeatRateSearch(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | return { code: res.code } |
| | | }, |
| | | // 排序改变时 |
| | | sortChange({ column, prop, order }) { |
| | |
| | | async getPartSelect() { |
| | | const { data: res } = await PartSelect() |
| | | this.partArr = res |
| | | }, |
| | | async getPartSelect2() { |
| | | const { data: res } = await PartSelect() |
| | | this.partArr2 = res |
| | | }, |
| | | async partChange(val) { |
| | | const { data: res } = await PartSelectRpute({ partcode: val }) |
| | |
| | | }, |
| | | async partDialogChange(val) { |
| | | const { data: res } = await PartSelectRpute({ partcode: val }) |
| | | console.log(this.routeDialogArr = res, 888) |
| | | this.routeDialogArr = res |
| | | this.stepDialogArr = [] |
| | | this.eqpDialogArr = [] |
| | | }, |
| | | async routeDialogChange(val) { |
| | | const { data: res } = await RouteSelectStep({ routecode: val }) |
| | | this.stepDialogArr = res |
| | | // this.stepDialogArr = [ |
| | | // { code: '1001', name: '测试工序1' }, |
| | | // { code: '1002', name: '测试工序2' }, |
| | | // { code: '1003', name: '测试工序3' }, |
| | | // { code: '1004', name: '测试工序4' }, |
| | | // { code: '1005', name: '测试工序5' }, |
| | | // { code: '1006', name: '测试工序6' }, |
| | | // { code: '1007', name: '测试工序7' }, |
| | | // { code: '1008', name: '测试工序8' }, |
| | | // { code: '1009', name: '测试工序9' } |
| | | // ] |
| | | this.eqpDialogArr = [] |
| | | }, |
| | | radioChange(val) { |
| | | this.isEqpTableEdit = true |
| | | |
| | | // this.dialogForm.stepcode = this.stepDialogArr.find(item => item.name === val).code |
| | | this.getEqpTable(val) |
| | | }, |
| | |
| | | cavity_qty: row.cavity_qty, // 型腔数 |
| | | unprice: row.unprice// 计件单价 |
| | | } |
| | | console.log(data, 7) |
| | | |
| | | // row.isVisible = 0 |
| | | const res = await SaveBeatRate(data) |
| | | if (res.code === '200') { |
| | |
| | | }, |
| | | // 复制行 |
| | | async copyRow(row) { |
| | | console.log(row) |
| | | let currentData = {}// 当前行对象 |
| | | let nextData = {}// 下一行对象 |
| | | if (row.RowNum === this.eqpDialogArr.length) { |
| | |
| | | } |
| | | }) |
| | | } |
| | | console.log(currentData, 2) |
| | | console.log(nextData, 3) |
| | | const newData = { |
| | | partcode: this.eqpTable.partcode, // 产品编码 |
| | | routecode: this.eqpTable.routecode, // 工艺路线编码 |
| | |
| | | cavity_qty: currentData.cavity_qty, // 型腔数 |
| | | unprice: currentData.unprice// 计件单价 |
| | | } |
| | | console.log(newData, 4) |
| | | |
| | | const res = await SaveBeatRate(newData) |
| | | if (res.code === '200') { |
| | | this.$message.success('复制成功!') |
| | |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.getPartSelect2() |
| | | }, |
| | | // 修改按钮 |
| | | async edit(operation, row) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | console.log(row) |
| | | |
| | | this.editPartName = row.partname |
| | | this.editRouteName = row.route_name |
| | |
| | | this.dialogForm.stand_value = '' |
| | | this.dialogForm.cavity_qty = '' |
| | | this.dialogForm.unprice = '' |
| | | this.eqpTableLength = 0 |
| | | this.routeDialogArr = [] |
| | | this.stepDialogArr = [] |
| | | this.eqpDialogArr = [] |
| | |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 250 |
| | | this.tableHeight = this.mainHeight - 100 |
| | | this.isFullscreen = window.innerHeight < 800 |
| | | this.tableHeight = this.mainHeight - 50 |
| | | if (window.innerHeight < 769) { |
| | | this.tableHeight = this.tableHeight - 50 |
| | | } |
| | | this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367 |
| | | }) |
| | | } |
| | | } |