| | |
| | | <el-card class="box-card"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label-width="80" label="生产工单号" prop="workOrderNo"> |
| | | <el-input |
| | | v-model="queryParams.workOrderNo" |
| | | placeholder="请输入生产工单号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.workOrderNo" placeholder="请输入生产工单号" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" prop="productName"> |
| | | <el-input |
| | | v-model="queryParams.productName" |
| | | placeholder="请输入产品名称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.productName" placeholder="请输入产品名称" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="工单状态" prop="orderStatus"> |
| | | <el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable> |
| | |
| | | v-for="dict in dict.type.order_state" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | :value="dict.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item style="float: right"> |
| | |
| | | </el-form> |
| | | <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="68px"> |
| | | <el-form-item style="margin-left: 14px" label="产品编号" prop="productCode"> |
| | | <el-input |
| | | v-model="queryParams.productCode" |
| | | placeholder="请输入产品编号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.productCode" placeholder="请输入产品编号" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="订单编号" prop="salesOrderCode"> |
| | | <el-input |
| | | v-model="queryParams.salesOrderCode" |
| | | placeholder="请输入订单编号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.salesOrderCode" placeholder="请输入订单编号" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="车间编号" prop="workshopCode"> |
| | | <el-input |
| | | v-model="queryParams.workshopCode" |
| | | placeholder="请输入车间编号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.workshopCode" placeholder="请输入车间编号" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="产线编号" prop="lineCode"> |
| | | <el-input |
| | | v-model="queryParams.lineCode" |
| | | placeholder="请输入产线编号" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.lineCode" placeholder="请输入产线编号" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item style="margin-left: 7px" label-width="80" label="产品BOM" prop="bomCode"> |
| | | <el-input |
| | | v-model="queryParams.bomCode" |
| | | placeholder="请输入产品BOM" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.bomCode" placeholder="请输入产品BOM" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | <el-form-item label="工艺流程" prop="routeCode"> |
| | | <el-input |
| | | v-model="queryParams.routeCode" |
| | | placeholder="请输入工艺流程" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.routeCode" placeholder="请输入工艺流程" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="工艺配方" prop="recipeCode"> |
| | | <el-input |
| | | v-model="queryParams.recipeCode" |
| | | placeholder="请输入工艺配方" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.recipeCode" placeholder="请输入工艺配方" clearable @keyup.enter.native="handleQuery"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | |
| | | @click="moveUp(val => val, 'down')" |
| | | >下移</el-button> |
| | | </el-col> |
| | | |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | icon="el-icon-createUpdate" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['om:productionOrde:add']" |
| | | :disabled="single" |
| | | @click="CreatehandleUpdate" |
| | | v-hasPermi="['om:productionOrde:createUpdate']" |
| | | >生成</el-button> |
| | | </el-col> |
| | | |
| | |
| | | <el-table-column label="产品名称" width="160" align="center" prop="productName"> |
| | | </el-table-column> |
| | | <el-table-column label="种类" width="160" align="center" prop="typeZ"> |
| | | </el-table-column> |
| | | <el-table-column label="实际数量" width="160" align="center" prop="actualQty"> |
| | | </el-table-column> |
| | | <el-table-column label="工单状态" align="center" prop="orderStatus"> |
| | | <template slot-scope="scope"> |
| | |
| | | <el-form-item label="产品名称" prop="productName"> |
| | | <el-input v-model="form.productName" disabled placeholder="请输入产品名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="产品名称" prop="productName"> |
| | | <el-form-item label="种类" prop="productName"> |
| | | <el-input v-model="form.typeZ" disabled placeholder="请输入种类" /> |
| | | </el-form-item> |
| | | <el-form-item label="实际数量" prop="actualQty"> |
| | | <el-input v-model="form.actualQty" placeholder="请输入实际数量" /> |
| | | </el-form-item> |
| | | <el-form-item label="车间编号" prop="workshopCode"> |
| | | <el-select style="width: 93%" @change="handleSelectChange(form.workshopCode)" v-model="form.workshopCode" placeholder="请选择车间编号"> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog v-dialogpop-up :title="title" :visible.sync="Createopen" width="400px" append-to-body> |
| | | <span slot="title"> |
| | | <i class="el-icon-s-order"></i> |
| | | {{titleName}} |
| | | </span> |
| | | <el-form ref="form" inline :model="form" :rules="CreateRules"label-width="80px"> |
| | | <el-form-item label="种类" prop="typeZ"> |
| | | <el-input disabled v-model="form.typeZ" placeholder="请输入种类" /> |
| | | </el-form-item> |
| | | <el-form-item label="年份" prop="year"> |
| | | <el-select @change="changeYear(form.year)" v-model="form.year" placeholder="请选择年份" clearable> |
| | | <el-option v-for="dict in dict.type.year" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="月份" prop="month"> |
| | | <el-select @change="changeMonth(form.month)" v-model="form.month" placeholder="请选择月份" clearable> |
| | | <el-option v-for="dict in dict.type.month" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="日期" prop="day"> |
| | | <el-select @change="changeDay(form.day)" v-model="form.day" placeholder="请选择日期" clearable> |
| | | <el-option v-for="dict in dict.type.day" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="数量" prop="actualQty"> |
| | | <el-input disabled v-model="form.actualQty" placeholder="请输入数量" /> |
| | | </el-form-item> |
| | | <el-form-item label="编码" prop="adds"> |
| | | <el-input disabled v-model="form.adds" placeholder="请生成编码" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="CreateSubmitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute"; |
| | | import ItemSelect from "@/components/itemSelect/single.vue"; |
| | | import { upDownMove, listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde"; |
| | | import { listOrderScheduling, getOrderScheduling, delOrderScheduling, addOrderScheduling, updateOrderScheduling,generateNumbers } from "@/api/main/bs/orderScheduling/orderScheduling"; |
| | | |
| | | export default { |
| | | name: "ProductionOrde", |
| | | dicts: ['order_state'], |
| | | dicts: ['order_state','year','month','day'], |
| | | components: { |
| | | ItemSelect , |
| | | }, |
| | |
| | | titleName: '', |
| | | options: [], |
| | | lineOptions: [], |
| | | outputArray: [], |
| | | showFlag:false, |
| | | advancedShowSearch: false, |
| | | workOrder: { |
| | |
| | | title: "", |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | Createopen: false, |
| | | // 查询参数 |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | idNums: null, |
| | | typeZ: null, |
| | | flag: null, |
| | | |
| | | adds:null, |
| | | }, |
| | | |
| | | // 表单参数 |
| | | form: {}, |
| | | updateStatusParameter: { |
| | |
| | | id: [ |
| | | { required: true, message: "ID不能为空", trigger: "blur" } |
| | | ], |
| | | } |
| | | }, |
| | | CreateRules: { |
| | | day: [ |
| | | { required: true, message: "不能为空", trigger: "blur" } |
| | | ], |
| | | month: [ |
| | | { required: true, message: "不能为空", trigger: "blur" } |
| | | ], |
| | | year: [ |
| | | { required: true, message: "不能为空", trigger: "blur" } |
| | | ], |
| | | }, |
| | | change: { |
| | | day: '', |
| | | month: '', |
| | | year: '', |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | this.initWorkshop(); |
| | | }, |
| | | methods: { |
| | | //数组生成 |
| | | |
| | | |
| | | |
| | | changeDay(day){ |
| | | this.change.day = day; |
| | | let adds =this.form.typeZ+this.change.year+this.change.month+this.change.day+this.form.actualQty; |
| | | this.form.adds = adds |
| | | }, |
| | | changeMonth(day){ |
| | | this.change.month = day; |
| | | let adds =this.form.typeZ+this.change.year+this.change.month+this.change.day+this.form.actualQty; |
| | | this.form.adds = adds |
| | | }, |
| | | changeYear(day){ |
| | | this.change.year = day; |
| | | let adds =this.form.typeZ+this.change.year+this.change.month+this.change.day+this.form.actualQty; |
| | | this.form.adds = adds |
| | | }, |
| | | |
| | | |
| | | moveUp(row, val){ |
| | | console.log(val) |
| | | const ids = row.id || this.ids |
| | |
| | | }); |
| | | }, |
| | | // 在这里编写处理选中事件的逻辑 |
| | | handleSelectChange(selectedOption) { |
| | | this.form.lineCode = null; |
| | | let params = { |
| | | workshopCode: selectedOption |
| | | }; |
| | | listLineInfo(params).then(response => { |
| | | this.lineOptions = response.rows; |
| | | }); |
| | | }, |
| | | |
| | | |
| | | //物料选择弹出框 |
| | | onItemSelected(obj){ |
| | | if(obj !== undefined && obj !== null){ |
| | |
| | | this.form.productCode = productCode; |
| | | this.form.productName = obj.materialName; |
| | | this.form.typeZ = obj.typeZ; |
| | | this.typeL = obj.typeZ; |
| | | this.queryParams.productCode = productCode; |
| | | this.queryParams.typeZ = typeZ |
| | | listTechnologyRoute(this.queryParams).then(response => { |
| | |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.Createopen = false; |
| | | this.reset(); |
| | | }, |
| | | // 表单重置 |
| | |
| | | spareField2: null, |
| | | spareField3: null, |
| | | typeZ: null, |
| | | spareField4: null |
| | | spareField4: null, |
| | | adds:null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | |
| | | this.reset(); |
| | | this.open = true; |
| | | this.titleName = "添加生产工单"; |
| | | }, |
| | | /** 同步按钮操作 */ |
| | | CreatehandleUpdate(Row) { |
| | | this.initWorkshop(); |
| | | this.reset(); |
| | | const id = Row.id || this.ids |
| | | getProductionOrde(id).then(response => { |
| | | console.log(response.data) |
| | | this.form = response.data; |
| | | this.Createopen = true; |
| | | this.titleName = "生成订单"; |
| | | // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1); |
| | | }); |
| | | this.$modal.msgSuccess(Row.actualQty); |
| | | |
| | | |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | |
| | | this.download('om/productionOrde/export', { |
| | | ...this.queryParams |
| | | }, `productionOrde_${new Date().getTime()}.xlsx`) |
| | | } |
| | | }, |
| | | /** 提交按钮 */ |
| | | CreateSubmitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.orderNumber != null) { |
| | | updateOrderScheduling(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addOrderScheduling(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | } |
| | | }; |
| | | </script> |