| | |
| | | <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 label="日期" prop="dateTime"> |
| | | <el-date-picker clearable |
| | | v-model="form.dateTime" |
| | | type="date" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="请选择日期" @input="handleCodeChange"> |
| | | </el-date-picker> |
| | | </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 label="日期规则" prop="dateTimeRule" hidden> |
| | | <el-input v-model="form.dateTimeRule"/> |
| | | </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 label="起始编号" prop="startCode"> |
| | | <el-input v-model="form.startCode" placeholder="请输入起始编号" @input="handleCodeChange"/> |
| | | </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 label="起止编号" prop="startEndCode"> |
| | | <el-input disabled v-model="form.startEndCode"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="CreateSubmitForm">确 定</el-button> |
| | | <el-button type="primary" @click="submitFormForBoxCode">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | import { listProductBom } from "@/api/main/bs/ProductBom/ProductBom"; |
| | | import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute"; |
| | | import ItemSelect from "@/components/itemSelect/single.vue"; |
| | | import { getProductionNotice, 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"; |
| | | import { addOrderSchedulingForBoxCode,getProductionNotice, 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", |
| | |
| | | this.initWorkshop(); |
| | | }, |
| | | methods: { |
| | | //日期或开始编号输入时 |
| | | handleCodeChange(data){ |
| | | let dateTime = this.form.dateTime; |
| | | let planQty = this.form.planQty; |
| | | let startCode = this.form.startCode |
| | | if(dateTime !== null && dateTime !== undefined |
| | | && startCode !== null && startCode !== undefined) { |
| | | let dateTimes = dateTime.split("-"); |
| | | let year = dateTimes[0]; |
| | | let month = dateTimes[1]; |
| | | let day = dateTimes[2]; |
| | | let dictYear = this.dict.type.year; |
| | | let dictMonth = this.dict.type.month; |
| | | let startCode = this.form.startCode |
| | | let dateTimeRule = ""; |
| | | |
| | | //年 |
| | | for (let i = 0; i < dictYear.length; i++) { |
| | | if (year === dictYear[i].label) { |
| | | dateTimeRule = dictYear[i].value |
| | | // this.form.startEndCode = startEndCode; |
| | | } |
| | | } |
| | | //月 |
| | | for (let i = 0; i < dictMonth.length; i++) { |
| | | if (month === dictMonth[i].label) { |
| | | dateTimeRule = dateTimeRule + dictMonth[i].value; |
| | | } |
| | | } |
| | | //日 |
| | | dateTimeRule = dateTimeRule + day; |
| | | this.form.dateTimeRule = dateTimeRule; |
| | | //赋值起始编码 |
| | | this.form.startEndCode = dateTimeRule + startCode + "----" + dateTimeRule + String(parseInt(startCode) + parseInt(planQty)-1).padStart(3, '0') ; |
| | | } |
| | | }, |
| | | |
| | | |
| | | getProductionNotice(){ |
| | | getProductionNotice(this.queryParams).then(response => { |
| | | this.$modal.msgSuccess("接收成功"); |
| | |
| | | console.log(response.data) |
| | | this.form = response.data; |
| | | this.Createopen = true; |
| | | this.titleName = "生成订单"; |
| | | this.titleName = "生成箱体条码"; |
| | | // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1); |
| | | }); |
| | | this.$modal.msgSuccess(Row.actualQty); |
| | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** 生成箱体条码提交按钮 */ |
| | | submitFormForBoxCode() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | addOrderSchedulingForBoxCode(this.form).then(response => { |
| | | this.$modal.msgSuccess("保存成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | |
| | | 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(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | } |