|
@@ -65,7 +65,9 @@
|
|
|
:loading="loading"
|
|
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
|
|
class="j-table-force-nowrap"
|
|
|
- @change="handleTableChange">
|
|
|
+ @change="handleTableChange"
|
|
|
+ >
|
|
|
+
|
|
|
|
|
|
<template slot="htmlSlot" slot-scope="text">
|
|
|
<div v-html="text"></div>
|
|
@@ -119,6 +121,7 @@
|
|
|
import { mixinDevice } from '@/utils/mixin'
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import RegionRuleModal from './modules/RegionRuleModal'
|
|
|
+ import { httpAction } from '@/api/manage'
|
|
|
|
|
|
export default {
|
|
|
name: 'RegionRuleList',
|
|
@@ -153,73 +156,395 @@
|
|
|
},
|
|
|
{
|
|
|
title:'Last MON',
|
|
|
+ key: 'Last MON',
|
|
|
align:"center",
|
|
|
- dataIndex: 'lastMon'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'lastMon',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'Last TUE',
|
|
|
+ key:'Last TUE',
|
|
|
align:"center",
|
|
|
- dataIndex: 'lastTue'
|
|
|
+ width:"60px",
|
|
|
+ dataIndex: 'lastTue',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'Last WED',
|
|
|
+ key:'Last WED',
|
|
|
align:"center",
|
|
|
- dataIndex: 'lastWed'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'lastWed',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'Last THU',
|
|
|
+ key:'Last THU',
|
|
|
align:"center",
|
|
|
- dataIndex: 'lastThu'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'lastThu',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'Last FRI',
|
|
|
+ key:'Last FRI',
|
|
|
align:"center",
|
|
|
- dataIndex: 'lastFri'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'lastFri',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'Last SAT',
|
|
|
+ key:'Last SAT',
|
|
|
align:"center",
|
|
|
- dataIndex: 'lastFri'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'lastSat',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'Last SUN',
|
|
|
+ key:'Last SUN',
|
|
|
align:"center",
|
|
|
- dataIndex: 'lastFri'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'lastSun',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'MON',
|
|
|
+ key:'MON',
|
|
|
align:"center",
|
|
|
- dataIndex: 'mon'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'mon',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'TUE',
|
|
|
+ key:'TUE',
|
|
|
align:"center",
|
|
|
- dataIndex: 'tue'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'tue',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'WED',
|
|
|
+ key:'WED',
|
|
|
align:"center",
|
|
|
- dataIndex: 'wed'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'wed',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'THU',
|
|
|
+ key:'THU',
|
|
|
align:"center",
|
|
|
- dataIndex: 'thu'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'thu',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'FRI',
|
|
|
+ key:'FRI',
|
|
|
align:"center",
|
|
|
- dataIndex: 'fri'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'fri',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'SAT',
|
|
|
+ key:'SAT',
|
|
|
align:"center",
|
|
|
- dataIndex: 'fri'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'sat',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'SUN',
|
|
|
+ key:'SUN',
|
|
|
align:"center",
|
|
|
- dataIndex: 'fri'
|
|
|
+ width: "60px",
|
|
|
+ dataIndex: 'sun',
|
|
|
+ customRender: (t, r, index, column) => {
|
|
|
+ let that = this;
|
|
|
+ const child = that.$createElement('div', {
|
|
|
+ style: {
|
|
|
+ width: "60px"
|
|
|
+ },
|
|
|
+ domProps: {
|
|
|
+ innerHTML: t == null ? ' ' : t
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ dblclick: function() {
|
|
|
+ that.handleDoubleClick(r, t, column);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const obj = {
|
|
|
+ children: child,
|
|
|
+ attrs: {}
|
|
|
+ }
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title:'Schedule',
|
|
@@ -272,7 +597,33 @@
|
|
|
fieldList.push({type:'string',value:'thu',text:'thu',dictCode:''})
|
|
|
fieldList.push({type:'string',value:'fri',text:'fri',dictCode:''})
|
|
|
this.superFieldList = fieldList
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ handleDoubleClick(record, text, column) {
|
|
|
+ //选中的日期打勾,其余日期置空,并赋值给schedule
|
|
|
+ Object.keys(record).forEach(key => {
|
|
|
+ if(record[key] === "√") {
|
|
|
+ record[key] = null;
|
|
|
+ }
|
|
|
+ if(key == column.dataIndex) {
|
|
|
+ record[key] = "√";
|
|
|
+ record.schedule = column.key;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ httpAction("/regionRule/edit", record, 'post')
|
|
|
+ .then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ console.log("yes");
|
|
|
+ //this.loadData()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|