|
@@ -19,17 +19,18 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="OutSide_right">
|
|
|
- <el-link type="primary" :underline="false" @click="(deptSetDialog = true), getPlanDeptSet()">{{ "部门设置"
|
|
|
- }}</el-link>
|
|
|
- <el-link type="primary" :underline="false" @click="addPlan()">{{
|
|
|
- `新增${titleText}`
|
|
|
- }}</el-link>
|
|
|
- <el-upload ref="upload" action="#" :limit="1" :http-request="importData" :show-file-list="false">
|
|
|
- <el-link type="primary" :underline="false">{{ "导入" }}</el-link>
|
|
|
- </el-upload>
|
|
|
- <el-link type="primary" :underline="false" @click="exportData()"
|
|
|
- :download="this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '' + '.xlsx'">{{ "导出"
|
|
|
- }}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" @click="(deptSetDialog = true), getPlanDeptSet()">{{ "部门设置"
|
|
|
+ }}</el-link>
|
|
|
+ <el-link type="primary" :underline="false" @click="addPlan()">{{
|
|
|
+ `新增${titleText}`
|
|
|
+ }}</el-link>
|
|
|
+ <el-upload ref="upload" action="#" :limit="1" :http-request="importData" :show-file-list="false">
|
|
|
+ <el-link type="primary" :underline="false">{{ "导入" }}</el-link>
|
|
|
+ </el-upload>
|
|
|
+ <el-link type="primary" :underline="false" @click="exportData()"
|
|
|
+ :download="this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '' + '.xlsx'">{{
|
|
|
+ "导出"
|
|
|
+ }}</el-link>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -88,7 +89,7 @@
|
|
|
<div class="planDialog">
|
|
|
<el-form ref="todayPlanForm" :rules="todayPlanFormrules" :model="todayPlanForm" label-width="120px">
|
|
|
<el-form-item label="排产工单号" style="width: 100%" prop="productSchedulingNum">
|
|
|
- <el-input v-model="todayPlanForm.productSchedulingNum"></el-input>
|
|
|
+ <el-input v-model="todayPlanForm.productSchedulingNum" maxlength="50"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产品名称" style="width: 100%" prop="productId">
|
|
|
<el-select v-model="todayPlanForm.productId" placeholder="请选择" class="w100">
|
|
@@ -97,18 +98,21 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="项目代码" style="width: 100%" prop="projectCode">
|
|
|
- <el-input v-model="todayPlanForm.projectCode"></el-input>
|
|
|
+ <el-input v-model="todayPlanForm.projectCode" maxlength="50"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="钢印号" style="width: 100%" prop="steelStampNumberStart">
|
|
|
- <el-input class="w45" v-model="todayPlanForm.steelStampNumberStart"></el-input>
|
|
|
+ <el-input class="w45" v-model="todayPlanForm.steelStampNumberStart" maxlength="20"></el-input>
|
|
|
{{ "-" }}
|
|
|
- <el-input class="w45" v-model="todayPlanForm.steelStampNumberEnd"></el-input>
|
|
|
+ <el-input class="w45" v-model="todayPlanForm.steelStampNumberEnd" maxlength="20"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="进度" style="width: 100%" prop="progress">
|
|
|
+ <el-input v-model="todayPlanForm.progress" maxlength="20"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="数量" prop="num">
|
|
|
- <el-input v-model="todayPlanForm.num"></el-input>
|
|
|
+ <el-input v-model="todayPlanForm.num" maxlength="10"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="主工序" prop="mainProcess">
|
|
|
- <el-input v-model="todayPlanForm.mainProcess"></el-input>
|
|
|
+ <el-input v-model="todayPlanForm.mainProcess" maxlength="50"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="工位" prop="stationId">
|
|
|
<!-- <el-select v-model="todayPlanForm.stationId" placeholder="请选择" class="w100" @change="getIncharger()">
|
|
@@ -125,7 +129,7 @@
|
|
|
</el-cascader>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="工长" prop="foremanName">
|
|
|
- <el-input v-model="todayPlanForm.foremanName"></el-input>
|
|
|
+ <el-input v-model="todayPlanForm.foremanName" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开工时间" prop="startDate">
|
|
|
<el-date-picker class="w100" v-model="todayPlanForm.startDate" type="date" placeholder="选择日期"
|
|
@@ -138,7 +142,7 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="描述" style="width: 100%">
|
|
|
- <el-input type="textarea" :rows="6" placeholder="请输入描述" v-model="todayPlanForm.describtion">
|
|
|
+ <el-input type="textarea" :rows="6" placeholder="请输入描述" v-model="todayPlanForm.describtion" maxlength="200">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -210,6 +214,7 @@ export default {
|
|
|
steelStampNumberEnd: "",
|
|
|
num: "",
|
|
|
mainProcess: "",
|
|
|
+ progress: "",
|
|
|
stationId: "",
|
|
|
foremanId: "",
|
|
|
foremanName: "",
|
|
@@ -311,7 +316,7 @@ export default {
|
|
|
this.departmentIdArray,
|
|
|
JSON.stringify(this.departmentIdArray)
|
|
|
);
|
|
|
- // return
|
|
|
+ return
|
|
|
let arr = [];
|
|
|
for (var i in this.departmentIdArray) {
|
|
|
arr.push(
|
|
@@ -353,8 +358,15 @@ export default {
|
|
|
for (var i in arr) {
|
|
|
arr[i] = +arr[i];
|
|
|
}
|
|
|
- console.log(arr);
|
|
|
- this.departmentIdArray = arr;
|
|
|
+ // console.log(arr)
|
|
|
+ // let newArr = []
|
|
|
+ // for(let j in arr) {
|
|
|
+ // console.log(arr[j])
|
|
|
+ // newArr.push(this.findAncestorsById(this.departmentList, arr[j]))
|
|
|
+ // }
|
|
|
+ // console.log(newArr)
|
|
|
+ // this.departmentIdArray = arr;
|
|
|
+ this.handleDepartmentIdArray(arr)
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -370,6 +382,34 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
+ handleDepartmentIdArray(arr) {
|
|
|
+ console.log(arr, '过来的值')
|
|
|
+ let newArr = []
|
|
|
+ for (var i in arr) {
|
|
|
+ newArr.push(this.findAncestorsById(this.departmentList, arr[i]))
|
|
|
+ }
|
|
|
+ console.log(this.departmentIdArray, '===>')
|
|
|
+ this.departmentIdArray = newArr;
|
|
|
+ },
|
|
|
+ // 递归回显人员
|
|
|
+ findAncestorsById(tree, value, result = []) {
|
|
|
+ for (const node of tree) {
|
|
|
+ if (node.value === value) {
|
|
|
+ return [...result, node.value];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (node.children) {
|
|
|
+ const temp = this.findAncestorsById(node.children, value, [
|
|
|
+ ...result,
|
|
|
+ node.value,
|
|
|
+ ]);
|
|
|
+ if (temp) {
|
|
|
+ return temp;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ },
|
|
|
getHasSetPlanDeptList() {
|
|
|
this.http.post(
|
|
|
"/plan/hasSetDeptDetail",
|
|
@@ -467,8 +507,8 @@ export default {
|
|
|
this.todayPlanForm.stationId[
|
|
|
this.todayPlanForm.stationId.length - 1
|
|
|
];
|
|
|
- this.$delete(this.todayPlanForm, 'product')
|
|
|
- this.$delete(this.todayPlanForm, 'planProcedureTotals')
|
|
|
+ this.$delete(this.todayPlanForm, 'product')
|
|
|
+ this.$delete(this.todayPlanForm, 'planProcedureTotals')
|
|
|
this.http.post(
|
|
|
"/plan/addOrUpdatePlan",
|
|
|
{
|
|
@@ -484,7 +524,8 @@ export default {
|
|
|
type: "success",
|
|
|
});
|
|
|
this.editPlanDiaLog = false;
|
|
|
- this.getTableData(this.hasChooseDept);
|
|
|
+ this.todayPlanForm = [];
|
|
|
+ this.getTableData(this.hasChooseDept);
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -627,7 +668,7 @@ export default {
|
|
|
if (res.code == "ok") {
|
|
|
var filePath = res.data;
|
|
|
const a = document.createElement('a'); // 创建a标签
|
|
|
- a.setAttribute('download',(this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '')+ '.xlsx');// download属性
|
|
|
+ a.setAttribute('download', (this.planType == 0 ? '今日计划' : this.planType == 1 ? '明日计划' : this.planType == 2 ? '插单计划' : '') + '.xlsx');// download属性
|
|
|
a.setAttribute('href', filePath);// href链接
|
|
|
a.click(); //自执行点击事件
|
|
|
a.remove();
|
|
@@ -762,6 +803,7 @@ export default {
|
|
|
.OutSide_right {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+
|
|
|
.el-link {
|
|
|
margin-right: 15px;
|
|
|
}
|