| | |
| | | /* |
| | | * @Date: 2025-06-17 15:22:15 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-06-17 15:23:02 |
| | | * @LastEditTime: 2025-06-17 19:32:43 |
| | | * @FilePath: /mdmweb/src/api/basesetting/produceplan.js |
| | | */ |
| | | import request from '@/axios'; |
| | |
| | | size, |
| | | }, |
| | | }); |
| | | }; |
| | | export const remove = params => { |
| | | return request({ |
| | | url: '/blade-mdm/producedivision/remove', |
| | | method: 'post', |
| | | params |
| | | }); |
| | | }; |
| | | export const save = params => { |
| | | return request({ |
| | | url: 'blade-mdm/producedivision/save', |
| | | method: 'post', |
| | | data:params |
| | | }); |
| | | }; |
| | | export const update = params => { |
| | | return request({ |
| | | url: '/blade-mdm/producedivision/update', |
| | | method: 'post', |
| | | data:params |
| | | }); |
| | | }; |
| | |
| | | <!-- |
| | | * @Date: 2025-06-17 11:44:52 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-06-17 16:16:28 |
| | | * @LastEditTime: 2025-06-17 19:33:51 |
| | | * @FilePath: /mdmweb/src/views/basesetting/produceplan.vue |
| | | --> |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" |
| | | @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange" |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @row-del="rowDel" |
| | | @row-save="save" |
| | | @row-update="rowUpdate"> |
| | | <template #menu-left> |
| | | <el-button type="primary" plain @click="importAction">导入 |
| | | </el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <!-- <template #menu="scope"> |
| | | <el-button type="primary" text size="default" v-if="permission.flow_model_update" |
| | | @click.stop="handleAction(scope.row, scope.index)">审批 |
| | | </el-button> |
| | | </template> |
| | | </template> --> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList } from '@/api/basesetting/produceplan'; |
| | | import { getList, remove,save,update } from '@/api/basesetting/produceplan'; |
| | | import { mapGetters } from 'vuex'; |
| | | export default { |
| | | name: 'ProducePlan', |
| | |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | dialogWidth: '60%', |
| | | // tree: true, |
| | | border: true, |
| | | index: true, |
| | | // selection: true, |
| | | // viewBtn: true, |
| | | menuWidth: 320, |
| | | dialogWidth: 500, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: '程序名称', |
| | | prop: 'name', |
| | | prop: 'programName', |
| | | type: 'input', |
| | | search: true, |
| | | search: false, |
| | | searchRange: true, |
| | | searchSpan: 8, |
| | | hide: true, |
| | | span: 24, |
| | | rules: [{ required: true, message: '请输入程序名称', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '人员名称', |
| | |
| | | searchRange: true, |
| | | searchSpan: 8, |
| | | hide: true, |
| | | display: false, |
| | | }, |
| | | // { |
| | | // label: '序号', |
| | |
| | | // type: 'index', |
| | | // }, |
| | | { |
| | | label: '零组件代码', |
| | | prop: 'id', |
| | | type: '', |
| | | }, |
| | | { |
| | | label: '专业组长', |
| | | prop: 'teamLeaderName', |
| | | type: '', |
| | | prop: 'teamLeaderId', |
| | | type: 'select', |
| | | span: 24, |
| | | display: true, |
| | | dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | rules: [{ required: true, message: '请输入专业组长', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '编制(工艺员)', |
| | | prop: 'teamLeaderName', |
| | | type: '', |
| | | label: '编制', |
| | | prop: 'programmerId', |
| | | type: 'select', |
| | | display: true, |
| | | span: 24, |
| | | dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | rules: [{ required: true, message: '请输入编制(工艺员)', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '校对(工艺员)', |
| | | prop: 'checkerName', |
| | | type: '', |
| | | label: '校对', |
| | | prop: 'checkerId', |
| | | type: 'select', |
| | | display: true, |
| | | span: 24, |
| | | dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | rules: [{ required: true, message: '请输入校对(工艺员)', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '审核(高师)', |
| | | prop: 'seniorName', |
| | | type: '', |
| | | label: '审核', |
| | | prop: 'seniorId', |
| | | type: 'select', |
| | | display: true, |
| | | span: 24, |
| | | dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | rules: [{ required: true, message: '请输入审核(高师)', trigger: 'blur' }], |
| | | }, |
| | | |
| | | |
| | | // Add more columns as needed |
| | | ], |
| | | }, |
| | |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | currentChange() { |
| | | }, |
| | | currentChange() { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange() { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const query = { |
| | | ...this.query, |
| | |
| | | // Logic for importing data |
| | | this.$message.success('导入功能尚未实现'); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm('确定将选择数据删除?', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return remove({ids: [row.id].toString()}); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | }); |
| | | }, |
| | | rowUpdate (row, index, done, loading) { |
| | | console.log('rowUpdate', row); |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | save (row, done, loading) { |
| | | console.log('save', row); |
| | | save(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | } |
| | | }, |
| | | mounted() { |
| | | // Code to run when the component is mounted |