| | |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="产品名称/编码" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.partcode" |
| | | filterable |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | <el-form-item label="产品编码" style=" display: flex;"> |
| | | |
| | | @change="partChange" |
| | | > |
| | | <!-- @focus="getPartSelect"--> |
| | | <el-option |
| | | v-for="item in partArr" |
| | | :key="item.partcode" |
| | | :label="item.partname+'/'+item.partcode" |
| | | :value="item.partcode" |
| | | /> |
| | | </el-select> |
| | | <el-input v-model="form.partcode" placeholder="请输入" style="width: 200px" /> |
| | | |
| | | <!-- <el-select--> |
| | | <!-- v-model="form.partcode"--> |
| | | <!-- filterable--> |
| | | <!-- :popper-append-to-body="false"--> |
| | | <!-- style="width: 200px"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- @change="partChange"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in partArr"--> |
| | | <!-- :key="item.partcode"--> |
| | | <!-- :label="item.partname+'/'+item.partcode"--> |
| | | <!-- :value="item.partcode"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" style=" display: flex;"> |
| | | <el-input v-model="form.partname" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="规格型号" style=" display: flex;"> |
| | | <el-input v-model="form.partspec" placeholder="请输入" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-if="mesSetting.route" |
| | | label="工艺路线" |
| | | style="display: flex;" |
| | | > |
| | | <el-select |
| | | v-model="form.routecode" |
| | | filterable |
| | | :disabled="form.partcode===''" |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | @change="routeChange" |
| | | > |
| | | <el-option |
| | | v-for="item in routeArr" |
| | | :key="item.route_code" |
| | | :label="item.route_name" |
| | | :value="item.route_code" |
| | | /> |
| | | </el-select> |
| | | <el-input v-model="form.routename" placeholder="请输入" style="width: 200px" /> |
| | | <!-- <el-select--> |
| | | <!-- v-model="form.routecode"--> |
| | | <!-- filterable--> |
| | | <!-- :disabled="form.partcode===''"--> |
| | | <!-- :popper-append-to-body="false"--> |
| | | <!-- style="width: 200px"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- @change="routeChange"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in routeArr"--> |
| | | <!-- :key="item.route_code"--> |
| | | <!-- :label="item.route_name"--> |
| | | <!-- :value="item.route_code"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | </el-form-item> |
| | | <el-form-item label="关联工序" style=" display: flex;"> |
| | | <el-select |
| | | v-model="form.stepcode" |
| | | :disabled="mesSetting.route?form.routecode==='':form.partcode===''" |
| | | :popper-append-to-body="false" |
| | | style="width: 200px" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in stepArr" |
| | | :key="item.step_code" |
| | | :label="item.step_name" |
| | | :value="item.step_code" |
| | | /> |
| | | </el-select> |
| | | <el-form-item v-show="isExpandForm" label="工序名称" style=" display: flex;"> |
| | | <el-input v-model="form.stepname" placeholder="请输入" style="width: 200px" /> |
| | | <!-- <el-select--> |
| | | <!-- v-model="form.stepcode"--> |
| | | <!-- :disabled="mesSetting.route?form.routecode==='':form.partcode===''"--> |
| | | <!-- :popper-append-to-body="false"--> |
| | | <!-- style="width: 200px"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in stepArr"--> |
| | | <!-- :key="item.step_code"--> |
| | | <!-- :label="item.step_name"--> |
| | | <!-- :value="item.step_code"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | </el-form-item> |
| | | |
| | | <!--按工序--> |
| | |
| | | </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="tableTimeStampArrayKey" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="tableHeight" |
| | | :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}" |
| | | border |
| | | :row-class-name="tableRowClassName" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | :height="isExpandForm?tableHeight:(tableHeight+40)+'px'" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | |
| | | <div v-else-if="item.prop==='eqp_value'||item.prop==='stand_value'"> |
| | | {{ row[item.prop] }} 秒 |
| | | </div> |
| | | <div v-else-if="item.prop==='unprice'">{{ row[item.prop] }}</div> |
| | | <div v-else>{{ row[item.prop] }}</div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | |
| | | <el-form ref="dialogForm" inline :model="dialogForm" label-width="100px"> |
| | | <div style="display: flex;align-items: center"> |
| | | <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" style="margin-top: -20px" /> |
| | | <el-form-item prop="partcode" label="产品名称/编码"> |
| | | <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 partArr2" |
| | | :key="item.partcode" |
| | | :label="item.partname+'/'+item.partcode" |
| | | :value="item.partcode" |
| | | /> |
| | | </el-select> |
| | | <el-input |
| | | v-show="operation!=='add'" |
| | | v-model="editPartName" |
| | | disabled |
| | | style="width: 220px" |
| | | /> |
| | | <el-button |
| | | v-if="operation==='add'" |
| | | v-waves |
| | | type="primary" |
| | | style="width: 200px" |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="selectSuitpart" |
| | | >选择物料 |
| | | </el-button> |
| | | |
| | | <!-- <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 partArr2"--> |
| | | <!-- :key="item.partcode"--> |
| | | <!-- :label="item.partname+'/'+item.partcode"--> |
| | | <!-- :value="item.partcode"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- <el-input--> |
| | | <!-- v-show="operation!=='add'"--> |
| | | <!-- v-model="editPartName"--> |
| | | <!-- disabled--> |
| | | <!-- style="width: 220px"--> |
| | | <!-- />--> |
| | | </el-form-item> |
| | | <div v-if="dialogForm.partcode.toString().trim().length>0" style="height: 34px;"> |
| | | {{ operation=='add'?"已选择":"" }} {{ dialogForm.partcode }} {{ dialogForm.partname }} |
| | | </div> |
| | | <el-form-item v-if="mesSetting.route" prop="routecode" label="工艺路线"> |
| | | <el-select |
| | | v-show="operation==='add'" |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!--选择物料--> |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="dialogForm.suitobject==='P'?'选择物料':'选择物料类别'" |
| | | :visible.sync="dialogVisibleSuitobject" |
| | | width="1460px" |
| | | :close-on-click-modal="false" |
| | | top="5vh" |
| | | @closed="handleCloseSuitobject" |
| | | @close="handleCloseSuitobject" |
| | | > |
| | | |
| | | <div style="display: flex"> |
| | | <div style="width: 300px;margin-right: 20px;background:#fff"> |
| | | |
| | | <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;"> |
| | | <div style="display: flex;"> |
| | | <div |
| | | style="width: 5px;height: 100%;border-radius: 5px;" |
| | | :style="{background:$store.state.settings.theme}" |
| | | /> |
| | | <div style="margin-left: 8px;">存货档案</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-tree |
| | | ref="treeLeftRef" |
| | | style="padding: 10px;overflow: auto;height: 600px;" |
| | | :data="treeLeft" |
| | | node-key="code" |
| | | highlight-current |
| | | :props="defaultPropsLeft" |
| | | :default-expand-all="true" |
| | | :expand-on-click-node="false" |
| | | @node-click="getTMaterielData" |
| | | /> |
| | | </div> |
| | | <div |
| | | style=" width:calc(100% - 300px);" |
| | | > |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="suitobjectForm" |
| | | :model="suitobjectForm" |
| | | label-width="80px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="存货编码" style=" display: flex;"> |
| | | <el-input |
| | | v-model="suitobjectForm.partcode" |
| | | placeholder="请输入" |
| | | :style="{minWidth:'100px',width:150+'px'}" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="存货名称" style=" display: flex;"> |
| | | <el-input |
| | | v-model="suitobjectForm.partname" |
| | | placeholder="请输入" |
| | | :style="{minWidth:'100px',width:150+'px'}" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="存货规格" style=" display: flex;"> |
| | | <el-input |
| | | v-model="suitobjectForm.partspec" |
| | | placeholder="请输入" |
| | | :style="{minWidth:'100px',width:150+'px'}" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | </div> |
| | | <div class="bodySearchReset"> |
| | | <el-button |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | @click="getTMaterielData($refs.treeLeftRef.getCurrentNode())" |
| | | >查询 |
| | | </el-button> |
| | | <el-button |
| | | v-waves |
| | | type="info" |
| | | icon="el-icon-refresh" |
| | | @click="resetSuitobject" |
| | | >重置 |
| | | </el-button> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef3" |
| | | class="tableFixed" |
| | | :data="suitobjectTableData" |
| | | height="520" |
| | | border |
| | | row-class-name="custom-row" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | row-key="partcode" |
| | | @row-click="rowClick2" |
| | | > |
| | | |
| | | <el-table-column |
| | | width="50" |
| | | fixed |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-radio |
| | | v-model="dialogForm.partcode" |
| | | :label="row.partcode" |
| | | style="color: transparent;padding-left: 10px;" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="70" |
| | | fixed |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="存货编码" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="存货名称" |
| | | show-tooltip-when-overflow |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | label="规格型号" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="idinventoryclassname" |
| | | label="所属类别" |
| | | /> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!--分页--> |
| | | <pagination |
| | | :total="suitobjectTotal" |
| | | :page.sync="suitobjectForm.page" |
| | | :limit.sync="suitobjectForm.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getTMaterielData($refs.treeLeftRef.getCurrentNode())" |
| | | /> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancelSuitobject">返 回</el-button> |
| | | <el-button |
| | | v-waves |
| | | :loading="$store.state.app.buttonIsDisabled" |
| | | :disabled="$store.state.app.buttonIsDisabled" |
| | | type="primary" |
| | | @click="dialogVisibleConfirmSuitobject" |
| | | >确 认</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import TableColumnSettings from '@/components/TableColumnSettings' |
| | | |
| | | import { TMaterielClassTree, TMaterielData } from '@/api/ProductModel' |
| | | import arrayToTree from 'array-to-tree' |
| | | export default { |
| | | name: 'MeterPrice', |
| | | components: { |
| | |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mouseHoverType: 'mouseout', |
| | | isExpandForm: false, |
| | | mesSetting: JSON.parse(localStorage.getItem('mesSetting')), |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | partcode: '', // 产品编码 |
| | | routecode: '', // 工艺路线编码 |
| | | stepcode: '', // 工序编码 |
| | | partname: '', |
| | | partspec: '', |
| | | routename: '', // 工艺路线编码 |
| | | stepname: '', // 工序编码 |
| | | |
| | | prop: 'partcode', // 排序字段 |
| | | order: 'desc', // 排序字段 |
| | |
| | | editPartName: '', // 编辑时产品名称 |
| | | editRouteName: '', // 编辑时工艺路线名称 |
| | | editStepName: '', // 编辑时加工工序名称 |
| | | operation: '' |
| | | operation: '', |
| | | |
| | | dialogVisibleSuitobject: false, |
| | | treeLeft: [ |
| | | { |
| | | code: '-1', |
| | | name: '全部' |
| | | } |
| | | ], // 左侧树 |
| | | treeLeftArr: [], |
| | | defaultPropsLeft: { |
| | | children: 'children', |
| | | label: 'name' |
| | | }, |
| | | |
| | | suitobjectTableData: [], |
| | | suitobjectForm: { |
| | | inventoryclasscode: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | page: 1, |
| | | rows: 20, |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc' // 排序字段 |
| | | }, |
| | | suitobjectTotal: 0 |
| | | |
| | | } |
| | | }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | selectSuitpart() { |
| | | this.dialogVisibleSuitobject = true |
| | | this.$nextTick(() => { |
| | | this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | }) |
| | | }, |
| | | handleCloseSuitobject() { |
| | | this.suitobjectForm = { |
| | | inventoryclasscode: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | page: 1, |
| | | rows: 20, |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc' // 排序字段 |
| | | } |
| | | }, |
| | | dialogVisibleCancelSuitobject() { |
| | | this.dialogVisibleSuitobject = false |
| | | }, |
| | | |
| | | async dialogVisibleConfirmSuitobject() { |
| | | await this.partDialogChange(this.dialogForm.partcode) |
| | | this.dialogVisibleSuitobject = false |
| | | }, |
| | | |
| | | rowClick2(row, event, column) { |
| | | this.dialogForm.partcode = row.partcode |
| | | this.dialogForm.partname = this.suitobjectTableData.find(i => i.partcode === row.partcode).partname |
| | | // this.dialogForm.partspec = this.partcodeArr.find(i => i.partcode === row.partcode).partspec |
| | | }, |
| | | |
| | | resetSuitobject() { |
| | | this.suitobjectForm.inventoryclasscode = '' |
| | | this.suitobjectForm.partcode = '' |
| | | this.suitobjectForm.partname = '' |
| | | this.suitobjectForm.partspec = '' |
| | | this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | }, |
| | | async getTMaterielClassTree() { |
| | | const res = await TMaterielClassTree() |
| | | res.data.forEach(i => { |
| | | i.idparent = i.idparent ? i.idparent : '-1' |
| | | }) |
| | | this.treeLeftArr = res.data |
| | | this.treeLeftArr.forEach(e => { |
| | | e.name = e.code + ' ' + e.name |
| | | }) |
| | | this.treeLeft = arrayToTree(this.treeLeft.concat(res.data), { |
| | | parentProperty: 'idparent', |
| | | customID: 'code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | }, |
| | | async getTMaterielData(node) { |
| | | const result = this.getChildrenCodeMethod(node, []) |
| | | if (result.includes('-1')) { |
| | | result.shift() |
| | | } |
| | | this.suitobjectForm.inventoryclasscode = result.join(',') |
| | | const res = await TMaterielData(this.suitobjectForm) |
| | | |
| | | this.suitobjectTableData = res.data |
| | | this.suitobjectTotal = res.count |
| | | |
| | | this.$nextTick(() => { |
| | | this.$refs.tableDataRef3.doLayout() |
| | | }) |
| | | }, |
| | | // 递归取子集的所有code |
| | | getChildrenCodeMethod(node, result) { |
| | | result.push(node.code) |
| | | if (node.children && node.children.length > 0) { |
| | | node.children.forEach(i => { |
| | | this.getChildrenCodeMethod(i, result) |
| | | }) |
| | | } |
| | | return result |
| | | }, |
| | | |
| | | tableColumnUpdate(val, isCopyTrue) { |
| | | if (isCopyTrue) { |
| | | this.tableColumnSettingsArray = val |
| | |
| | | this.getBeatRateSearch().then(res => { |
| | | if (res.code === '200') { |
| | | this.getPartSelect() |
| | | this.getTMaterielClassTree() |
| | | } |
| | | }) |
| | | }, |
| | |
| | | // 重置 |
| | | reset() { |
| | | this.form.partcode = '' |
| | | this.form.routecode = '' |
| | | this.form.stepcode = '' |
| | | this.form.partname = '' |
| | | this.form.partspec = '' |
| | | this.form.routename = '' |
| | | this.form.stepname = '' |
| | | |
| | | this.getBeatRateSearch() |
| | | }, |
| | | async partDialogChange(val) { |
| | |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | |
| | | this.editPartName = row.partname |
| | | this.dialogForm.partname = row.partname |
| | | this.editRouteName = row.route_name |
| | | this.editStepName = row.stepname |
| | | |
| | |
| | | this.stepDialogArr = [] |
| | | |
| | | this.$refs.dialogForm.clearValidate() |
| | | this.getBeatRateSearch() |
| | | // this.getBeatRateSearch() |
| | | }, |
| | | // 对话框取消 |
| | | dialogVisibleCancel() { |
| | |
| | | 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 |
| | | } |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .elTableDiv { |
| | | ::v-deep .el-radio__label { |
| | | display: none !important; |
| | | } |
| | | } |
| | | </style> |
| | | |
| | | <style> |
| | | .el-table .custom-row { |
| | | background: #f8f8fa; |