| | |
| | | "faker": "^5.5.3", |
| | | "js-cookie": "^3.0.5", |
| | | "lodash": "^4.17.21", |
| | | "moment": "^2.30.1", |
| | | "vue": "^2.6.14", |
| | | "vue-router": "^3.5.1", |
| | | "vuex": "^3.6.2" |
| | |
| | | import "@/assets/style/index.scss" |
| | | import "@/components" |
| | | import "@/common/untils/dialog" |
| | | |
| | | Vue.use(ElementUI) |
| | | import moment from 'moment'; |
| | | Vue.use(ElementUI); |
| | | Vue.prototype.$moment=moment; |
| | | // 修改默认点击遮罩层为不关闭 |
| | | ElementUI.MessageBox.setDefaults({ |
| | | closeOnClickModal: false |
| | |
| | | // 导出路由 在 main.js 里使用 |
| | | const createRouter = () => |
| | | new Router({ |
| | | mode: "history", |
| | | mode: "hash", |
| | | // base: window.getServerJson.context, |
| | | scrollBehavior: () => ({ y: 0 }), |
| | | routes: constantRoutes |
| | |
| | | } from "@/api/productManage/silkRegisterForm.js"; |
| | | import { |
| | | getCheckDetails, |
| | | saveCheck, |
| | | saveCheck |
| | | } from "@/api/productManage/silkInspectForm.js"; |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin"; |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView"; |
| | | import { getWorkshopManageGroup } from "@/api/productManage/productRegisterForm.js"; |
| | | import moment from 'moment'; |
| | | let idValue=moment(new Date()).format('YYYYMMDDHHmmss'); |
| | | export default { |
| | | name: "silkRegisterAddPage", |
| | | props: {}, |
| | |
| | | components: { |
| | | CommonFormTableView, |
| | | }, |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | title:'', |
| | |
| | | workshopGroupList: [], //组别 |
| | | deliveryTypeList: [], |
| | | specList: [], //规格 |
| | | form: {}, |
| | | form: { |
| | | number:idValue |
| | | }, |
| | | rules: { |
| | | number: [ |
| | | { required: true, message: "请填写", trigger: ["change", "blur"] }, |
| | |
| | | }, |
| | | pickerOptions: { |
| | | disabledDate(time) { |
| | | return time.getTime() < new Date().getTime() - 86400000; |
| | | //return time.getTime() < new Date().getTime() - 86400000; |
| | | return false; |
| | | }, |
| | | }, |
| | | tableTwoList: { |
| | |
| | | async getDetailsData(id) { |
| | | if (this.activeName == "first") { |
| | | this.form = { |
| | | number: "", |
| | | finishDate: "", |
| | | number: idValue, |
| | | finishDate:this.$moment(new Date()).format('YYYY-MM-DD'), |
| | | market: "", |
| | | workshopObj: "", |
| | | spec: "", |
| | |
| | | circle: "", |
| | | totalCircle: "", |
| | | position: "", |
| | | }; |
| | | } |
| | | if (this.registerId) { |
| | | await getRegisterDetails({ id: id ? id : this.registerId }).then( |
| | | (response) => { |
| | |
| | | } |
| | | } else { |
| | | this.form = { |
| | | number: "", |
| | | number: idValue, |
| | | workshopObj: "", |
| | | workshopGroup: "", |
| | | circle: "", |
| | | spec: "", |
| | | finishDate: "", |
| | | finishDate: this.$moment(new Date()).format('YYYY-MM-DD'), |
| | | averageFineness: "", |
| | | measureFineness: "", |
| | | deviation: "", |
| | |
| | | cancelClickOne() { |
| | | if (this.activeName == "first") { |
| | | this.form = { |
| | | number: "", |
| | | finishDate: "", |
| | | number: idValue, |
| | | finishDate:this.$moment(new Date()).format('YYYY-MM-DD'), |
| | | market: "", |
| | | workshopObj: "", |
| | | spec: "", |
| | |
| | | }, |
| | | // 删除 |
| | | clearupProject(data, index) { |
| | | this.tableData.splice(index, 1) |
| | | this.silkTableList.tableData=this.tableData |
| | | this.$confirm('确定要删除吗, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.tableData.splice(index, 1) |
| | | this.silkTableList.tableData=this.tableData |
| | | }).catch(() => { |
| | | }); |
| | | }, |
| | | // 保存编辑按钮切换 |
| | | editSaveClick() { |
New file |
| | |
| | | <template> |
| | | <el-dialog |
| | | :visible.sync="editConfig.visible" |
| | | :before-close="handleClose" |
| | | > |
| | | <!-- 头 --> |
| | | <div slot="title" class="dialog-header"> |
| | | <span>{{editConfig.title}}车间管理</span> |
| | | </div> |
| | | <div class="dialog-view"> |
| | | <el-form |
| | | ref="workshopForm" |
| | | :model="editConfig.infomitton" |
| | | :rules="rules" |
| | | label-position="right" |
| | | label-width="100px" |
| | | size="mini" |
| | | > |
| | | <div> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="workshop" label="车间:" style="width: 100%;"> |
| | | <el-select |
| | | :disabled="editConfig.OperationType===3" |
| | | v-model="editConfig.infomitton.workshop" |
| | | value-key="workshopName" placeholder="请选择车间" |
| | | @change="selWorkshop" |
| | | > |
| | | <el-option |
| | | v-for="item in workshopList" |
| | | :key="item.ID" |
| | | :label="item.name" |
| | | :value="{workshopNumber:item.number,workshopName:item.name}"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="组别:" style="width: 100%;" |
| | | prop="groupNumber" > |
| | | <el-input |
| | | type="number" |
| | | :disabled="editConfig.OperationType===3" |
| | | v-model.number="editConfig.infomitton.groupNumber" |
| | | :rows="4" |
| | | style="resize: none !important;" |
| | | placeholder="请输入组别" |
| | | @change="changeGroupNumber" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="开始车号:" style="width: 100%;" prop="startCarNumber" > |
| | | <el-input |
| | | type="number" |
| | | :disabled="editConfig.OperationType===3" |
| | | v-model.number="editConfig.infomitton.startCarNumber" |
| | | :rows="4" |
| | | style="resize: none !important;" |
| | | placeholder="请输入开始车号" |
| | | @change="changeStartCarNumber" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="结束车号:" style="width: 100%;" prop="endCarNumber" > |
| | | <el-input |
| | | type="number" |
| | | :disabled="editConfig.OperationType===3" |
| | | v-model.number="editConfig.infomitton.endCarNumber" |
| | | :rows="4" |
| | | style="resize: none !important;" |
| | | placeholder="请输入结束车号" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="标志类型:" style="width: 100%;" > |
| | | <el-select |
| | | @change="changeCarFlag" |
| | | :disabled="editConfig.OperationType===3" v-model.number="editConfig.infomitton.carFlag" placeholder="请选择标志类型"> |
| | | <el-option |
| | | v-for="item in carFlagList" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注:" style="width: 100%;" > |
| | | <el-input |
| | | :disabled="this.editConfig.OperationType===3" |
| | | v-model="editConfig.infomitton.notes" |
| | | type="textarea" |
| | | :rows="4" |
| | | style="resize: none !important;" |
| | | placeholder="" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | <div class="dialog-footer"> |
| | | <div class="bottom-tabs"> |
| | | <div class="tab-pane" style="background:#2a78fb;color: #fff"> |
| | | 组别明细列表 |
| | | </div> |
| | | </div> |
| | | <div class="list-view"> |
| | | <TableCommonView :table-list="tableList" |
| | | @selTableCol="selTableCol"> |
| | | <template slot="tableButton"> |
| | | <el-table-column label="开始车号" width="120" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{scope.row.startCarNumber?scope.row.startCarNumber:'--'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="开始标记" width="120" align="center" v-if="editConfig.infomitton.carFlag===1"> |
| | | <template slot-scope="scope"> |
| | | {{scope.row.startCarHalf===1?'左半车':'右半车'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="结束车号" width="120" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input type="number" :disabled="scope.row.noEdit" placeholder="请输入" v-model.number="scope.row.endCarNumber" size="small" v-if="editConfig.OperationType!==3"></el-input> |
| | | <span v-else>{{scope.row.endCarNumber}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="结束标记" v-if="editConfig.infomitton.carFlag===1" width="120" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-select size="small" :disabled="scope.row.noEdit" v-model="scope.row.endCarHalf" v-if="editConfig.OperationType!==3"> |
| | | <el-option label="左半车" :value="1">左半车</el-option> |
| | | <el-option label="右半车" :value="2">右半车</el-option> |
| | | </el-select> |
| | | <span v-else>{{scope.row.endCarNumber}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" width="100" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input placeholder="请输入" v-model="scope.row.notes" size="small" v-if="editConfig.OperationType!==3"></el-input> |
| | | <span v-else>{{scope.row.notes}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | width="60" |
| | | align="center" |
| | | v-if="editConfig.OperationType!==3" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click.stop="handleDelClick(scope, '操作')">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCommonView> |
| | | </div> |
| | | <div style="line-height: 50px" v-if="editConfig.OperationType!==3"> |
| | | <el-button type="primary" size="small" @click="addItem">新增</el-button> |
| | | <el-button type="primary" size="small" @click="clearItem">清空</el-button> |
| | | </div> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | @click="saveClick" |
| | | :disabled="editConfig.OperationType===3">保存</el-button> |
| | | <el-button size="small" @click="handleClose">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getDict,saveWorkshopManage} from "@/api/systemSetting/workshopManage"; |
| | | export default { |
| | | name: "workshopDialog", |
| | | props:{ |
| | | editConfig:{ |
| | | type:Object, |
| | | default:()=>({ |
| | | visible: false,//弹框是否可见 |
| | | title: "新建", |
| | | OperationType:1,//1 新建 2 修改 3 查看 |
| | | infomitton: { |
| | | details:[]//列表数据 |
| | | },//表单数据 + 明细列表数据 |
| | | }) |
| | | } |
| | | }, |
| | | data(){ |
| | | return { |
| | | tableList:{}, |
| | | showCol: ["开始标记","车间", "组别", "开始车号","开始标记", "结束车号", "结束标记","标志类型", "备注"], |
| | | tableColumn: [ |
| | | { label: "车间", prop: "workshopName" }, |
| | | { label: "组别", prop: "groupNumber" }, |
| | | { label: "标志类型", prop: "carFlag" ,isCallMethod:true,getCallMethod:(value)=>{return value===0?'全车':'半车'}}, |
| | | /*{ label: "开始车号", prop: "startCarNumber" },*/ |
| | | /*{ label: "结束车号", prop: "endCarNumber" },*/ |
| | | /*{ label: "备注", prop: "notes", },*/ |
| | | ], |
| | | workshopList:[], |
| | | carFlagList:[ |
| | | { |
| | | name:'全车', |
| | | value:0 |
| | | }, |
| | | { |
| | | name:'半车', |
| | | value:1 |
| | | } |
| | | ],// 标志类型列表 |
| | | rules:{ |
| | | workshop: [ |
| | | { required: true, message: '请选择车间', trigger: 'change' } |
| | | ], |
| | | groupNumber: [ |
| | | { required: true, message: '请填写组别', trigger: 'blur' } |
| | | ], |
| | | startCarNumber: [ |
| | | { required: true, message: '请填写', trigger: 'blur' } |
| | | ], |
| | | endCarNumber: [ |
| | | { required: true, message: '请填写', trigger: 'blur' } |
| | | ], |
| | | }, |
| | | itemModel:{//新增模板 |
| | | startCarHalf:1, |
| | | endCarHalf:2, |
| | | workshopName:'', |
| | | groupNumber:'', |
| | | startCarNumber:'', |
| | | endCarNumber:'', |
| | | carFlag:1, |
| | | notes:'' |
| | | } |
| | | } |
| | | }, |
| | | created(){ |
| | | this.initData(); |
| | | }, |
| | | methods:{ |
| | | initBottomTableList(list){ |
| | | this.tableList.tableInfomation=JSON.parse(JSON.stringify(list)); |
| | | }, |
| | | clearData(){ |
| | | this.tableList.tableInfomation=[{...this.itemModel}]; |
| | | this.$refs['workshopForm'].resetFields(); |
| | | this.editConfig.visible=false; |
| | | }, |
| | | doChangeData(val,fieldName){ |
| | | this.tableList.tableInfomation.forEach((item,index)=>{ |
| | | if(fieldName==='workshop'){ |
| | | item.workshopName=val.workshopName; |
| | | item.workshopNumber=val.workshopNumber; |
| | | }else if(fieldName==='startCarNumber'){ |
| | | if(index===0){ |
| | | item.startCarNumber=val; |
| | | } |
| | | }else{ |
| | | item[fieldName]=val; |
| | | } |
| | | }); |
| | | }, |
| | | //选择车间 |
| | | selWorkshop(val){ |
| | | this.doChangeData(val,'workshop'); |
| | | }, |
| | | //改变组别 |
| | | changeGroupNumber(val){ |
| | | this.doChangeData(val,'groupNumber'); |
| | | }, |
| | | changeStartCarNumber(val){ |
| | | this.doChangeData(val,'startCarNumber'); |
| | | }, |
| | | changeCarFlag(val){ |
| | | this.doChangeData(val,'carFlag'); |
| | | }, |
| | | //关闭模态框 |
| | | handleClose(){ |
| | | this.clearData(); |
| | | }, |
| | | //保存 |
| | | saveClick(){ |
| | | this.$refs['workshopForm'].validate(async (vail)=>{ |
| | | if(vail){ |
| | | const lastObj=this.tableList.tableInfomation[this.tableList.tableInfomation.length-1]; |
| | | if(!lastObj.endCarNumber){ |
| | | this.$message.error('明细结束车号不能为空'); |
| | | return ; |
| | | }else if(lastObj.endCarNumber<lastObj.startCarNumber){ |
| | | this.$message.error(`明细结束车号${lastObj.endCarNumber},不能小于明细起始车号${lastObj.startCarNumber}`); |
| | | return; |
| | | }else if(lastObj.endCarNumber>this.editConfig.infomitton.endCarNumber){ |
| | | this.$message.error(`明细结束车号${lastObj.endCarNumber},不能大于车间总的结束车号${this.editConfig.infomitton.endCarNumber}`); |
| | | return; |
| | | } |
| | | //执行保存操作 |
| | | const params={ |
| | | ...this.editConfig.infomitton, |
| | | ...this.editConfig.infomitton.workshop, |
| | | details:[...this.tableList.tableInfomation].map(item=>{ |
| | | item.startCarNumber=parseInt(item.startCarNumber); |
| | | item.groupNumber=parseInt(item.groupNumber); |
| | | return item; |
| | | }) |
| | | }; |
| | | delete params.workshop; |
| | | const {code}=await saveWorkshopManage(params); |
| | | if(code===200){ |
| | | this.$message.success(`${this.editConfig.OperationType===1?'添加':'修改'}成功`); |
| | | window.setTimeout(()=>{ |
| | | this.clearData(); |
| | | this.$emit('refresh'); |
| | | },500); |
| | | }else{ |
| | | this.$message.error(`${this.editConfig.OperationType===1?'添加':'修改'}失败`); |
| | | } |
| | | }else{ |
| | | this.$message.error('请先将表单填写完整'); |
| | | } |
| | | }); |
| | | }, |
| | | //新增明细 |
| | | addItem(){ |
| | | this.$refs['workshopForm'].validate((vail)=>{ |
| | | if(vail){ |
| | | const obj={...this.itemModel}; |
| | | if(this.editConfig.infomitton.workshop){ |
| | | obj.workshopName=this.editConfig.infomitton.workshop.workshopName; |
| | | obj.workshopNumber=this.editConfig.infomitton.workshop.workshopNumber; |
| | | } |
| | | if(this.editConfig.infomitton.groupNumber){ |
| | | obj.groupNumber=this.editConfig.infomitton.groupNumber; |
| | | } |
| | | //判断上一个元素的结束车号 |
| | | const lastObj=this.tableList.tableInfomation[this.tableList.tableInfomation.length-1]; |
| | | if(!lastObj.endCarNumber){ |
| | | this.$message.error('明细结束车号不能为空'); |
| | | return ; |
| | | }else if(lastObj.endCarNumber<lastObj.startCarNumber){ |
| | | this.$message.error(`明细结束车号${lastObj.endCarNumber},不能小于明细起始车号${lastObj.startCarNumber}`); |
| | | return; |
| | | }else if(lastObj.endCarNumber>this.editConfig.infomitton.endCarNumber){ |
| | | this.$message.error(`明细结束车号${lastObj.endCarNumber},不能大于车间总的结束车号${this.editConfig.infomitton.endCarNumber}`); |
| | | return; |
| | | } |
| | | if(lastObj.endCarHalf===1){//左半车 |
| | | obj.startCarNumber=lastObj.endCarNumber |
| | | obj.startCarHalf=2;//右半车 |
| | | }else{ |
| | | obj.startCarNumber=lastObj.endCarNumber+1; |
| | | obj.startCarHalf=1;//左半车 |
| | | } |
| | | lastObj.noEdit=true; |
| | | this.$set(this.tableList.tableInfomation,this.tableList.tableInfomation.length-1,{...lastObj}); |
| | | obj.carFlag=this.editConfig.infomitton.carFlag; |
| | | this.tableList.tableInfomation.push(obj); |
| | | }else{ |
| | | this.$message.error('请先将表单填写完整'); |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | setTable() { |
| | | this.tableList = { |
| | | maxHeight:320, |
| | | selectIndex: true, |
| | | tableInfomation: [{...this.itemModel}], |
| | | allcol: [], |
| | | showcol: this.showCol, |
| | | tableColumn: this.setColumnVisible(this.showCol, this.tableColumn) |
| | | } |
| | | this.setTableList(this.tableList) |
| | | }, |
| | | selTableCol(val){ |
| | | this.showcol = val; |
| | | this.tableList.tableColumn = this.setColumnVisible(val, this.tableColumn) |
| | | }, |
| | | setTableList(tableList) { |
| | | tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | }, |
| | | setColumnVisible(showCol, tableColumn) { |
| | | return tableColumn.map((ele) => { |
| | | return { |
| | | ...ele, |
| | | isShowColumn: showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | | initData(){ |
| | | this.setTable(); |
| | | this.getDictData(); |
| | | }, |
| | | async getDictData(){ |
| | | await getDict({dictType:1}).then((res)=>{ |
| | | if(res&&res.code===200){ |
| | | this.workshopList=res.data |
| | | } |
| | | }) |
| | | }, |
| | | // 删除明细 |
| | | handleDelClick(scope){ |
| | | if(this.tableList.tableInfomation.length>1){ |
| | | let index=scope.$index; |
| | | this.tableList.tableInfomation.splice(index,1); |
| | | const lastObj=this.tableList.tableInfomation[index-1]; |
| | | lastObj.noEdit=false; |
| | | this.$set(this.tableList.tableInfomation,index-1,{...lastObj}) |
| | | }else{ |
| | | this.$message.error('组别至少有一条明细'); |
| | | } |
| | | }, |
| | | // 清空明细,但是保留第一条明细 |
| | | clearItem(){ |
| | | if(this.tableList.tableInfomation.length>1){ |
| | | this.tableList.tableInfomation.splice(1,this.tableList.tableInfomation.length-1); |
| | | const lastObj=this.tableList.tableInfomation[0]; |
| | | lastObj.noEdit=false; |
| | | this.$set(this.tableList.tableInfomation,scope.$index-1,{...lastObj}) |
| | | }else{ |
| | | this.$message.error('组别至少有一条明细'); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .dialog-view{ |
| | | width: 96%; |
| | | } |
| | | .dialog-footer{ |
| | | .bottom-tabs { |
| | | height: 40px; |
| | | line-height: 40px; |
| | | background: white; |
| | | display: flex; |
| | | .tab-pane { |
| | | width: 100px; |
| | | margin-right: 20px; |
| | | font-size: 12px !important; |
| | | text-align: center; |
| | | cursor: pointer; |
| | | background: #2a78fb; |
| | | border-top-left-radius: 20px; |
| | | border-top-right-radius: 20px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | </div> |
| | | <div class="body-card"> |
| | | <div class="list-view"> |
| | | <TableCommonView :table-list="tableList" @selTableCol="selTableCol" @handleShow="handleShow" |
| | | <TableCommonView :table-list="tableList" |
| | | :selectClassRow="selectRow" |
| | | @selTableCol="selTableCol" |
| | | @tableRowClick="tableRowClick"> |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="180"> |
| | |
| | | <el-button @click.stop="handleClick(scope.row, '查看')" type="text" size="small">查看</el-button> |
| | | <el-button @click.stop="handleClick(scope.row, '修改')" type="text" size="small">修改</el-button> |
| | | <el-button @click.stop="handleClick(scope.row, '删除')" type="text" size="small">删除</el-button> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | <AddWorkshop ref="bomTypeDialog" @handleConfirmSave="handleConfirmSave" :workList="workList" title="添加节点类型" /> |
| | | <AddDataDictionaries :editDiaConfig="editConfig" /> |
| | | <div class="body-card1"> |
| | | <div class="bottom-tabs"> |
| | | <div |
| | | class="tab-pane" |
| | | @click="getTab(0)" |
| | | :style="{ |
| | | background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8', |
| | | color: TabsIndex == 0 ? '#fff' : '#666' |
| | | }" |
| | | > |
| | | 组别列表 |
| | | </div> |
| | | <!--<div |
| | | class="tab-pane" |
| | | @click="getTab(1)" |
| | | :style="{background: TabsIndex == 1 ? '#2a78fb' : '#F1F3F8',color: TabsIndex == 1 ? '#fff' : '#666'}" |
| | | > |
| | | 单据追溯 |
| | | </div>--> |
| | | </div> |
| | | <div class="list-view"> |
| | | <TableCommonView :table-list="bottomTableList" |
| | | @selTableCol="selTableCol"> |
| | | <template slot="tableButton"> |
| | | </template> |
| | | </TableCommonView> |
| | | </div> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | <!--<AddWorkshop ref="bomTypeDialog" @handleConfirmSave="handleConfirmSave" :workList="workList" title="添加节点类型" /> |
| | | <AddDataDictionaries :editDiaConfig="editConfig" />--> |
| | | <WorkshopDialog ref="workshopDialogRef" :edit-config="editConfig" @refresh="refresh"></WorkshopDialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import TableCommonView from '@/components/makepager/TableCommonView.vue' |
| | | import AddWorkshop from '@/views/systemSetting/workshopManage/components/addWorkshop.vue' |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import WorkshopDialog from '@/views/systemSetting/workshopManage/components/workshopDialog.vue' |
| | | export default { |
| | | name: "workshopManage", |
| | | props: {}, |
| | | components: { TableCommonView, AddWorkshop, AddDataDictionaries }, |
| | | components: { TableCommonView, AddWorkshop, AddDataDictionaries,WorkshopDialog }, |
| | | mixins: [pageMixin], |
| | | computed: {}, |
| | | computed: { |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | selectRow:{}, |
| | | TabsIndex:0, |
| | | bottomTableList:{}, |
| | | tableList: {}, |
| | | showCol: ["车间", "组别", "开始车号", "结束车号", "半车标志", "备注"], |
| | | showCol: ["车间", "组别", "开始车号", "结束车号", "标志类型", "备注"], |
| | | tableColumn: [ |
| | | // { label: "车间", prop: "workshopNumber",iconRight:"el-icon-setting"}, |
| | | { label: "车间", prop: "workshopName", }, |
| | | { label: "组别", prop: "groupNumber", }, |
| | | { label: "开始车号", prop: "startCarNumber" }, |
| | | { label: "结束车号", prop: "endCarNumber" }, |
| | | { label: "半车标志", prop: "carFlag", isCallMethod: true, getCallMethod: this.getStatusCarFlag }, |
| | | { label: "标志类型", prop: "carFlag", isCallMethod: true, getCallMethod: this.getStatusCarFlag }, |
| | | { label: "备注", prop: "notes", }, |
| | | ], |
| | | // 类型 |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | refresh(){ |
| | | this.getData(); |
| | | }, |
| | | setTable() { |
| | | const obj={ |
| | | selectIndex: true, |
| | | tableInfomation: [], |
| | | allcol: [], |
| | | showcol: this.showCol, |
| | | tableColumn: this.setColumnVisible(this.showCol, this.tableColumn) |
| | | }; |
| | | // top 明细单列表 |
| | | this.tableList = { |
| | | selectIndex: true, |
| | | tableInfomation: [], |
| | | allcol: [], |
| | | showcol: this.showCol, |
| | | tableColumn: this.setColumnVisible(this.showCol, this.tableColumn) |
| | | } |
| | | this.setTableList(this.tableList) |
| | | this.tableList = {...obj}; |
| | | this.bottomTableList={...obj}; |
| | | this.setTableList(this.tableList); |
| | | this.setTableList(this.bottomTableList); |
| | | }, |
| | | setColumnVisible(showCol, tableColumn) { |
| | | return tableColumn.map((ele) => { |
| | |
| | | }, |
| | | setTableList(tableList) { |
| | | tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | this.searchOptions = [] |
| | | this.searchOptions = []; |
| | | for (let i = 0; i < tableList.tableColumn.length; i++) { |
| | | const label = tableList.tableColumn[i].label |
| | | const value = tableList.tableColumn[i].prop |
| | |
| | | }, |
| | | // 表格行点击 |
| | | tableRowClick(row) { |
| | | console.log(row, "row") |
| | | this.selectRow={...row}; |
| | | this.bottomTableList.tableInfomation=row.details||[]; |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(searchText) { |
| | |
| | | }, |
| | | // 新增 |
| | | addBtnClick() { |
| | | this.editConfig.infomitton = {} |
| | | this.editConfig.dialogTitle = "新增" |
| | | this.editConfig.infomitton = { |
| | | carFlag:1, |
| | | workshop:{} |
| | | }; |
| | | this.editConfig.OperationType=1; |
| | | this.editConfig.title = "新增"; |
| | | this.editConfig.visible = true |
| | | }, |
| | | // 保存 |
| | |
| | | }, |
| | | // 刷新 |
| | | refreshClick() { |
| | | this.getDataParams.keyWord = "" |
| | | this.pagerOptions.currPage = 1 |
| | | this.pagerOptions.pageSize = 15 |
| | | this.$refs.searchRef.searchInput = "" |
| | | this.getDataParams.keyWord = ""; |
| | | this.pagerOptions.currPage = 1; |
| | | this.pagerOptions.pageSize = 15; |
| | | this.$refs.searchRef.searchInput = ""; |
| | | this.getData() |
| | | }, |
| | | // 打印 |
| | |
| | | // 删除 |
| | | delBtnClick() { }, |
| | | // 组别 |
| | | handleShow() { |
| | | /* handleShow() { |
| | | this.$refs.bomTypeDialog.editDialogVisible = true; |
| | | }, |
| | | },*/ |
| | | handleGetBomKindDictList() { |
| | | // postGetBomKindDictList().then((res) => { |
| | | // this.workList = res.data; |
| | | // }); |
| | | }, |
| | | handleConfirmSave(data) { |
| | | console.log(data) |
| | | // postSaveBomKindDict({ data: data }).then((res) => { |
| | | // if (res.code == 200) { |
| | | // this.$message({ |
| | | // message: "操作成功!", |
| | | // type: "success", |
| | | // }); |
| | | // this.$refs.bomTypeDialog.editDialogVisible = false; |
| | | // this.handleGetBomKindDictList(); |
| | | // } |
| | | // }); |
| | | console.log(data); |
| | | }, |
| | | // 车间列表 |
| | | async getData() { |
| | | await getWorkshopManageList({ |
| | | keyWord: this.getDataParams.keyWord, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | pageSize: this.pagerOptions.pageSize, |
| | | type:1 |
| | | }).then((res) => { |
| | | this.tableList.tableInfomation = res.data |
| | | this.pagerOptions.totalCount = res.total |
| | | }) |
| | | if(res.data.length>0){ |
| | | this.bottomTableList.tableInfomation=res.data[0].details||[]; |
| | | } |
| | | }); |
| | | }, |
| | | getStatusCarFlag(val) { |
| | | if (val) { |
| | | return val == 1 ? '左半车' : val == 2 ? '右半车' : val == 3 ? '全车结束' : '--' |
| | | } else { |
| | | return "--"; |
| | | } |
| | | if(val===0){ |
| | | return '全车' |
| | | }else{ |
| | | return '半车' |
| | | } |
| | | }, |
| | | handleClick(row, type) { |
| | | if (type !== "删除") { |
| | | this.editConfig.infomitton = { |
| | | ...row, |
| | | workshop:{ |
| | | number:row.workshopNumber, |
| | | name:row.workshopName |
| | | workshopNumber:row.workshopNumber, |
| | | workshopName:row.workshopName |
| | | } |
| | | } |
| | | }; |
| | | this.editConfig.infomitton.workshopId = row.ID |
| | | this.editConfig.infomitton.workshopNumber = Number(this.editConfig.infomitton.workshopNumber) |
| | | this.editConfig.dialogTitle = type |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = type; |
| | | if(type==='修改'){ |
| | | this.editConfig.OperationType=2 |
| | | }else{ |
| | | this.editConfig.OperationType=3 |
| | | } |
| | | this.editConfig.visible = true; |
| | | (row.details||[]).forEach((item,index)=>{ |
| | | if(index<row.details.length-1){ |
| | | item.noEdit=true; |
| | | }else{ |
| | | item.noEdit=false; |
| | | } |
| | | }); |
| | | this.$refs['workshopDialogRef'].initBottomTableList(row.details||[]); |
| | | } else if (type === "删除") { |
| | | this.$confirm(`确认删除吗?`, '提示', { |
| | | confirmButtonText: '确定', |
| | |
| | | border-radius: 4px; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .body-card { |
| | | .body-card,.body-card1 { |
| | | margin: 0 30px; |
| | | background-color: #fff; |
| | | padding: 10px 15px; |
| | | height: calc(100% - 180px); |
| | | border-radius: 4px; |
| | | |
| | | .edit-save { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 10px; |
| | | |
| | | .edit-save-icon { |
| | | font-size: 24px; |
| | | color: #5582f3; |
| | |
| | | } |
| | | } |
| | | } |
| | | .body-card{ |
| | | height: calc(100% - 440px); |
| | | } |
| | | .body-card1{ |
| | | margin-top: -50px; |
| | | height: calc(100% - 500px); |
| | | .bottom-tabs { |
| | | height: 40px; |
| | | line-height: 40px; |
| | | background: white; |
| | | display: flex; |
| | | .tab-pane { |
| | | width: 100px; |
| | | margin-right: 20px; |
| | | font-size: 14px !important; |
| | | text-align: center; |
| | | cursor: pointer; |
| | | background: #2a78fb; |
| | | border-top-left-radius: 20px; |
| | | border-top-right-radius: 20px; |
| | | } |
| | | } |
| | | padding-bottom: 100px; |
| | | .btn-pager{ |
| | | position: relative; |
| | | top: -5px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .list-view { |
| | |
| | | .btn-pager { |
| | | display: flex; |
| | | margin-top: 10px; |
| | | |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | |
| | | const path = require("path") |
| | | // 基础路径 注意发布之前要先修改这里 |
| | | const publicPath = "/" |
| | | const publicPath = "./" |
| | | function resolve(dir) { |
| | | return path.join(__dirname, dir) |
| | | } |
| | | |
| | | const serverPath='http://192.168.0.101:8008'; |
| | | const ipNum=59; |
| | | const serverPath='http://192.168.0.86:8008'; |
| | | // 设置不参与构建的库 |
| | | const externals = {}; |
| | | module.exports = { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |