|
@@ -1,319 +1,319 @@
|
|
|
-<template>
|
|
|
- <div class="tabDiv">
|
|
|
- <el-table
|
|
|
- :key="tableKey"
|
|
|
- ref="table"
|
|
|
- v-loading="loading"
|
|
|
- :data="tableData.records"
|
|
|
- border
|
|
|
- fit
|
|
|
- row-key="taskNo"
|
|
|
- style="width: 100%;"
|
|
|
- :span-method="objectSpanMethod"
|
|
|
- @selection-change="onSelectChange"
|
|
|
- @cell-click="cellClick"
|
|
|
- >
|
|
|
- <!-- 序号 -->
|
|
|
- <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- CheckBox -->
|
|
|
- <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
|
|
|
- <!-- 订单编号 -->
|
|
|
- <el-table-column prop="orderNo" :label='$t("runCenter.table.plan.orderNo")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
- <!-- 订单名称 -->
|
|
|
- <el-table-column prop="orderName" :label='$t("runCenter.table.plan.orderName")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
- <!-- 计划编号 -->
|
|
|
- <el-table-column prop="planNo" :label='$t("runCenter.table.plan.planNo")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
- <!-- 产品 -->
|
|
|
- <el-table-column prop="bomDesc" :label='$t("runCenter.table.plan.bomName")' :show-overflow-tooltip="true" width="180"></el-table-column>
|
|
|
- <!-- 数量 -->
|
|
|
- <el-table-column prop="planBomNum" :label='$t("runCenter.table.plan.planNums")' :show-overflow-tooltip="true" width="120"></el-table-column>
|
|
|
- <!-- 交付日期 -->
|
|
|
- <el-table-column prop="pdeliveryTime" :label='$t("runCenter.table.plan.pdeliveryTime")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
- <!-- 计划开始日期 -->
|
|
|
- <el-table-column prop="startTime" :label='$t("runCenter.table.plan.planStart")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
- <!-- 计划完成日期 -->
|
|
|
- <el-table-column prop="endTime" :label='$t("runCenter.table.plan.planEnd")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
-
|
|
|
-
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <!-- 【分页】组件 -->
|
|
|
- <pagination
|
|
|
- v-show="tableData.total > 0"
|
|
|
- :limit.sync="queryParams.size"
|
|
|
- :page.sync="queryParams.current"
|
|
|
- :total="Number(tableData.total)"
|
|
|
- @pagination="fetch"
|
|
|
- />
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-
|
|
|
-<script>
|
|
|
-// 【分页】组件
|
|
|
-import Pagination from "@/components/Pagination"
|
|
|
-// 【仓库类型管理】-API
|
|
|
-import warehouseTypeMgrApi from "@/api/modelingCenter/warehouseTypeMgr"
|
|
|
-// 【计划管理】-API
|
|
|
-import planMgrApi from "@/api/runManageCenter/planMgr"
|
|
|
-// 列表查询的共通参数
|
|
|
-import { initQueryParams } from '@/utils/commons'
|
|
|
-export default {
|
|
|
- name: 'PprogTask',
|
|
|
- components: { Pagination },
|
|
|
- props: {
|
|
|
- orderData: Object,
|
|
|
- type: String
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- titleData: [], // table的动态表头数据
|
|
|
- qiyongStatus: [], //状态
|
|
|
- queryParams: initQueryParams({}),
|
|
|
- loading: false,
|
|
|
- tableKey: 0,
|
|
|
- tableData: {
|
|
|
- total: 0
|
|
|
- },
|
|
|
- tenant: {},
|
|
|
- selection: [],
|
|
|
- spanArr: [] //【订单编号】合并单元格
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
- created() {
|
|
|
- // 加载表头数据
|
|
|
- this.creatTestData()
|
|
|
- // 加载列表数据
|
|
|
- this.fetch()
|
|
|
- },
|
|
|
-
|
|
|
- computed: {
|
|
|
- },
|
|
|
-
|
|
|
- mounted () {
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- //获得数据相同的行数
|
|
|
- rowspanFiled(data, filed) {
|
|
|
- let spanArr5 = [];
|
|
|
- data.forEach((item,index) => {
|
|
|
- if( index === 0){
|
|
|
- spanArr5.push(1);
|
|
|
- this.position = 0;
|
|
|
- }else{
|
|
|
- if(data[index].orderNo === data[index-1].orderNo && data[index][filed] === data[index-1][filed]){
|
|
|
- spanArr5[this.position] += 1;
|
|
|
- spanArr5.push(0);
|
|
|
- }else{
|
|
|
- spanArr5.push(1);
|
|
|
- this.position = index;
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- return spanArr5;
|
|
|
- },
|
|
|
-
|
|
|
- //合并
|
|
|
- objectSpanMethod({ row, column, rowIndex, columnIndex }) { //表格合并行
|
|
|
- if (columnIndex === 2) {
|
|
|
- let _row = this.spanArr[rowIndex];
|
|
|
- let _col = _row > 0 ? 1 : 0;
|
|
|
- return {
|
|
|
- rowspan: _row,
|
|
|
- colspan: _col
|
|
|
- }
|
|
|
- }
|
|
|
- /*if(columnIndex === 1){
|
|
|
- let _row = this.spanArr2[rowIndex];
|
|
|
- let _col = _row > 0 ? 1 : 0;
|
|
|
- return {
|
|
|
- rowspan: _row,
|
|
|
- colspan: _col
|
|
|
- }
|
|
|
- }*/
|
|
|
- },
|
|
|
-
|
|
|
- onSelectChange (selection) {
|
|
|
- this.selection = selection
|
|
|
- },
|
|
|
-
|
|
|
- // 生产表头数据-函数
|
|
|
- creatTestData(){
|
|
|
- /*this.titleData = [
|
|
|
- {id: '100', text: '2020-10',
|
|
|
- children: [
|
|
|
- {id: '10001' text: '1', weekObj: {id: '100001', field: 'week', text: '日'}},
|
|
|
- {id: '10002', text: '2', weekObj: {id: '100002', field: 'week2', text: '一'}},
|
|
|
- {id: '10003', text: '3', weekObj: {id: '100003', field: 'week3', text: '二'}},
|
|
|
- {id: '10004', text: '4', weekObj: {id: '100004', field: 'week4', text: '三'}},
|
|
|
- {id: '10005', text: '5', weekObj: {id: '100005', field: 'week5', text: '四'}},
|
|
|
- {id: '10006', text: '6', weekObj: {id: '100006', field: 'week6', text: '五'}},
|
|
|
- {id: '10007', text: '7', weekObj: {id: '100007', field: 'week7', text: '六'}},
|
|
|
- {id: '10008', text: '8', weekObj: {id: '100008', field: 'week8', text: '一'}},
|
|
|
- {id: '10009', text: '9', weekObj: {id: '100009', field: 'week9', text: '二'}},
|
|
|
- {id: '100010', text: '10', weekObj: {id: '1000010', field: 'week10', text: '三'}},
|
|
|
- {id: '100011', text: '11', weekObj: {id: '1000011', field: 'week11', text: '四'}},
|
|
|
- {id: '100012', text: '12', weekObj: {id: '1000012', field: 'week12', text: '五'}}
|
|
|
- ]
|
|
|
- },
|
|
|
- {id: '102', text: '2020-11',
|
|
|
- children: [
|
|
|
- {id: '10201' text: '1', weekObj: {id: '102001', field: 'week', text: '日'}},
|
|
|
- {id: '10202', text: '2', weekObj: {id: '102002', field: 'week2', text: '一'}},
|
|
|
- {id: '10203', text: '3', weekObj: {id: '102003', field: 'week3', text: '二'}},
|
|
|
- {id: '10204', text: '4', weekObj: {id: '102004', field: 'week4', text: '三'}},
|
|
|
- {id: '10205', text: '5', weekObj: {id: '102005', field: 'week5', text: '四'}},
|
|
|
- {id: '10206', text: '6', weekObj: {id: '102006', field: 'week6', text: '五'}},
|
|
|
- {id: '10207', text: '7', weekObj: {id: '102007', field: 'week7', text: '六'}},
|
|
|
- {id: '10208', text: '8', weekObj: {id: '102008', field: 'week8', text: '一'}},
|
|
|
- {id: '10209', text: '9', weekObj: {id: '102009', field: 'week9', text: '二'}},
|
|
|
- {id: '102010', text: '10', weekObj: {id: '1020010', field: 'week10', text: '三'}},
|
|
|
- {id: '102011', text: '11', weekObj: {id: '1020011', field: 'week11', text: '四'}},
|
|
|
- {id: '102012', text: '12', weekObj: {id: '1020012', field: 'week12', text: '五'}}
|
|
|
- ]
|
|
|
- },
|
|
|
- {id: '103', text: '2020-12',
|
|
|
- children: [
|
|
|
- {id: '10301' text: '1', weekObj: {id: '103001', field: 'week', text: '日'}},
|
|
|
- {id: '10302', text: '2', weekObj: {id: '103002', field: 'week2', text: '一'}},
|
|
|
- {id: '10303', text: '3', weekObj: {id: '103003', field: 'week3', text: '二'}},
|
|
|
- {id: '10304', text: '4', weekObj: {id: '103004', field: 'week4', text: '三'}},
|
|
|
- {id: '10305', text: '5', weekObj: {id: '103005', field: 'week5', text: '四'}},
|
|
|
- {id: '10306', text: '6', weekObj: {id: '103006', field: 'week6', text: '五'}},
|
|
|
- {id: '10307', text: '7', weekObj: {id: '103007', field: 'week7', text: '六'}},
|
|
|
- {id: '10308', text: '8', weekObj: {id: '103008', field: 'week8', text: '一'}},
|
|
|
- {id: '10309', text: '9', weekObj: {id: '103009', field: 'week9', text: '二'}},
|
|
|
- {id: '103010', text: '10', weekObj: {id: '1030010', field: 'week10', text: '三'}},
|
|
|
- {id: '103011', text: '11', weekObj: {id: '1030011', field: 'week11', text: '四'}},
|
|
|
- {id: '103012', text: '12', weekObj: {id: '1030012', field: 'week12', text: '五'}}
|
|
|
- ]
|
|
|
- },
|
|
|
- ],*/
|
|
|
- // 生产30条数据
|
|
|
- let list = []
|
|
|
- for(let i = 0; i < 3; i++){
|
|
|
- list.push({
|
|
|
- id: '100' + i,
|
|
|
- text: "2020-1" + i,
|
|
|
- children: []
|
|
|
- })
|
|
|
- for(let j = 1; j < 25; j++){
|
|
|
- let week = ""
|
|
|
- if(j == 1 || j%7 == 0){
|
|
|
- week = "日"
|
|
|
- }
|
|
|
- if(j == 2 || j%7 == 1){
|
|
|
- week = "一"
|
|
|
- }
|
|
|
- if(j == 3 || j%7 == 2){
|
|
|
- week = "二"
|
|
|
- }
|
|
|
- if(j == 4 || j%7 == 3){
|
|
|
- week = "三"
|
|
|
- }
|
|
|
- if(j == 5 || j%7 == 4){
|
|
|
- week = "四"
|
|
|
- }
|
|
|
- if(j == 6 || j%7 == 5){
|
|
|
- week = "五"
|
|
|
- }
|
|
|
- if(j == 7 || j%7 == 6){
|
|
|
- week = "六"
|
|
|
- }
|
|
|
- list[i].children.push({
|
|
|
- id: '1000'+ j,
|
|
|
- text: ''+ j,
|
|
|
- weekObj: {
|
|
|
- id: '10000'+ j,
|
|
|
- field: 'week'+ j,
|
|
|
- text: week
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- // 赋值
|
|
|
- this.titleData = list
|
|
|
- console.log("表头数据:", this.titleData)
|
|
|
- },
|
|
|
-
|
|
|
- // tab点击-事件
|
|
|
- tabClick(e){
|
|
|
- // console.log("被选择的tab:", e.index)
|
|
|
- },
|
|
|
-
|
|
|
- // 带数据来
|
|
|
- setTenant (val) {
|
|
|
- if(val){
|
|
|
- this.tenant = { ...val }
|
|
|
- // 加载列表数据
|
|
|
- this.fetch();
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- // 列表数据查询
|
|
|
- fetch (params = {}) {
|
|
|
- // console.log("打印参数22:", this.orderData)
|
|
|
- this.loading = true
|
|
|
- if (this.queryParams.timeRange) {
|
|
|
- this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
|
|
|
- this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
|
|
|
- }
|
|
|
-
|
|
|
- // 分页,参数
|
|
|
- this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
- this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
- // 参数
|
|
|
- if(this.type == 'view'){
|
|
|
- this.queryParams.model.id = this.orderData.id
|
|
|
- }else{
|
|
|
- // 最新需求
|
|
|
- this.queryParams.model.planIds = this.orderData.planIds;
|
|
|
- }
|
|
|
-
|
|
|
- planMgrApi.page(this.queryParams).then(response => {
|
|
|
- const res = response.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.tableData = res.data
|
|
|
- // 要合并列的准备数据
|
|
|
- if(this.tableData.records.length > 0){
|
|
|
- this.spanArr = this.rowspanFiled(this.tableData.records, "orderNo")
|
|
|
- }
|
|
|
- }
|
|
|
- // eslint-disable-next-line no-return-assign
|
|
|
- }).finally(() => this.loading = false)
|
|
|
- },
|
|
|
-
|
|
|
- cellClick (row, column) {
|
|
|
- if (column['columnKey'] === "operation") {
|
|
|
- return
|
|
|
- }
|
|
|
- let flag = false
|
|
|
- this.selection.forEach((item) => {
|
|
|
- if (item.id === row.id) {
|
|
|
- flag = true
|
|
|
- this.$refs.table.toggleRowSelection(row)
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- if (!flag) {
|
|
|
- this.$refs.table.toggleRowSelection(row, true)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
- .tabDiv{
|
|
|
- margin: 10px;
|
|
|
- }
|
|
|
-</style>
|
|
|
+<template>
|
|
|
+ <div class="tabDiv">
|
|
|
+ <el-table
|
|
|
+ :key="tableKey"
|
|
|
+ ref="table"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ row-key="taskNo"
|
|
|
+ style="width: 100%;"
|
|
|
+ :span-method="objectSpanMethod"
|
|
|
+ @selection-change="onSelectChange"
|
|
|
+ @cell-click="cellClick"
|
|
|
+ >
|
|
|
+ <!-- 序号 -->
|
|
|
+ <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- CheckBox -->
|
|
|
+ <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
|
|
|
+ <!-- 订单编号 -->
|
|
|
+<!-- <el-table-column prop="orderNo" :label='$t("runCenter.table.plan.orderNo")' :show-overflow-tooltip="true"></el-table-column>-->
|
|
|
+ <!-- 订单名称 -->
|
|
|
+ <el-table-column prop="orderName" :label='$t("runCenter.table.plan.orderName")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
+ <!-- 计划编号 -->
|
|
|
+ <el-table-column prop="planNo" :label='$t("runCenter.table.plan.planNo")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
+ <!-- 产品 -->
|
|
|
+ <el-table-column prop="bomDesc" :label='$t("runCenter.table.plan.bomName")' :show-overflow-tooltip="true" width="180"></el-table-column>
|
|
|
+ <!-- 数量 -->
|
|
|
+ <el-table-column prop="planBomNum" :label='$t("runCenter.table.plan.planNums")' :show-overflow-tooltip="true" width="120"></el-table-column>
|
|
|
+ <!-- 交付日期 -->
|
|
|
+ <el-table-column prop="pdeliveryTime" :label='$t("runCenter.table.plan.pdeliveryTime")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
+ <!-- 计划开始日期 -->
|
|
|
+ <el-table-column prop="startTime" :label='$t("runCenter.table.plan.planStart")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
+ <!-- 计划完成日期 -->
|
|
|
+ <el-table-column prop="endTime" :label='$t("runCenter.table.plan.planEnd")' :show-overflow-tooltip="true" width="160"></el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 【分页】组件 -->
|
|
|
+ <pagination
|
|
|
+ v-show="tableData.total > 0"
|
|
|
+ :limit.sync="queryParams.size"
|
|
|
+ :page.sync="queryParams.current"
|
|
|
+ :total="Number(tableData.total)"
|
|
|
+ @pagination="fetch"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+
|
|
|
+<script>
|
|
|
+// 【分页】组件
|
|
|
+import Pagination from "@/components/Pagination"
|
|
|
+// 【仓库类型管理】-API
|
|
|
+import warehouseTypeMgrApi from "@/api/modelingCenter/warehouseTypeMgr"
|
|
|
+// 【计划管理】-API
|
|
|
+import planMgrApi from "@/api/runManageCenter/planMgr"
|
|
|
+// 列表查询的共通参数
|
|
|
+import { initQueryParams } from '@/utils/commons'
|
|
|
+export default {
|
|
|
+ name: 'PprogTask',
|
|
|
+ components: { Pagination },
|
|
|
+ props: {
|
|
|
+ orderData: Object,
|
|
|
+ type: String
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ titleData: [], // table的动态表头数据
|
|
|
+ qiyongStatus: [], //状态
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ loading: false,
|
|
|
+ tableKey: 0,
|
|
|
+ tableData: {
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ tenant: {},
|
|
|
+ selection: [],
|
|
|
+ spanArr: [] //【订单编号】合并单元格
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
+ created() {
|
|
|
+ // 加载表头数据
|
|
|
+ this.creatTestData()
|
|
|
+ // 加载列表数据
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+
|
|
|
+ computed: {
|
|
|
+ },
|
|
|
+
|
|
|
+ mounted () {
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ //获得数据相同的行数
|
|
|
+ rowspanFiled(data, filed) {
|
|
|
+ let spanArr5 = [];
|
|
|
+ data.forEach((item,index) => {
|
|
|
+ if( index === 0){
|
|
|
+ spanArr5.push(1);
|
|
|
+ this.position = 0;
|
|
|
+ }else{
|
|
|
+ if(data[index].orderNo === data[index-1].orderNo && data[index][filed] === data[index-1][filed]){
|
|
|
+ spanArr5[this.position] += 1;
|
|
|
+ spanArr5.push(0);
|
|
|
+ }else{
|
|
|
+ spanArr5.push(1);
|
|
|
+ this.position = index;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return spanArr5;
|
|
|
+ },
|
|
|
+
|
|
|
+ //合并
|
|
|
+ objectSpanMethod({ row, column, rowIndex, columnIndex }) { //表格合并行
|
|
|
+ if (columnIndex === 2) {
|
|
|
+ let _row = this.spanArr[rowIndex];
|
|
|
+ let _col = _row > 0 ? 1 : 0;
|
|
|
+ return {
|
|
|
+ rowspan: _row,
|
|
|
+ colspan: _col
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*if(columnIndex === 1){
|
|
|
+ let _row = this.spanArr2[rowIndex];
|
|
|
+ let _col = _row > 0 ? 1 : 0;
|
|
|
+ return {
|
|
|
+ rowspan: _row,
|
|
|
+ colspan: _col
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ },
|
|
|
+
|
|
|
+ onSelectChange (selection) {
|
|
|
+ this.selection = selection
|
|
|
+ },
|
|
|
+
|
|
|
+ // 生产表头数据-函数
|
|
|
+ creatTestData(){
|
|
|
+ /*this.titleData = [
|
|
|
+ {id: '100', text: '2020-10',
|
|
|
+ children: [
|
|
|
+ {id: '10001' text: '1', weekObj: {id: '100001', field: 'week', text: '日'}},
|
|
|
+ {id: '10002', text: '2', weekObj: {id: '100002', field: 'week2', text: '一'}},
|
|
|
+ {id: '10003', text: '3', weekObj: {id: '100003', field: 'week3', text: '二'}},
|
|
|
+ {id: '10004', text: '4', weekObj: {id: '100004', field: 'week4', text: '三'}},
|
|
|
+ {id: '10005', text: '5', weekObj: {id: '100005', field: 'week5', text: '四'}},
|
|
|
+ {id: '10006', text: '6', weekObj: {id: '100006', field: 'week6', text: '五'}},
|
|
|
+ {id: '10007', text: '7', weekObj: {id: '100007', field: 'week7', text: '六'}},
|
|
|
+ {id: '10008', text: '8', weekObj: {id: '100008', field: 'week8', text: '一'}},
|
|
|
+ {id: '10009', text: '9', weekObj: {id: '100009', field: 'week9', text: '二'}},
|
|
|
+ {id: '100010', text: '10', weekObj: {id: '1000010', field: 'week10', text: '三'}},
|
|
|
+ {id: '100011', text: '11', weekObj: {id: '1000011', field: 'week11', text: '四'}},
|
|
|
+ {id: '100012', text: '12', weekObj: {id: '1000012', field: 'week12', text: '五'}}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {id: '102', text: '2020-11',
|
|
|
+ children: [
|
|
|
+ {id: '10201' text: '1', weekObj: {id: '102001', field: 'week', text: '日'}},
|
|
|
+ {id: '10202', text: '2', weekObj: {id: '102002', field: 'week2', text: '一'}},
|
|
|
+ {id: '10203', text: '3', weekObj: {id: '102003', field: 'week3', text: '二'}},
|
|
|
+ {id: '10204', text: '4', weekObj: {id: '102004', field: 'week4', text: '三'}},
|
|
|
+ {id: '10205', text: '5', weekObj: {id: '102005', field: 'week5', text: '四'}},
|
|
|
+ {id: '10206', text: '6', weekObj: {id: '102006', field: 'week6', text: '五'}},
|
|
|
+ {id: '10207', text: '7', weekObj: {id: '102007', field: 'week7', text: '六'}},
|
|
|
+ {id: '10208', text: '8', weekObj: {id: '102008', field: 'week8', text: '一'}},
|
|
|
+ {id: '10209', text: '9', weekObj: {id: '102009', field: 'week9', text: '二'}},
|
|
|
+ {id: '102010', text: '10', weekObj: {id: '1020010', field: 'week10', text: '三'}},
|
|
|
+ {id: '102011', text: '11', weekObj: {id: '1020011', field: 'week11', text: '四'}},
|
|
|
+ {id: '102012', text: '12', weekObj: {id: '1020012', field: 'week12', text: '五'}}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {id: '103', text: '2020-12',
|
|
|
+ children: [
|
|
|
+ {id: '10301' text: '1', weekObj: {id: '103001', field: 'week', text: '日'}},
|
|
|
+ {id: '10302', text: '2', weekObj: {id: '103002', field: 'week2', text: '一'}},
|
|
|
+ {id: '10303', text: '3', weekObj: {id: '103003', field: 'week3', text: '二'}},
|
|
|
+ {id: '10304', text: '4', weekObj: {id: '103004', field: 'week4', text: '三'}},
|
|
|
+ {id: '10305', text: '5', weekObj: {id: '103005', field: 'week5', text: '四'}},
|
|
|
+ {id: '10306', text: '6', weekObj: {id: '103006', field: 'week6', text: '五'}},
|
|
|
+ {id: '10307', text: '7', weekObj: {id: '103007', field: 'week7', text: '六'}},
|
|
|
+ {id: '10308', text: '8', weekObj: {id: '103008', field: 'week8', text: '一'}},
|
|
|
+ {id: '10309', text: '9', weekObj: {id: '103009', field: 'week9', text: '二'}},
|
|
|
+ {id: '103010', text: '10', weekObj: {id: '1030010', field: 'week10', text: '三'}},
|
|
|
+ {id: '103011', text: '11', weekObj: {id: '1030011', field: 'week11', text: '四'}},
|
|
|
+ {id: '103012', text: '12', weekObj: {id: '1030012', field: 'week12', text: '五'}}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ ],*/
|
|
|
+ // 生产30条数据
|
|
|
+ let list = []
|
|
|
+ for(let i = 0; i < 3; i++){
|
|
|
+ list.push({
|
|
|
+ id: '100' + i,
|
|
|
+ text: "2020-1" + i,
|
|
|
+ children: []
|
|
|
+ })
|
|
|
+ for(let j = 1; j < 25; j++){
|
|
|
+ let week = ""
|
|
|
+ if(j == 1 || j%7 == 0){
|
|
|
+ week = "日"
|
|
|
+ }
|
|
|
+ if(j == 2 || j%7 == 1){
|
|
|
+ week = "一"
|
|
|
+ }
|
|
|
+ if(j == 3 || j%7 == 2){
|
|
|
+ week = "二"
|
|
|
+ }
|
|
|
+ if(j == 4 || j%7 == 3){
|
|
|
+ week = "三"
|
|
|
+ }
|
|
|
+ if(j == 5 || j%7 == 4){
|
|
|
+ week = "四"
|
|
|
+ }
|
|
|
+ if(j == 6 || j%7 == 5){
|
|
|
+ week = "五"
|
|
|
+ }
|
|
|
+ if(j == 7 || j%7 == 6){
|
|
|
+ week = "六"
|
|
|
+ }
|
|
|
+ list[i].children.push({
|
|
|
+ id: '1000'+ j,
|
|
|
+ text: ''+ j,
|
|
|
+ weekObj: {
|
|
|
+ id: '10000'+ j,
|
|
|
+ field: 'week'+ j,
|
|
|
+ text: week
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 赋值
|
|
|
+ this.titleData = list
|
|
|
+ console.log("表头数据:", this.titleData)
|
|
|
+ },
|
|
|
+
|
|
|
+ // tab点击-事件
|
|
|
+ tabClick(e){
|
|
|
+ // console.log("被选择的tab:", e.index)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 带数据来
|
|
|
+ setTenant (val) {
|
|
|
+ if(val){
|
|
|
+ this.tenant = { ...val }
|
|
|
+ // 加载列表数据
|
|
|
+ this.fetch();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 列表数据查询
|
|
|
+ fetch (params = {}) {
|
|
|
+ // console.log("打印参数22:", this.orderData)
|
|
|
+ this.loading = true
|
|
|
+ if (this.queryParams.timeRange) {
|
|
|
+ this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
|
|
|
+ this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
|
|
|
+ }
|
|
|
+
|
|
|
+ // 分页,参数
|
|
|
+ this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
+ this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
+ // 参数
|
|
|
+ if(this.type == 'view'){
|
|
|
+ this.queryParams.model.id = this.orderData.id
|
|
|
+ }else{
|
|
|
+ // 最新需求
|
|
|
+ this.queryParams.model.planIds = this.orderData.planIds;
|
|
|
+ }
|
|
|
+
|
|
|
+ planMgrApi.page(this.queryParams).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.tableData = res.data
|
|
|
+ // 要合并列的准备数据
|
|
|
+ if(this.tableData.records.length > 0){
|
|
|
+ this.spanArr = this.rowspanFiled(this.tableData.records, "orderNo")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-return-assign
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
+ },
|
|
|
+
|
|
|
+ cellClick (row, column) {
|
|
|
+ if (column['columnKey'] === "operation") {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let flag = false
|
|
|
+ this.selection.forEach((item) => {
|
|
|
+ if (item.id === row.id) {
|
|
|
+ flag = true
|
|
|
+ this.$refs.table.toggleRowSelection(row)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if (!flag) {
|
|
|
+ this.$refs.table.toggleRowSelection(row, true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .tabDiv{
|
|
|
+ margin: 10px;
|
|
|
+ }
|
|
|
+</style>
|