| | |
| | | :visible.sync="dialogVisible" |
| | | width="1260px" |
| | | :close-on-click-modal="false" |
| | | top="5vh" |
| | | top="2vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | |
| | | prop="suitpart" |
| | | :label="dialogForm.suitobject==='P'?'适用物料':'适用物料类别'" |
| | | > |
| | | <el-select |
| | | v-model="dialogForm.suitpart" |
| | | style="width: 200px" |
| | | multiple |
| | | filterable |
| | | collapse-tags |
| | | placeholder="请选择" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="item in PartSelectArr" |
| | | v-if="dialogForm.suitobject==='P'" |
| | | :key="item.partcode" |
| | | :label="item.partcode +' / '+ item.partname" |
| | | :value="item.partcode" |
| | | /> |
| | | <el-option |
| | | v-for="item in StockTypeSelectArr" |
| | | v-if="dialogForm.suitobject==='PY'" |
| | | :key="item.code" |
| | | :label="item.code+' / '+item.name" |
| | | :value="item.code" |
| | | /> |
| | | </el-select> |
| | | <el-button |
| | | v-if="dialogForm.suitobject==='P'" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="selectSuitpart" |
| | | >选择物料</el-button> |
| | | <el-button |
| | | v-if="dialogForm.suitobject==='PY'" |
| | | v-waves |
| | | type="primary" |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="selectSuitpart" |
| | | >选择物料类别</el-button> |
| | | <div> |
| | | 已选择{{ dialogForm.suitpart.length }}个{{ dialogForm.suitobject==='P'?'物料':'物料类别' }} |
| | | </div> |
| | | |
| | | <!-- <el-select--> |
| | | <!-- v-model="dialogForm.suitpart"--> |
| | | <!-- style="width: 200px"--> |
| | | <!-- multiple--> |
| | | <!-- filterable--> |
| | | <!-- collapse-tags--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- :popper-append-to-body="false"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in PartSelectArr"--> |
| | | <!-- v-if="dialogForm.suitobject==='P'"--> |
| | | <!-- :key="item.partcode"--> |
| | | <!-- :label="item.partcode +' / '+ item.partname"--> |
| | | <!-- :value="item.partcode"--> |
| | | <!-- />--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in StockTypeSelectArr"--> |
| | | <!-- v-if="dialogForm.suitobject==='PY'"--> |
| | | <!-- :key="item.code"--> |
| | | <!-- :label="item.code+' / '+item.name"--> |
| | | <!-- :value="item.code"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | </el-form-item> |
| | | <br> |
| | | <el-form-item |
| | |
| | | </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 v-if="dialogForm.suitobject==='P'" 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" |
| | | @sort-change="sortChange" |
| | | @select="handleSelectionChange" |
| | | @select-all="handleAllChange" |
| | | > |
| | | |
| | | <el-table-column |
| | | type="selection" |
| | | width="50" |
| | | :reserve-selection="true" |
| | | fixed |
| | | /> |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="70" |
| | | fixed |
| | | label="序号" |
| | | /> |
| | | <el-table-column |
| | | prop="partcode" |
| | | label="存货编码" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="partname" |
| | | label="存货名称" |
| | | sortable="custom" |
| | | show-tooltip-when-overflow |
| | | min-width="200" |
| | | /> |
| | | <el-table-column |
| | | prop="partspec" |
| | | label="规格型号" |
| | | |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | {{ row.partspec ? row.partspec : '/' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="idinventoryclassname" |
| | | label="所属类别" |
| | | sortable="custom" |
| | | /> |
| | | |
| | | </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> |
| | | <div v-if="dialogForm.suitobject==='PY'"> |
| | | <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" |
| | | show-checkbox |
| | | :default-checked-keys="dialogForm.suitpart" |
| | | /> |
| | | </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> |
| | | |
| | |
| | | QualityInspectionSearch, QualityInspectionSeeEdit, QualityStepCheckItemSelect |
| | | } from '@/api/QualityManagement' |
| | | import TableColumnSettings from '@/components/TableColumnSettings' |
| | | import { PartSelect, TMaterielClassTree } from '@/api/ProductModel' |
| | | import { PartSelect, TMaterielClassTree, TMaterielData } from '@/api/ProductModel' |
| | | import { StepData } from '@/api/GeneralBasicData' |
| | | import arrayToTree from 'array-to-tree' |
| | | |
| | | export default { |
| | | name: 'QualityPlaning', |
| | |
| | | CheckItemSelectArr: [], // 检验项目 |
| | | StepSelectArr: [], // 工序名称下拉所有 |
| | | |
| | | isCancel: true// 是否可取消 |
| | | isCancel: true, // 是否可取消 |
| | | |
| | | 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 |
| | | |
| | | } |
| | | }, |
| | |
| | | if (res.code === '200') { |
| | | // this.getUomSelect() |
| | | this.getStepCheckItemSelect() |
| | | this.getPartSelect() |
| | | this.getStockTypeSelect() |
| | | // this.getPartSelect() |
| | | // this.getStockTypeSelect() |
| | | this.getStepSelect() |
| | | this.getTMaterielClassTree() |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | // 物料下拉 |
| | | async getPartSelect() { |
| | | const { data: res } = await PartSelect() |
| | | this.PartSelectArr = res |
| | | // const { data: res } = await PartSelect() |
| | | // this.PartSelectArr = res |
| | | }, |
| | | // 物料类别下拉 |
| | | async getStockTypeSelect() { |
| | | const { data: res } = await TMaterielClassTree() |
| | | this.StockTypeSelectArr = res |
| | | // const { data: res } = await TMaterielClassTree() |
| | | // this.StockTypeSelectArr = res |
| | | }, |
| | | |
| | | // 适用对象值改变是 |
| | | suitobjectChange() { |
| | | this.dialogForm.suitpart = [] |
| | | }, |
| | | /* |
| | | * 选择物料或者物料类别弹出框 |
| | | * */ |
| | | // |
| | | selectSuitpart() { |
| | | this.dialogVisibleSuitobject = true |
| | | |
| | | if (this.dialogForm.suitobject === 'P') { // 物料 |
| | | this.$nextTick(() => { |
| | | this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | }) |
| | | } else { // //物料类别 |
| | | // this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | } |
| | | }, |
| | | |
| | | handleCloseSuitobject() { |
| | | this.suitobjectForm = { |
| | | inventoryclasscode: '', |
| | | partcode: '', |
| | | partname: '', |
| | | partspec: '', |
| | | page: 1, |
| | | rows: 20, |
| | | prop: 'lm_date', // 排序字段 |
| | | order: 'desc' // 排序字段 |
| | | } |
| | | }, |
| | | |
| | | dialogVisibleCancelSuitobject() { |
| | | this.dialogVisibleSuitobject = false |
| | | }, |
| | | |
| | | dialogVisibleConfirmSuitobject() { |
| | | // console.log(this.$refs.treeLeftRef.getCheckedKeys()) |
| | | if (this.dialogForm.suitobject === 'P') { // 物料 |
| | | |
| | | } else { // //物料类别 |
| | | this.dialogForm.suitpart = this.$refs.treeLeftRef.getCheckedKeys() |
| | | } |
| | | this.dialogVisibleSuitobject = false |
| | | }, |
| | | |
| | | // 这里是做单项选择与单项反选的 选择:打勾或取消 |
| | | handleSelectionChange(selected, row) { |
| | | if (selected.length > 0) { |
| | | if (selected.map(i => i.partcode).includes(row.partcode)) { // 说明是新增 |
| | | this.dialogForm.suitpart.push(row.partcode) |
| | | } else { // 说明是取消 |
| | | this.dialogForm.suitpart = this.dialogForm.suitpart.filter(i => i !== row.partcode) |
| | | } |
| | | } |
| | | }, |
| | | // 全选、取消全选(原理同上面的单选) |
| | | handleAllChange(selected) { |
| | | console.log(selected) |
| | | |
| | | if (selected.length > 0) { // 代表从不全选到全选 |
| | | this.dialogForm.suitpart = [...new Set([...this.dialogForm.suitpart, ...selected.map(i => i.partcode)])] |
| | | } else { // 代表从全选到 全不选 |
| | | this.dialogForm.suitpart = this.dialogForm.suitpart.filter(item => !this.suitobjectTableData.map(i => i.partcode).includes(item)) |
| | | } |
| | | }, |
| | | |
| | | 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' |
| | | }) |
| | | // this.$nextTick(() => { |
| | | // this.$refs.treeLeftRef.setCurrentKey('-1') |
| | | // console.log(this.$refs.treeLeftRef.getCurrentNode()) |
| | | // this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode()) |
| | | // }) |
| | | }, |
| | | |
| | | 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 |
| | | |
| | | const selectedKeys = this.dialogForm.suitpart |
| | | this.$refs.tableDataRef3.clearSelection() // 清空当前选择,避免重复选择问题 |
| | | this.suitobjectTableData.forEach(row => { |
| | | if (selectedKeys.includes(row.partcode)) { |
| | | this.$refs.tableDataRef3.toggleRowSelection(row, true) |
| | | } |
| | | }) |
| | | |
| | | 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 |
| | | }, |
| | | |
| | | // 获取检验项目下拉接口 |
| | | async getStepCheckItemSelect() { |
| | | const { data: res } = await QualityStepCheckItemSelect() |