|
@@ -36,20 +36,23 @@
|
|
>
|
|
>
|
|
<el-table-column type="index" width="60"></el-table-column>
|
|
<el-table-column type="index" width="60"></el-table-column>
|
|
<el-table-column width="200">
|
|
<el-table-column width="200">
|
|
- <template slot="header">
|
|
|
|
- <el-checkbox>
|
|
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
|
+ <el-checkbox :model="checkBoxArray[0][0].value" @change="checkChanged(0,0)">
|
|
<span>模具名称</span>
|
|
<span>模具名称</span>
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
</template>
|
|
</template>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-checkbox>
|
|
|
|
|
|
+ <el-checkbox
|
|
|
|
+ :model="checkBoxArray[scope.row.id][0].value"
|
|
|
|
+ @change="checkChanged(scope.$index+1,0)"
|
|
|
|
+ >
|
|
<span>{{scope.row.name}}</span>
|
|
<span>{{scope.row.name}}</span>
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column width="200">
|
|
<el-table-column width="200">
|
|
- <template slot="header">
|
|
|
|
- <el-checkbox>
|
|
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
|
+ <el-checkbox :model="checkBoxArray[0][1].value" @change="checkChanged(0,1)">
|
|
<span>模具3D图档</span>
|
|
<span>模具3D图档</span>
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
</template>
|
|
</template>
|
|
@@ -57,13 +60,16 @@
|
|
<span v-if="scope.row.states[0] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-if="scope.row.states[0] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-else-if="scope.row.states[0] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else-if="scope.row.states[0] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else>
|
|
<span v-else>
|
|
- <el-checkbox>已通过</el-checkbox>
|
|
|
|
|
|
+ <el-checkbox
|
|
|
|
+ :model="checkBoxArray[scope.row.id][1].value"
|
|
|
|
+ @change="checkChanged(scope.$index+1,1)"
|
|
|
|
+ >已通过</el-checkbox>
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column width="200">
|
|
<el-table-column width="200">
|
|
- <template slot="header">
|
|
|
|
- <el-checkbox>
|
|
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
|
+ <el-checkbox :model="checkBoxArray[0][2].value" @change="checkChanged(0,2)">
|
|
<span>模具2D图档</span>
|
|
<span>模具2D图档</span>
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
</template>
|
|
</template>
|
|
@@ -71,13 +77,16 @@
|
|
<span v-if="scope.row.states[1] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-if="scope.row.states[1] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-else-if="scope.row.states[1] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else-if="scope.row.states[1] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else>
|
|
<span v-else>
|
|
- <el-checkbox>已通过</el-checkbox>
|
|
|
|
|
|
+ <el-checkbox
|
|
|
|
+ :model="checkBoxArray[scope.row.id][2].value"
|
|
|
|
+ @change="checkChanged(scope.$index+1,2)"
|
|
|
|
+ >已通过</el-checkbox>
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column width="200">
|
|
<el-table-column width="200">
|
|
- <template slot="header">
|
|
|
|
- <el-checkbox>
|
|
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
|
+ <el-checkbox :model="checkBoxArray[0][3].value" @change="checkChanged(0,3)">
|
|
<span>零件3D图档</span>
|
|
<span>零件3D图档</span>
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
</template>
|
|
</template>
|
|
@@ -85,13 +94,16 @@
|
|
<span v-if="scope.row.states[2] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-if="scope.row.states[2] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-else-if="scope.row.states[2] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else-if="scope.row.states[2] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else>
|
|
<span v-else>
|
|
- <el-checkbox>已通过</el-checkbox>
|
|
|
|
|
|
+ <el-checkbox
|
|
|
|
+ :model="checkBoxArray[scope.row.id][3].value"
|
|
|
|
+ @change="checkChanged(scope.$index+1,3)"
|
|
|
|
+ >已通过</el-checkbox>
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column width="200">
|
|
<el-table-column width="200">
|
|
- <template slot="header">
|
|
|
|
- <el-checkbox>
|
|
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
|
+ <el-checkbox :model="checkBoxArray[0][4].value" @change="checkChanged(0,4)">
|
|
<span>零件2D图档</span>
|
|
<span>零件2D图档</span>
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
</template>
|
|
</template>
|
|
@@ -99,13 +111,16 @@
|
|
<span v-if="scope.row.states[3] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-if="scope.row.states[3] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-else-if="scope.row.states[3] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else-if="scope.row.states[3] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else>
|
|
<span v-else>
|
|
- <el-checkbox>已通过</el-checkbox>
|
|
|
|
|
|
+ <el-checkbox
|
|
|
|
+ :model="checkBoxArray[scope.row.id][4].value"
|
|
|
|
+ @change="checkChanged(scope.$index+1,4)"
|
|
|
|
+ >已通过</el-checkbox>
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column width="200">
|
|
<el-table-column width="200">
|
|
- <template slot="header">
|
|
|
|
- <el-checkbox>
|
|
|
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
|
+ <el-checkbox :model="checkBoxArray[0][5].value" @change="checkChanged(0,5)">
|
|
<span>保养方案</span>
|
|
<span>保养方案</span>
|
|
</el-checkbox>
|
|
</el-checkbox>
|
|
</template>
|
|
</template>
|
|
@@ -113,7 +128,10 @@
|
|
<span v-if="scope.row.states[4] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-if="scope.row.states[4] == 0" style="padding-left: 24px;">未上传</span>
|
|
<span v-else-if="scope.row.states[4] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else-if="scope.row.states[4] == 1" style="padding-left: 24px;">审批中</span>
|
|
<span v-else>
|
|
<span v-else>
|
|
- <el-checkbox>已通过</el-checkbox>
|
|
|
|
|
|
+ <el-checkbox
|
|
|
|
+ :model="checkBoxArray[scope.row.id][5].value"
|
|
|
|
+ @change="checkChanged(scope.$index+1,5)"
|
|
|
|
+ >已通过</el-checkbox>
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -141,41 +159,23 @@ export default {
|
|
return {
|
|
return {
|
|
moulds: [
|
|
moulds: [
|
|
//临时数据
|
|
//临时数据
|
|
- {
|
|
|
|
- name: "墨盒类型1",
|
|
|
|
- states: [0, 1, 2, 0, 1]
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "墨盒类型2",
|
|
|
|
- states: [2, 0, 1, 2, 0]
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "墨盒类型3",
|
|
|
|
- states: [1, 2, 0, 1, 2]
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "墨盒类型4",
|
|
|
|
- states: [0, 1, 2, 0, 1]
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "墨盒类型5",
|
|
|
|
- states: [2, 0, 1, 2, 0]
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "墨盒类型6",
|
|
|
|
- states: [2, 2, 2, 2, 2]
|
|
|
|
- }
|
|
|
|
|
|
+ { id: 1, name: "墨盒类型1", states: [0, 1, 2, 0, 1] },
|
|
|
|
+ { id: 2, name: "墨盒类型2", states: [2, 0, 1, 2, 0] },
|
|
|
|
+ { id: 3, name: "墨盒类型3", states: [1, 2, 0, 1, 2] },
|
|
|
|
+ { id: 4, name: "墨盒类型4", states: [0, 1, 2, 0, 1] },
|
|
|
|
+ { id: 5, name: "墨盒类型5", states: [2, 0, 1, 2, 0] },
|
|
|
|
+ { id: 6, name: "墨盒类型6", states: [2, 2, 2, 2, 2] }
|
|
|
|
+ ],
|
|
|
|
+ checkBoxArray: [],
|
|
|
|
+ defaultItem: { value: false, able: true },
|
|
|
|
+ defaultLine: [
|
|
|
|
+ { value: false, able: true },
|
|
|
|
+ { value: false, able: true },
|
|
|
|
+ { value: false, able: true },
|
|
|
|
+ { value: false, able: true },
|
|
|
|
+ { value: false, able: true },
|
|
|
|
+ { value: false, able: true }
|
|
],
|
|
],
|
|
- // checkBoxArray: [],
|
|
|
|
- // defaultItem: { value: false, able: true },
|
|
|
|
- // defaultLine: [
|
|
|
|
- // { value: false, able: true },
|
|
|
|
- // { value: false, able: true },
|
|
|
|
- // { value: false, able: true },
|
|
|
|
- // { value: false, able: true },
|
|
|
|
- // { value: false, able: true },
|
|
|
|
- // { value: false, able: true }
|
|
|
|
- // ],
|
|
|
|
filters: {
|
|
filters: {
|
|
name: "",
|
|
name: "",
|
|
value: ""
|
|
value: ""
|
|
@@ -197,35 +197,43 @@ export default {
|
|
},
|
|
},
|
|
selsChange(sels) {
|
|
selsChange(sels) {
|
|
this.sels = sels;
|
|
this.sels = sels;
|
|
- }
|
|
|
|
|
|
+ },
|
|
// 点击复选框事件
|
|
// 点击复选框事件
|
|
- // checkChanged(x, y) {
|
|
|
|
- // this.checkBoxArray[x][y].value = !this.checkBoxArray[x][y].value;
|
|
|
|
- // console.log(
|
|
|
|
- // "x=" + x + " y=" + y + " value=" + this.checkBoxArray[x][y].value
|
|
|
|
- // );
|
|
|
|
- // console.log(this.checkBoxArray[0]);
|
|
|
|
- // }
|
|
|
|
|
|
+ checkChanged(y, x) {
|
|
|
|
+ this.checkBoxArray[y][x].value = !this.checkBoxArray[y][x].value;
|
|
|
|
+ // if (x == 0 && y == 0 && this.checkBoxArray[0][0].value == true) {
|
|
|
|
+ // for (var i = 0; i < this.checkBoxArray.length; i++) {
|
|
|
|
+ // for (var j = 0; j < this.checkBoxArray[i].length; j++) {
|
|
|
|
+ // if (this.checkBoxArray[i][j].able == true) {
|
|
|
|
+ // // this.checkBoxArray[i][j].value = true;
|
|
|
|
+ // this.$set(this.checkBoxArray[i], j, {value:true,able:true});
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ console.log("(" + x + ", " + y + ") " + this.checkBoxArray[y][x].value);
|
|
|
|
+ // console.log(this.checkBoxArray);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
let height = window.innerHeight;
|
|
let height = window.innerHeight;
|
|
this.tableHeight = height - 210;
|
|
this.tableHeight = height - 210;
|
|
|
|
|
|
//向checkBoxArray中push信息
|
|
//向checkBoxArray中push信息
|
|
- // this.checkBoxArray = [];
|
|
|
|
- // this.checkBoxArray.push(this.defaultLine);
|
|
|
|
- // this.moulds.forEach(mould => {
|
|
|
|
- // var checkBoxLine = [];
|
|
|
|
- // checkBoxLine.push(this.defaultItem);
|
|
|
|
- // for (var i = 0; i < 6; i++) {}
|
|
|
|
- // mould.states.forEach(state => {
|
|
|
|
- // var value = false;
|
|
|
|
- // var able = state == 2;
|
|
|
|
- // var item = { value, able };
|
|
|
|
- // checkBoxLine.push(item);
|
|
|
|
- // });
|
|
|
|
- // this.checkBoxArray.push(checkBoxLine);
|
|
|
|
- // });
|
|
|
|
|
|
+ this.checkBoxArray = [];
|
|
|
|
+ this.checkBoxArray.push(this.defaultLine);
|
|
|
|
+ this.moulds.forEach(mould => {
|
|
|
|
+ var checkBoxLine = [];
|
|
|
|
+ checkBoxLine.push(this.defaultItem);
|
|
|
|
+ for (var i = 0; i < 6; i++) {}
|
|
|
|
+ mould.states.forEach(state => {
|
|
|
|
+ var value = false;
|
|
|
|
+ var able = state == 2;
|
|
|
|
+ var item = { value, able };
|
|
|
|
+ checkBoxLine.push(item);
|
|
|
|
+ });
|
|
|
|
+ this.checkBoxArray.push(checkBoxLine);
|
|
|
|
+ });
|
|
},
|
|
},
|
|
mounted() {}
|
|
mounted() {}
|
|
};
|
|
};
|