|
@@ -9,8 +9,8 @@
|
|
|
<div class="OutSide_center">
|
|
|
<div class="block">
|
|
|
<span class="demonstration">查询以往{{ titleText }}</span>
|
|
|
- <el-date-picker v-model="planDate" type="date" value-format="yyyy-MM-dd" @change="getTableData(hasChooseDept)"
|
|
|
- placeholder="选择日期" size="small">
|
|
|
+ <el-date-picker v-model="planDate" type="date" value-format="yyyy-MM-dd" :clearable="false" @change="getTableData(hasChooseDept)"
|
|
|
+ placeholder="选择日期" size="small" :picker-options="planType == 1 ? toMPickerOptions : todayPickerOptions">
|
|
|
</el-date-picker>
|
|
|
</div>
|
|
|
<div class="OutSide" style="padding-bottom: 0;">
|
|
@@ -129,11 +129,11 @@
|
|
|
</el-cascader>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="工长" prop="foremanName">
|
|
|
- <el-input v-model="todayPlanForm.foremanName" disabled></el-input>
|
|
|
+ <el-input v-model="todayPlanForm.foremanName" readonly></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开工时间" prop="startDate">
|
|
|
<el-date-picker class="w100" v-model="todayPlanForm.startDate" type="date" placeholder="选择日期"
|
|
|
- value-format="yyyy-MM-dd">
|
|
|
+ value-format="yyyy-MM-dd" readonly>
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="完工时间" prop="endDate">
|
|
@@ -196,6 +196,16 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ todayPickerOptions: {
|
|
|
+ disabledDate(v) {
|
|
|
+ return v.getTime() > Date.now();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toMPickerOptions: {
|
|
|
+ disabledDate(v) {
|
|
|
+ return v.getTime() < Date.now();
|
|
|
+ }
|
|
|
+ },
|
|
|
steelStampNumber: "",
|
|
|
planDate: this.todayDate,
|
|
|
deptSetDialog: false,
|
|
@@ -218,7 +228,7 @@ export default {
|
|
|
stationId: "",
|
|
|
foremanId: "",
|
|
|
foremanName: "",
|
|
|
- startDate: "",
|
|
|
+ startDate: this.todayDate,
|
|
|
endDate: "",
|
|
|
describtion: "",
|
|
|
versionNumber: "",
|
|
@@ -240,12 +250,12 @@ export default {
|
|
|
],
|
|
|
productId: [{ required: true, message: "产品名称", trigger: "blur" }],
|
|
|
projectCode: [{ required: true, message: "项目代码", trigger: "blur" }],
|
|
|
- steelStampNumberStart: [
|
|
|
- { required: true, message: "钢印号", trigger: "blur" },
|
|
|
- ],
|
|
|
- steelStampNumberEnd: [
|
|
|
- { required: true, message: "钢印号", trigger: "blur" },
|
|
|
- ],
|
|
|
+ // steelStampNumberStart: [
|
|
|
+ // { required: true, message: "钢印号", trigger: "blur" },
|
|
|
+ // ],
|
|
|
+ // steelStampNumberEnd: [
|
|
|
+ // { required: true, message: "钢印号", trigger: "blur" },
|
|
|
+ // ],
|
|
|
num: [{ required: true, message: "数量", trigger: "blur" }],
|
|
|
mainProcess: [{ required: true, message: "主工序", trigger: "blur" }],
|
|
|
stationId: [{ required: true, message: "工位", trigger: "blur" }],
|
|
@@ -258,6 +268,7 @@ export default {
|
|
|
watch: {},
|
|
|
created() { },
|
|
|
mounted() {
|
|
|
+ console.log(this.planType, '费雷')
|
|
|
this.getDepartmentList(),
|
|
|
this.getPlanDeptSet(),
|
|
|
this.getHasSetPlanDeptList(),
|
|
@@ -316,7 +327,6 @@ export default {
|
|
|
this.departmentIdArray,
|
|
|
JSON.stringify(this.departmentIdArray)
|
|
|
);
|
|
|
- return
|
|
|
let arr = [];
|
|
|
for (var i in this.departmentIdArray) {
|
|
|
arr.push(
|
|
@@ -493,13 +503,60 @@ export default {
|
|
|
},
|
|
|
addPlan() {
|
|
|
this.titleName = `新增${this.titleText}`;
|
|
|
+ this.initTodayPlanForm()
|
|
|
this.editPlanDiaLog = true;
|
|
|
this.getDepartmentList();
|
|
|
this.getProductList();
|
|
|
// this.todayPlanForm
|
|
|
},
|
|
|
+ // 初始化 Form
|
|
|
+ initTodayPlanForm() {
|
|
|
+ this.todayPlanForm = {
|
|
|
+ id: null,
|
|
|
+ productSchedulingNum: "",
|
|
|
+ productId: "",
|
|
|
+ projectCode: "",
|
|
|
+ steelStampNumberStart: "",
|
|
|
+ steelStampNumberEnd: "",
|
|
|
+ num: "",
|
|
|
+ mainProcess: "",
|
|
|
+ progress: "",
|
|
|
+ stationId: "",
|
|
|
+ foremanId: "",
|
|
|
+ foremanName: "",
|
|
|
+ startDate: this.todayDate,
|
|
|
+ endDate: "",
|
|
|
+ describtion: "",
|
|
|
+ versionNumber: "",
|
|
|
+ }
|
|
|
+ },
|
|
|
addPlanData(formName) {
|
|
|
console.log(this.todayPlanForm);
|
|
|
+ if(!this.todayPlanForm.steelStampNumberStart){
|
|
|
+ if(this.todayPlanForm.steelStampNumberEnd){
|
|
|
+ this.$message({
|
|
|
+ message:"钢印号区间填写不完整",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!this.todayPlanForm.steelStampNumberEnd){
|
|
|
+ if(this.todayPlanForm.steelStampNumberStart){
|
|
|
+ this.$message({
|
|
|
+ message:"钢印号区间填写不完整",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.todayPlanForm.endDate<this.todayPlanForm.startDate){
|
|
|
+ this.$message({
|
|
|
+ message:"完工日期不能小于开工日期",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
console.log(this.todayPlanForm, "传给后端的值");
|
|
@@ -524,7 +581,6 @@ export default {
|
|
|
type: "success",
|
|
|
});
|
|
|
this.editPlanDiaLog = false;
|
|
|
- this.todayPlanForm = [];
|
|
|
this.getTableData(this.hasChooseDept);
|
|
|
} else {
|
|
|
this.$message({
|