Merge branch 'master' of http://192.168.0.112:10010/r/高精2.0
This commit is contained in:
25
src/api/BasicData/FactoryCalendar.js
Normal file
25
src/api/BasicData/FactoryCalendar.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import request from '@/utils/request'
|
||||
// 初始化日历
|
||||
export function initClendar(year, month) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理工艺_基础表_工作日历_获得状态',
|
||||
param: '工作年=' + year + '&工作月=' + month
|
||||
}
|
||||
})
|
||||
}
|
||||
// 修改工作状态
|
||||
export function changeState(time, code) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '车间生产管理工艺_基础表_工作日历_设置状态',
|
||||
param: '工作日期=' + time + '&工作日状态=' + code
|
||||
}
|
||||
})
|
||||
}
|
||||
63
src/api/BasicData/ShiftManagement.js
Normal file
63
src/api/BasicData/ShiftManagement.js
Normal file
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询班次
|
||||
export function getScheduling(SchedulingType) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '设备管理_基础表_班次表_查询数据',
|
||||
param: '班次类型=' + SchedulingType
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询班次
|
||||
export function searchProgramme() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: 'dbo.设备管理_基础表_班次表_查询数据'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 新增班次
|
||||
export function addShift(starttime, endtime, shifttype, shiftnumber, nightwork, work, temporary, difficult, note) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '设备管理_基础表_班次表_增加数据',
|
||||
param: '开始工作时间=' + starttime + '&结束工作时间=' + endtime + '&班次类型=' + shifttype + '&班次代码=' + shiftnumber + '&是否夜班=' + nightwork + '&是否工作=' + work + '=int&是否可以安排临时件=' + temporary + '=int&是否可以安排高难度件=' + difficult + '=int&备注=' + note
|
||||
}
|
||||
})
|
||||
}
|
||||
// 编辑班次
|
||||
export function editShift(shiftCode, starttime, endtime, shifttype, shiftnumber, nightwork, work, temporary, difficult, note) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '设备管理_基础表_班次表_修改数据',
|
||||
param: '序号=' + shiftCode + '=int&开始工作时间=' + starttime + '=datetime&结束工作时间=' + endtime + '=datetime&班次类型=' + shifttype + '=int&班次代码=' + shiftnumber + '=int&是否夜班=' + nightwork + '=int&是否工作=' + work + '=int&是否可以安排临时件=' + temporary + '=int&是否可以安排高难度件=' + difficult + '=int&备注=' + note
|
||||
}
|
||||
})
|
||||
}
|
||||
// 删除班次
|
||||
export function deleteShift(shiftCode) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '设备管理_基础表_班次表_删除数据',
|
||||
param: '序号=' + shiftCode
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export function searchAlterRecord(pageCurrent, pageSize, project_check, project,
|
||||
}
|
||||
})
|
||||
}
|
||||
// 修改记录查询
|
||||
// 异常记录查询
|
||||
export function searchErrorRecord(pageCurrent, pageSize, project_check, project, machine_check, machine, group_check, group) {
|
||||
return request({
|
||||
url: '',
|
||||
|
||||
@@ -8,7 +8,7 @@ export function searchtable(num1, num2, num3, num4, pageCurrent, pageSize) {
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理工艺_零件工艺计划_编制工艺_备料零件查询',
|
||||
param: '零件图号_check=' + num1 + '&零件图号=' + num2 + '&备料打印_check=' + num3 + '&备料打印=' + num4,
|
||||
param: '零件图号_check=' + num1 + '&零件图号=' + num2 + '&备料打印_check=' + num3 + '&备料打印=' + num4 + '&备料到货=0',
|
||||
Pagination: pageCurrent + '&' + pageSize
|
||||
}
|
||||
})
|
||||
|
||||
51
src/api/ManufacturingCenter/MaterialArrivalManagement.js
Normal file
51
src/api/ManufacturingCenter/MaterialArrivalManagement.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询零件
|
||||
export function searchtable(num1, num2, num3, pageCurrent, pageSize) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理工艺_零件工艺计划_编制工艺_备料到货查询',
|
||||
param: '零件图号_check=' + num1 + '&零件图号=' + num2 + '&备料到货_check=' + num3,
|
||||
Pagination: pageCurrent + '&' + pageSize
|
||||
}
|
||||
})
|
||||
}
|
||||
// 查询零件工艺
|
||||
export function searchtable2(num1) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '车间生产管理工艺_备料打印_查询工序信息',
|
||||
param: '工艺计划流水号=' + num1
|
||||
}
|
||||
})
|
||||
}
|
||||
// 更改打印状态
|
||||
export function edit(num1) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '车间生产管理工艺_备料到货_状态更改',
|
||||
param: '工艺计划流水号=' + num1
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function handlechange(Number, code) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '车间生产管理工艺_零件工序_修改数据_工作者',
|
||||
param: '工序流水号=' + Number + '&工作者考勤编号=' + code
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -8,7 +8,7 @@ export function initCraftmen() {
|
||||
data: {
|
||||
type: '1',
|
||||
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
|
||||
param: '考核部门编号=9'
|
||||
param: '考核部门编号=17'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ export function initPerson() {
|
||||
data: {
|
||||
type: '1',
|
||||
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
|
||||
param: '考核部门编号=9'
|
||||
param: '考核部门编号=17'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export function getPerson() {
|
||||
data: {
|
||||
type: '1',
|
||||
name: '人事档案管理_人员_部门与人员_查询数据_根据部门编号',
|
||||
param: '考核部门编号=9'
|
||||
param: '考核部门编号=17'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
57
src/api/MarketingCenter/PerformanceBond.js
Normal file
57
src/api/MarketingCenter/PerformanceBond.js
Normal file
@@ -0,0 +1,57 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function initProject() {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '合同信息管理_项目名称_总_查询'
|
||||
}
|
||||
})
|
||||
}
|
||||
export function searchTableData1(pageCurrent, pageSize, num1, num2, num3, num4, num5, num6) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '合同信息管理_履约保证金_合同信息统计_查询',
|
||||
param: '项目流水号=' + num1 + '=int&项目流水号_check=' + num2 + '=int&开始日期_check=' + num3 + '=int&结束日期_check=' + num4 + '=int&开始日期=' + num5 + '=date&结束日期=' + num6 + '=date',
|
||||
Pagination: pageCurrent + '&' + pageSize
|
||||
}
|
||||
})
|
||||
}
|
||||
export function typeOfPerformanceBond(num1) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '合同信息管理_履约保证金类型_查询',
|
||||
param: '项目流水号=' + num1 + '=int'
|
||||
}
|
||||
})
|
||||
}
|
||||
export function searchTableData2(num1) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '1',
|
||||
name: '合同信息管理_履约保证金_查询',
|
||||
param: '项目流水号=' + num1 + '=int'
|
||||
}
|
||||
})
|
||||
}
|
||||
export function takeBack(num1, num2) {
|
||||
return request({
|
||||
url: '',
|
||||
method: 'post',
|
||||
data: {
|
||||
type: '2',
|
||||
name: '合同信息管理_履约保证金_收回',
|
||||
param: '履约保证金流水号=' + num1 + '=int&实际收回日期=' + num2 + '=string'
|
||||
}
|
||||
})
|
||||
}
|
||||
526
src/components/Calendar/calendar.js
Normal file
526
src/components/Calendar/calendar.js
Normal file
@@ -0,0 +1,526 @@
|
||||
/**
|
||||
* @1900-2100区间内的公历、农历互转
|
||||
* @charset UTF-8
|
||||
* @Author Jea杨(JJonline@JJonline.Cn)
|
||||
* @Time 2014-7-21
|
||||
* @Time 2016-8-13 Fixed 2033hex、Attribution Annals
|
||||
* @Time 2016-9-25 Fixed lunar LeapMonth Param Bug
|
||||
* @Version 1.0.2
|
||||
* @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
|
||||
* @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
|
||||
*/
|
||||
/* eslint-disable */
|
||||
var calendar = {
|
||||
|
||||
/**
|
||||
* 农历1900-2100的润大小信息表
|
||||
* @Array Of Property
|
||||
* @return Hex
|
||||
*/
|
||||
lunarInfo:[0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,//1900-1909
|
||||
0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,//1910-1919
|
||||
0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,//1920-1929
|
||||
0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,//1930-1939
|
||||
0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,//1940-1949
|
||||
0x06ca0,0x0b550,0x15355,0x04da0,0x0a5b0,0x14573,0x052b0,0x0a9a8,0x0e950,0x06aa0,//1950-1959
|
||||
0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,//1960-1969
|
||||
0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b6a0,0x195a6,//1970-1979
|
||||
0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,//1980-1989
|
||||
0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,//1990-1999
|
||||
0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,//2000-2009
|
||||
0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,//2010-2019
|
||||
0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,//2020-2029
|
||||
0x05aa0,0x076a3,0x096d0,0x04afb,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,//2030-2039
|
||||
0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0,//2040-2049
|
||||
/**Add By JJonline@JJonline.Cn**/
|
||||
0x14b63,0x09370,0x049f8,0x04970,0x064b0,0x168a6,0x0ea50, 0x06b20,0x1a6c4,0x0aae0,//2050-2059
|
||||
0x0a2e0,0x0d2e3,0x0c960,0x0d557,0x0d4a0,0x0da50,0x05d55,0x056a0,0x0a6d0,0x055d4,//2060-2069
|
||||
0x052d0,0x0a9b8,0x0a950,0x0b4a0,0x0b6a6,0x0ad50,0x055a0,0x0aba4,0x0a5b0,0x052b0,//2070-2079
|
||||
0x0b273,0x06930,0x07337,0x06aa0,0x0ad50,0x14b55,0x04b60,0x0a570,0x054e4,0x0d160,//2080-2089
|
||||
0x0e968,0x0d520,0x0daa0,0x16aa6,0x056d0,0x04ae0,0x0a9d4,0x0a2d0,0x0d150,0x0f252,//2090-2099
|
||||
0x0d520],//2100
|
||||
|
||||
/**
|
||||
* 公历每个月份的天数普通表
|
||||
* @Array Of Property
|
||||
* @return Number
|
||||
*/
|
||||
solarMonth:[31,28,31,30,31,30,31,31,30,31,30,31],
|
||||
|
||||
/**
|
||||
* 天干地支之天干速查表
|
||||
* @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
|
||||
* @return Cn string
|
||||
*/
|
||||
Gan:["\u7532","\u4e59","\u4e19","\u4e01","\u620a","\u5df1","\u5e9a","\u8f9b","\u58ec","\u7678"],
|
||||
|
||||
/**
|
||||
* 天干地支之地支速查表
|
||||
* @Array Of Property
|
||||
* @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
|
||||
* @return Cn string
|
||||
*/
|
||||
Zhi:["\u5b50","\u4e11","\u5bc5","\u536f","\u8fb0","\u5df3","\u5348","\u672a","\u7533","\u9149","\u620c","\u4ea5"],
|
||||
|
||||
/**
|
||||
* 天干地支之地支速查表<=>生肖
|
||||
* @Array Of Property
|
||||
* @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
|
||||
* @return Cn string
|
||||
*/
|
||||
Animals:["\u9f20","\u725b","\u864e","\u5154","\u9f99","\u86c7","\u9a6c","\u7f8a","\u7334","\u9e21","\u72d7","\u732a"],
|
||||
|
||||
/**
|
||||
* 24节气速查表
|
||||
* @Array Of Property
|
||||
* @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
|
||||
* @return Cn string
|
||||
*/
|
||||
solarTerm:["\u5c0f\u5bd2","\u5927\u5bd2","\u7acb\u6625","\u96e8\u6c34","\u60ca\u86f0","\u6625\u5206","\u6e05\u660e","\u8c37\u96e8","\u7acb\u590f","\u5c0f\u6ee1","\u8292\u79cd","\u590f\u81f3","\u5c0f\u6691","\u5927\u6691","\u7acb\u79cb","\u5904\u6691","\u767d\u9732","\u79cb\u5206","\u5bd2\u9732","\u971c\u964d","\u7acb\u51ac","\u5c0f\u96ea","\u5927\u96ea","\u51ac\u81f3"],
|
||||
|
||||
/**
|
||||
* 1900-2100各年的24节气日期速查表
|
||||
* @Array Of Property
|
||||
* @return 0x string For splice
|
||||
*/
|
||||
sTermInfo:['9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf97c3598082c95f8c965cc920f',
|
||||
'97bd0b06bdb0722c965ce1cfcc920f','b027097bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf97c359801ec95f8c965cc920f','97bd0b06bdb0722c965ce1cfcc920f','b027097bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f','97bd0b06bdb0722c965ce1cfcc920f',
|
||||
'b027097bd097c36b0b6fc9274c91aa','9778397bd19801ec9210c965cc920e','97b6b97bd19801ec95f8c965cc920f',
|
||||
'97bd09801d98082c95f8e1cfcc920f','97bd097bd097c36b0b6fc9210c8dc2','9778397bd197c36c9210c9274c91aa',
|
||||
'97b6b97bd19801ec95f8c965cc920e','97bd09801d98082c95f8e1cfcc920f','97bd097bd097c36b0b6fc9210c8dc2',
|
||||
'9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec95f8c965cc920e','97bcf97c3598082c95f8e1cfcc920f',
|
||||
'97bd097bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf97c3598082c95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c965cc920e','97bcf97c3598082c95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722',
|
||||
'9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f',
|
||||
'97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf97c359801ec95f8c965cc920f','97bd097bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c965cc920e','97bcf97c359801ec95f8c965cc920f','97bd097bd07f595b0b6fc920fb0722',
|
||||
'9778397bd097c36b0b6fc9210c8dc2','9778397bd19801ec9210c9274c920e','97b6b97bd19801ec95f8c965cc920f',
|
||||
'97bd07f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c920e',
|
||||
'97b6b97bd19801ec95f8c965cc920f','97bd07f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2',
|
||||
'9778397bd097c36c9210c9274c91aa','97b6b97bd19801ec9210c965cc920e','97bd07f1487f595b0b0bc920fb0722',
|
||||
'7f0e397bd097c36b0b6fc9210c8dc2','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf7f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c965cc920e','97bcf7f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
|
||||
'9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e','97bcf7f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b97bd19801ec9210c965cc920e',
|
||||
'97bcf7f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b97bd19801ec9210c9274c920e','97bcf7f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
|
||||
'9778397bd097c36b0b6fc9210c91aa','97b6b97bd197c36c9210c9274c920e','97bcf7f0e47f531b0b0bb0b6fb0722',
|
||||
'7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9210c8dc2','9778397bd097c36c9210c9274c920e',
|
||||
'97b6b7f0e47f531b0723b0b6fb0722','7f0e37f5307f595b0b0bc920fb0722','7f0e397bd097c36b0b6fc9210c8dc2',
|
||||
'9778397bd097c36b0b70c9274c91aa','97b6b7f0e47f531b0723b0b6fb0721','7f0e37f1487f595b0b0bb0b6fb0722',
|
||||
'7f0e397bd097c35b0b6fc9210c8dc2','9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e27f1487f595b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
|
||||
'9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e397bd097c35b0b6fc920fb0722','9778397bd097c36b0b6fc9274c91aa','97b6b7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9274c91aa',
|
||||
'97b6b7f0e47f531b0723b0787b0721','7f0e27f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
|
||||
'9778397bd097c36b0b6fc9210c91aa','97b6b7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
|
||||
'7f0e397bd07f595b0b0bc920fb0722','9778397bd097c36b0b6fc9210c8dc2','977837f0e37f149b0723b0787b0721',
|
||||
'7f07e7f0e47f531b0723b0b6fb0722','7f0e37f5307f595b0b0bc920fb0722','7f0e397bd097c35b0b6fc9210c8dc2',
|
||||
'977837f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0721','7f0e37f1487f595b0b0bb0b6fb0722',
|
||||
'7f0e397bd097c35b0b6fc9210c8dc2','977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722','977837f0e37f14998082b0787b06bd',
|
||||
'7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd097c35b0b6fc920fb0722',
|
||||
'977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14998082b0787b06bd',
|
||||
'7f07e7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0b0bb0b6fb0722','7f0e397bd07f595b0b0bc920fb0722',
|
||||
'977837f0e37f14998082b0723b06bd','7f07e7f0e37f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
|
||||
'7f0e397bd07f595b0b0bc920fb0722','977837f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b0721',
|
||||
'7f07e7f0e47f531b0723b0b6fb0722','7f0e37f1487f595b0b0bb0b6fb0722','7f0e37f0e37f14898082b0723b02d5',
|
||||
'7ec967f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0722','7f0e37f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e37f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e37f1487f531b0b0bb0b6fb0722','7f0e37f0e37f14898082b072297c35','7ec967f0e37f14998082b0787b06bd',
|
||||
'7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722','7f0e37f0e37f14898082b072297c35',
|
||||
'7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722',
|
||||
'7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f149b0723b0787b0721',
|
||||
'7f0e27f1487f531b0b0bb0b6fb0722','7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14998082b0723b06bd',
|
||||
'7f07e7f0e47f149b0723b0787b0721','7f0e27f0e47f531b0723b0b6fb0722','7f0e37f0e366aa89801eb072297c35',
|
||||
'7ec967f0e37f14998082b0723b06bd','7f07e7f0e37f14998083b0787b0721','7f0e27f0e47f531b0723b0b6fb0722',
|
||||
'7f0e37f0e366aa89801eb072297c35','7ec967f0e37f14898082b0723b02d5','7f07e7f0e37f14998082b0787b0721',
|
||||
'7f07e7f0e47f531b0723b0b6fb0722','7f0e36665b66aa89801e9808297c35','665f67f0e37f14898082b0723b02d5',
|
||||
'7ec967f0e37f14998082b0787b0721','7f07e7f0e47f531b0723b0b6fb0722','7f0e36665b66a449801e9808297c35',
|
||||
'665f67f0e37f14898082b0723b02d5','7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721',
|
||||
'7f0e36665b66a449801e9808297c35','665f67f0e37f14898082b072297c35','7ec967f0e37f14998082b0787b06bd',
|
||||
'7f07e7f0e47f531b0723b0b6fb0721','7f0e26665b66a449801e9808297c35','665f67f0e37f1489801eb072297c35',
|
||||
'7ec967f0e37f14998082b0787b06bd','7f07e7f0e47f531b0723b0b6fb0721','7f0e27f1487f531b0b0bb0b6fb0722'],
|
||||
|
||||
/**
|
||||
* 数字转中文速查表
|
||||
* @Array Of Property
|
||||
* @trans ['日','一','二','三','四','五','六','七','八','九','十']
|
||||
* @return Cn string
|
||||
*/
|
||||
nStr1:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341"],
|
||||
|
||||
/**
|
||||
* 日期转农历称呼速查表
|
||||
* @Array Of Property
|
||||
* @trans ['初','十','廿','卅']
|
||||
* @return Cn string
|
||||
*/
|
||||
nStr2:["\u521d","\u5341","\u5eff","\u5345"],
|
||||
|
||||
/**
|
||||
* 月份转农历称呼速查表
|
||||
* @Array Of Property
|
||||
* @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
|
||||
* @return Cn string
|
||||
*/
|
||||
nStr3:["\u6b63","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u51ac","\u814a"],
|
||||
|
||||
/**
|
||||
* 返回农历y年一整年的总天数
|
||||
* @param lunar Year
|
||||
* @return Number
|
||||
* @eg:var count = calendar.lYearDays(1987) ;//count=387
|
||||
*/
|
||||
lYearDays:function(y) {
|
||||
var i, sum = 348;
|
||||
for(i=0x8000; i>0x8; i>>=1) { sum += (calendar.lunarInfo[y-1900] & i)? 1: 0; }
|
||||
return(sum+calendar.leapDays(y));
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
||||
* @param lunar Year
|
||||
* @return Number (0-12)
|
||||
* @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
|
||||
*/
|
||||
leapMonth:function(y) { //闰字编码 \u95f0
|
||||
return(calendar.lunarInfo[y-1900] & 0xf);
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回农历y年闰月的天数 若该年没有闰月则返回0
|
||||
* @param lunar Year
|
||||
* @return Number (0、29、30)
|
||||
* @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
|
||||
*/
|
||||
leapDays:function(y) {
|
||||
if(calendar.leapMonth(y)) {
|
||||
return((calendar.lunarInfo[y-1900] & 0x10000)? 30: 29);
|
||||
}
|
||||
return(0);
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
|
||||
* @param lunar Year
|
||||
* @return Number (-1、29、30)
|
||||
* @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
|
||||
*/
|
||||
monthDays:function(y,m) {
|
||||
if(m>12 || m<1) {return -1}//月份参数从1至12,参数错误返回-1
|
||||
return( (calendar.lunarInfo[y-1900] & (0x10000>>m))? 30: 29 );
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回公历(!)y年m月的天数
|
||||
* @param solar Year
|
||||
* @return Number (-1、28、29、30、31)
|
||||
* @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
|
||||
*/
|
||||
solarDays:function(y,m) {
|
||||
if(m>12 || m<1) {return -1} //若参数错误 返回-1
|
||||
var ms = m-1;
|
||||
if(ms==1) { //2月份的闰平规律测算后确认返回28或29
|
||||
return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28);
|
||||
}else {
|
||||
return(calendar.solarMonth[ms]);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 农历年份转换为干支纪年
|
||||
* @param lYear 农历年的年份数
|
||||
* @return Cn string
|
||||
*/
|
||||
toGanZhiYear:function(lYear) {
|
||||
var ganKey = (lYear - 3) % 10;
|
||||
var zhiKey = (lYear - 3) % 12;
|
||||
if(ganKey == 0) ganKey = 10;//如果余数为0则为最后一个天干
|
||||
if(zhiKey == 0) zhiKey = 12;//如果余数为0则为最后一个地支
|
||||
return calendar.Gan[ganKey-1] + calendar.Zhi[zhiKey-1];
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 公历月、日判断所属星座
|
||||
* @param cMonth [description]
|
||||
* @param cDay [description]
|
||||
* @return Cn string
|
||||
*/
|
||||
toAstro:function(cMonth,cDay) {
|
||||
var s = "\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf";
|
||||
var arr = [20,19,21,21,21,22,23,23,23,23,22,22];
|
||||
return s.substr(cMonth*2 - (cDay < arr[cMonth-1] ? 2 : 0),2) + "\u5ea7";//座
|
||||
},
|
||||
|
||||
/**
|
||||
* 传入offset偏移量返回干支
|
||||
* @param offset 相对甲子的偏移量
|
||||
* @return Cn string
|
||||
*/
|
||||
toGanZhi:function(offset) {
|
||||
return calendar.Gan[offset%10] + calendar.Zhi[offset%12];
|
||||
},
|
||||
|
||||
/**
|
||||
* 传入公历(!)y年获得该年第n个节气的公历日期
|
||||
* @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
|
||||
* @return day Number
|
||||
* @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
|
||||
*/
|
||||
getTerm:function(y,n) {
|
||||
if(y<1900 || y>2100) {return -1;}
|
||||
if(n<1 || n>24) {return -1;}
|
||||
var _table = calendar.sTermInfo[y-1900];
|
||||
var _info = [
|
||||
parseInt('0x'+_table.substr(0,5)).toString() ,
|
||||
parseInt('0x'+_table.substr(5,5)).toString(),
|
||||
parseInt('0x'+_table.substr(10,5)).toString(),
|
||||
parseInt('0x'+_table.substr(15,5)).toString(),
|
||||
parseInt('0x'+_table.substr(20,5)).toString(),
|
||||
parseInt('0x'+_table.substr(25,5)).toString()
|
||||
];
|
||||
var _calday = [
|
||||
_info[0].substr(0,1),
|
||||
_info[0].substr(1,2),
|
||||
_info[0].substr(3,1),
|
||||
_info[0].substr(4,2),
|
||||
|
||||
_info[1].substr(0,1),
|
||||
_info[1].substr(1,2),
|
||||
_info[1].substr(3,1),
|
||||
_info[1].substr(4,2),
|
||||
|
||||
_info[2].substr(0,1),
|
||||
_info[2].substr(1,2),
|
||||
_info[2].substr(3,1),
|
||||
_info[2].substr(4,2),
|
||||
|
||||
_info[3].substr(0,1),
|
||||
_info[3].substr(1,2),
|
||||
_info[3].substr(3,1),
|
||||
_info[3].substr(4,2),
|
||||
|
||||
_info[4].substr(0,1),
|
||||
_info[4].substr(1,2),
|
||||
_info[4].substr(3,1),
|
||||
_info[4].substr(4,2),
|
||||
|
||||
_info[5].substr(0,1),
|
||||
_info[5].substr(1,2),
|
||||
_info[5].substr(3,1),
|
||||
_info[5].substr(4,2),
|
||||
];
|
||||
return parseInt(_calday[n-1]);
|
||||
},
|
||||
|
||||
/**
|
||||
* 传入农历数字月份返回汉语通俗表示法
|
||||
* @param lunar month
|
||||
* @return Cn string
|
||||
* @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
|
||||
*/
|
||||
toChinaMonth:function(m) { // 月 => \u6708
|
||||
if(m>12 || m<1) {return -1} //若参数错误 返回-1
|
||||
var s = calendar.nStr3[m-1];
|
||||
s+= "\u6708";//加上月字
|
||||
return s;
|
||||
},
|
||||
|
||||
/**
|
||||
* 传入农历日期数字返回汉字表示法
|
||||
* @param lunar day
|
||||
* @return Cn string
|
||||
* @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
|
||||
*/
|
||||
toChinaDay:function(d){ //日 => \u65e5
|
||||
var s;
|
||||
switch (d) {
|
||||
case 10:
|
||||
s = '\u521d\u5341'; break;
|
||||
case 20:
|
||||
s = '\u4e8c\u5341'; break;
|
||||
break;
|
||||
case 30:
|
||||
s = '\u4e09\u5341'; break;
|
||||
break;
|
||||
default :
|
||||
s = calendar.nStr2[Math.floor(d/10)];
|
||||
s += calendar.nStr1[d%10];
|
||||
}
|
||||
return(s);
|
||||
},
|
||||
|
||||
/**
|
||||
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
||||
* @param y year
|
||||
* @return Cn string
|
||||
* @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
|
||||
*/
|
||||
getAnimal: function(y) {
|
||||
return calendar.Animals[(y - 4) % 12]
|
||||
},
|
||||
|
||||
/**
|
||||
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
|
||||
* @param y solar year
|
||||
* @param m solar month
|
||||
* @param d solar day
|
||||
* @return JSON object
|
||||
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
||||
*/
|
||||
solar2lunar:function (y,m,d) { //参数区间1900.1.31~2100.12.31
|
||||
if(y<1900 || y>2100) {return -1;}//年份限定、上限
|
||||
if(y==1900&&m==1&&d<31) {return -1;}//下限
|
||||
if(!y) { //未传参 获得当天
|
||||
var objDate = new Date();
|
||||
}else {
|
||||
var objDate = new Date(y,parseInt(m)-1,d)
|
||||
}
|
||||
var i, leap=0, temp=0;
|
||||
//修正ymd参数
|
||||
var y = objDate.getFullYear(),m = objDate.getMonth()+1,d = objDate.getDate();
|
||||
var offset = (Date.UTC(objDate.getFullYear(),objDate.getMonth(),objDate.getDate()) - Date.UTC(1900,0,31))/86400000;
|
||||
for(i=1900; i<2101 && offset>0; i++) { temp=calendar.lYearDays(i); offset-=temp; }
|
||||
if(offset<0) { offset+=temp; i--; }
|
||||
|
||||
//是否今天
|
||||
var isTodayObj = new Date(),isToday=false;
|
||||
if(isTodayObj.getFullYear()==y && isTodayObj.getMonth()+1==m && isTodayObj.getDate()==d) {
|
||||
isToday = true;
|
||||
}
|
||||
//星期几
|
||||
var nWeek = objDate.getDay(),cWeek = calendar.nStr1[nWeek];
|
||||
if(nWeek==0) {nWeek =7;}//数字表示周几顺应天朝周一开始的惯例
|
||||
//农历年
|
||||
var year = i;
|
||||
|
||||
var leap = calendar.leapMonth(i); //闰哪个月
|
||||
var isLeap = false;
|
||||
|
||||
//效验闰月
|
||||
for(i=1; i<13 && offset>0; i++) {
|
||||
//闰月
|
||||
if(leap>0 && i==(leap+1) && isLeap==false){
|
||||
--i;
|
||||
isLeap = true; temp = calendar.leapDays(year); //计算农历闰月天数
|
||||
}
|
||||
else{
|
||||
temp = calendar.monthDays(year, i);//计算农历普通月天数
|
||||
}
|
||||
//解除闰月
|
||||
if(isLeap==true && i==(leap+1)) { isLeap = false; }
|
||||
offset -= temp;
|
||||
}
|
||||
|
||||
if(offset==0 && leap>0 && i==leap+1)
|
||||
if(isLeap){
|
||||
isLeap = false;
|
||||
}else{
|
||||
isLeap = true; --i;
|
||||
}
|
||||
if(offset<0){ offset += temp; --i; }
|
||||
//农历月
|
||||
var month = i;
|
||||
//农历日
|
||||
var day = offset + 1;
|
||||
|
||||
//天干地支处理
|
||||
var sm = m-1;
|
||||
var gzY = calendar.toGanZhiYear(year);
|
||||
|
||||
//月柱 1900年1月小寒以前为 丙子月(60进制12)
|
||||
var firstNode = calendar.getTerm(year,(m*2-1));//返回当月「节」为几日开始
|
||||
var secondNode = calendar.getTerm(year,(m*2));//返回当月「节」为几日开始
|
||||
|
||||
//依据12节气修正干支月
|
||||
var gzM = calendar.toGanZhi((y-1900)*12+m+11);
|
||||
if(d>=firstNode) {
|
||||
gzM = calendar.toGanZhi((y-1900)*12+m+12);
|
||||
}
|
||||
|
||||
//传入的日期的节气与否
|
||||
var isTerm = false;
|
||||
var Term = null;
|
||||
if(firstNode==d) {
|
||||
isTerm = true;
|
||||
Term = calendar.solarTerm[m*2-2];
|
||||
}
|
||||
if(secondNode==d) {
|
||||
isTerm = true;
|
||||
Term = calendar.solarTerm[m*2-1];
|
||||
}
|
||||
//日柱 当月一日与 1900/1/1 相差天数
|
||||
var dayCyclical = Date.UTC(y,sm,1,0,0,0,0)/86400000+25567+10;
|
||||
var gzD = calendar.toGanZhi(dayCyclical+d-1);
|
||||
//该日期所属的星座
|
||||
var astro = calendar.toAstro(m,d);
|
||||
|
||||
return {'lYear':year,'lMonth':month,'lDay':day,'Animal':calendar.getAnimal(year),'IMonthCn':(isLeap?"\u95f0":'')+calendar.toChinaMonth(month),'IDayCn':calendar.toChinaDay(day),'cYear':y,'cMonth':m,'cDay':d,'gzYear':gzY,'gzMonth':gzM,'gzDay':gzD,'isToday':isToday,'isLeap':isLeap,'nWeek':nWeek,'ncWeek':"\u661f\u671f"+cWeek,'isTerm':isTerm,'Term':Term,'astro':astro};
|
||||
},
|
||||
|
||||
/**
|
||||
* 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
|
||||
* @param y lunar year
|
||||
* @param m lunar month
|
||||
* @param d lunar day
|
||||
* @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
|
||||
* @return JSON object
|
||||
* @eg:console.log(calendar.lunar2solar(1987,9,10));
|
||||
*/
|
||||
lunar2solar:function(y,m,d,isLeapMonth) { //参数区间1900.1.31~2100.12.1
|
||||
var isLeapMonth = !!isLeapMonth;
|
||||
var leapOffset = 0;
|
||||
var leapMonth = calendar.leapMonth(y);
|
||||
var leapDay = calendar.leapDays(y);
|
||||
if(isLeapMonth&&(leapMonth!=m)) {return -1;}//传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
|
||||
if(y==2100&&m==12&&d>1 || y==1900&&m==1&&d<31) {return -1;}//超出了最大极限值
|
||||
var day = calendar.monthDays(y,m);
|
||||
var _day = day;
|
||||
//bugFix 2016-9-25
|
||||
//if month is leap, _day use leapDays method
|
||||
if(isLeapMonth) {
|
||||
_day = calendar.leapDays(y,m);
|
||||
}
|
||||
if(y < 1900 || y > 2100 || d > _day) {return -1;}//参数合法性效验
|
||||
|
||||
//计算农历的时间差
|
||||
var offset = 0;
|
||||
for(var i=1900;i<y;i++) {
|
||||
offset+=calendar.lYearDays(i);
|
||||
}
|
||||
var leap = 0,isAdd= false;
|
||||
for(var i=1;i<m;i++) {
|
||||
leap = calendar.leapMonth(y);
|
||||
if(!isAdd) {//处理闰月
|
||||
if(leap<=i && leap>0) {
|
||||
offset+=calendar.leapDays(y);isAdd = true;
|
||||
}
|
||||
}
|
||||
offset+=calendar.monthDays(y,i);
|
||||
}
|
||||
//转换闰月农历 需补充该年闰月的前一个月的时差
|
||||
if(isLeapMonth) {offset+=day;}
|
||||
//1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
|
||||
var stmap = Date.UTC(1900,1,30,0,0,0);
|
||||
var calObj = new Date((offset+d-31)*86400000+stmap);
|
||||
var cY = calObj.getUTCFullYear();
|
||||
var cM = calObj.getUTCMonth()+1;
|
||||
var cD = calObj.getUTCDate();
|
||||
|
||||
return calendar.solar2lunar(cY,cM,cD);
|
||||
}
|
||||
};
|
||||
|
||||
export default calendar
|
||||
/* eslint-disable */
|
||||
837
src/components/Calendar/calendar.vue
Normal file
837
src/components/Calendar/calendar.vue
Normal file
@@ -0,0 +1,837 @@
|
||||
<style scoped>
|
||||
.calendar {
|
||||
margin:auto;
|
||||
width: 100%;
|
||||
min-width:300px;
|
||||
background: #fff;
|
||||
font-family: "PingFang SC","Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif;
|
||||
user-select:none;
|
||||
}
|
||||
|
||||
.calendar-tools{
|
||||
height:40px;
|
||||
font-size: 20px;
|
||||
line-height: 40px;
|
||||
color:#5e7a88;
|
||||
}
|
||||
.calendar-tools span{
|
||||
cursor: pointer;
|
||||
}
|
||||
.calendar-prev{
|
||||
width: 14.28571429%;
|
||||
float:left;
|
||||
text-align: center;
|
||||
}
|
||||
.calendar-info{
|
||||
padding-top: 3px;
|
||||
font-size:16px;
|
||||
line-height: 1.3;
|
||||
text-align: center;
|
||||
}
|
||||
.calendar-info>div.month{
|
||||
margin:auto;
|
||||
height:20px;
|
||||
width:100px;
|
||||
text-align: center;
|
||||
color:#5e7a88;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.calendar-info>div.month .month-inner{
|
||||
position: absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
height:240px;
|
||||
transition:top .5s cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||
}
|
||||
.calendar-info>div.month .month-inner>span{
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
height:20px;
|
||||
width:100px;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
.calendar-info>div.year{
|
||||
font-size:10px;
|
||||
line-height: 1;
|
||||
color:#999;
|
||||
}
|
||||
.calendar-next{
|
||||
width: 14.28571429%;
|
||||
float:right;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar table {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
margin-bottom:10px;
|
||||
border-collapse: collapse;
|
||||
color: #444444;
|
||||
}
|
||||
.calendar td {
|
||||
margin:2px !important;
|
||||
padding:0px 0;
|
||||
width: 14.28571429%;
|
||||
height:44px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-size:14px;
|
||||
line-height: 125%;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
}
|
||||
.calendar td.week{
|
||||
font-size:10px;
|
||||
pointer-events:none !important;
|
||||
cursor: default !important;
|
||||
}
|
||||
.calendar td.disabled {
|
||||
color: #ccc;
|
||||
pointer-events:none !important;
|
||||
cursor: default !important;
|
||||
}
|
||||
.calendar td.disabled div{
|
||||
color: #ccc;
|
||||
}
|
||||
.calendar td span{
|
||||
display:block;
|
||||
max-width:40px;
|
||||
height:26px;
|
||||
font-size: 16px;
|
||||
line-height:26px;
|
||||
margin:0px auto;
|
||||
border-radius:20px;
|
||||
}
|
||||
.calendar td:not(.selected) span:not(.red):hover{
|
||||
background:#f3f8fa;
|
||||
color:#444;
|
||||
}
|
||||
.calendar td:not(.selected) span.red:hover{
|
||||
background:#f9efef;
|
||||
}
|
||||
|
||||
.calendar td:not(.disabled) span.red{
|
||||
color:#ea6151;
|
||||
}
|
||||
.calendar td.selected span{
|
||||
background-color: #5e7a88;
|
||||
color: #fff;
|
||||
}
|
||||
.calendar td .text{
|
||||
position: absolute;
|
||||
top:28px;
|
||||
left:0;
|
||||
right:0;
|
||||
text-align: center;
|
||||
|
||||
padding:2px;
|
||||
font-size:8px;
|
||||
line-height: 1.2;
|
||||
color:#444;
|
||||
}
|
||||
.calendar td .isGregorianFestival,
|
||||
.calendar td .isLunarFestival{
|
||||
color:#ea6151;
|
||||
}
|
||||
.calendar td.selected span.red{
|
||||
background-color: #ea6151;
|
||||
color: #fff;
|
||||
}
|
||||
.calendar td.selected span.red:hover{
|
||||
background-color: #ea6151;
|
||||
color: #fff;
|
||||
}
|
||||
.calendar thead td {
|
||||
text-transform: uppercase;
|
||||
height:30px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.calendar-button{
|
||||
text-align: center;
|
||||
}
|
||||
.calendar-button span{
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
min-height: 1em;
|
||||
min-width: 5em;
|
||||
vertical-align: baseline;
|
||||
background:#5e7a88;
|
||||
color:#fff;
|
||||
margin: 0 .25em 0 0;
|
||||
padding: .6em 2em;
|
||||
font-size: 1em;
|
||||
line-height: 1em;
|
||||
text-align: center;
|
||||
border-radius: .3em;
|
||||
}
|
||||
.calendar-button span.cancel{
|
||||
background:#efefef;
|
||||
color:#666;
|
||||
}
|
||||
.calendar-years{
|
||||
position: absolute;
|
||||
left:0px;
|
||||
top:60px;
|
||||
right:0px;
|
||||
bottom:0px;
|
||||
background:#fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-wrap:wrap;
|
||||
overflow: auto;
|
||||
transition:all .5s cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
.calendar-years.show{
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
transform: translateY(0px);
|
||||
}
|
||||
.calendar-years>span{
|
||||
margin:1px 5px;
|
||||
display: inline-block;
|
||||
width:60px;
|
||||
line-height: 30px;
|
||||
border-radius: 20px;
|
||||
text-align:center;
|
||||
border:1px solid #fbfbfb;
|
||||
color:#999;
|
||||
}
|
||||
.calendar-years>span.active{
|
||||
border:1px solid #5e7a88;
|
||||
background-color: #5e7a88;
|
||||
color:#fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="calendar">
|
||||
<div class="calendar-tools">
|
||||
<span class="calendar-prev" @click="prev">
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g class="transform-group">
|
||||
<g transform="scale(0.015625, 0.015625)">
|
||||
<path
|
||||
d="M671.968 912c-12.288 0-24.576-4.672-33.952-14.048L286.048 545.984c-18.752-18.72-18.752-49.12 0-67.872l351.968-352c18.752-18.752 49.12-18.752 67.872 0 18.752 18.72 18.752 49.12 0 67.872l-318.016 318.048 318.016 318.016c18.752 18.752 18.752 49.12 0 67.872C696.544 907.328 684.256 912 671.968 912z"
|
||||
fill="#5e7a88"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span class="calendar-next" @click="next">
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g class="transform-group">
|
||||
<g transform="scale(0.015625, 0.015625)">
|
||||
<path
|
||||
d="M761.056 532.128c0.512-0.992 1.344-1.824 1.792-2.848 8.8-18.304 5.92-40.704-9.664-55.424L399.936 139.744c-19.264-18.208-49.632-17.344-67.872 1.888-18.208 19.264-17.376 49.632 1.888 67.872l316.96 299.84-315.712 304.288c-19.072 18.4-19.648 48.768-1.248 67.872 9.408 9.792 21.984 14.688 34.56 14.688 12 0 24-4.48 33.312-13.44l350.048-337.376c0.672-0.672 0.928-1.6 1.6-2.304 0.512-0.48 1.056-0.832 1.568-1.344C757.76 538.88 759.2 535.392 761.056 532.128z"
|
||||
fill="#5e7a88"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<div class="calendar-info" @click.stop="changeYear">
|
||||
<!-- {{monthString}} -->
|
||||
<div class="month">
|
||||
<div :style="{'top':-(month*20)+'px'}" class="month-inner">
|
||||
<span v-for="m in months" :key="m">{{ m }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="year">{{ year }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<table cellpadding="5">
|
||||
<thead>
|
||||
<tr>
|
||||
<td v-for="week in weeks" :key="week" class="week">{{ week }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(day,k1) in days" :key="(day,k1)" style="{'animation-delay',(k1*30)+'ms'}">
|
||||
<td
|
||||
v-for="(child,k2) in day"
|
||||
:key="(child,k2)"
|
||||
:class="{'selected':child.selected,'disabled':child.disabled}"
|
||||
@click="select(k1,k2,$event)">
|
||||
<span :class="{'red':k2==0||k2==6||((child.isLunarFestival||child.isGregorianFestival) && lunar)}">{{ child.day }}</span>
|
||||
<div v-if="child.eventName!=undefined" class="text" >{{ child.eventName }}</div>
|
||||
<div
|
||||
v-if="lunar"
|
||||
:class="{'isLunarFestival':child.isLunarFestival,'isGregorianFestival':child.isGregorianFestival}"
|
||||
class="text">{{ child.lunar }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div :class="{'show':yearsShow}" class="calendar-years">
|
||||
<span v-for="y in years" :key="y" :class="{'active':y==year}" @click.stop="selectYear(y)">{{ y }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
import calendar from './calendar.js'
|
||||
export default {
|
||||
props: {
|
||||
// 多选模式
|
||||
multi: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 范围模式
|
||||
range:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 默认日期
|
||||
value: {
|
||||
type: Array,
|
||||
default: function(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 开始选择日期
|
||||
begin: {
|
||||
type: Array,
|
||||
default: function(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 结束选择日期
|
||||
end: {
|
||||
type: Array,
|
||||
default: function(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
|
||||
// 是否小于10补零
|
||||
zero:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 屏蔽的日期
|
||||
disabled:{
|
||||
type: Array,
|
||||
default: function(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 是否显示农历
|
||||
lunar: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
|
||||
// 自定义星期名称
|
||||
weeks: {
|
||||
type: Array,
|
||||
default:function(){
|
||||
return window.navigator.language.toLowerCase() == "zh-cn"?['日', '一', '二', '三', '四', '五', '六']:['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
|
||||
}
|
||||
},
|
||||
// 自定义月份
|
||||
months:{
|
||||
type: Array,
|
||||
default:function(){
|
||||
return window.navigator.language.toLowerCase() == "zh-cn"?['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']:['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
||||
}
|
||||
},
|
||||
// 自定义事件
|
||||
events: {
|
||||
type: Object,
|
||||
default: function(){
|
||||
return {}
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
years:[],
|
||||
yearsShow:false,
|
||||
year: 0,
|
||||
month: 0,
|
||||
day: 0,
|
||||
days: [],
|
||||
multiDays:[],
|
||||
today: [],
|
||||
festival:{
|
||||
lunar:{
|
||||
"1-1":"春节",
|
||||
"1-15":"元宵节",
|
||||
"2-2":"龙头节",
|
||||
"5-5":"端午节",
|
||||
"7-7":"七夕节",
|
||||
"7-15":"中元节",
|
||||
"8-15":"中秋节",
|
||||
"9-9":"重阳节",
|
||||
"10-1":"寒衣节",
|
||||
"10-15":"下元节",
|
||||
"12-8":"腊八节",
|
||||
"12-23":"祭灶节",
|
||||
},
|
||||
gregorian:{
|
||||
"1-1":"元旦",
|
||||
"2-14":"情人节",
|
||||
"3-8":"妇女节",
|
||||
"3-12":"植树节",
|
||||
"4-5":"清明节",
|
||||
"5-1":"劳动节",
|
||||
"5-4":"青年节",
|
||||
"6-1":"儿童节",
|
||||
"7-1":"建党节",
|
||||
"8-1":"建军节",
|
||||
"9-10":"教师节",
|
||||
"10-1":"国庆节",
|
||||
"12-24":"平安夜",
|
||||
"12-25":"圣诞节",
|
||||
},
|
||||
},
|
||||
rangeBegin:[],
|
||||
rangeEnd:[],
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
events(){
|
||||
this.render(this.year,this.month)
|
||||
},
|
||||
value(){
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init(){
|
||||
let now = new Date();
|
||||
this.year = now.getFullYear()
|
||||
this.month = now.getMonth()
|
||||
this.day = now.getDate()
|
||||
if (this.value.length>0) {
|
||||
if (this.range) { //范围
|
||||
this.year = parseInt(this.value[0][0])
|
||||
this.month = parseInt(this.value[0][1]) - 1
|
||||
this.day = parseInt(this.value[0][2])
|
||||
|
||||
let year2 = parseInt(this.value[1][0])
|
||||
let month2 = parseInt(this.value[1][1]) - 1
|
||||
let day2 = parseInt(this.value[1][2])
|
||||
|
||||
this.rangeBegin = [this.year, this.month,this.day]
|
||||
this.rangeEnd = [year2, month2 , day2]
|
||||
}else if(this.multi){//多选
|
||||
this.multiDays=this.value;
|
||||
this.year = parseInt(this.value[0][0])
|
||||
this.month = parseInt(this.value[0][1]) - 1
|
||||
this.day = parseInt(this.value[0][2])
|
||||
}else{ //单选
|
||||
this.year = parseInt(this.value[0])
|
||||
this.month = parseInt(this.value[1]) - 1
|
||||
this.day = parseInt(this.value[2])
|
||||
}
|
||||
}
|
||||
this.render(this.year, this.month)
|
||||
},
|
||||
// 渲染日期
|
||||
render(y, m) {
|
||||
let firstDayOfMonth = new Date(y, m, 1).getDay() //当月第一天
|
||||
let lastDateOfMonth = new Date(y, m + 1, 0).getDate() //当月最后一天
|
||||
let lastDayOfLastMonth = new Date(y, m, 0).getDate() //最后一月的最后一天
|
||||
this.year = y
|
||||
let seletSplit = this.value
|
||||
let i, line = 0,temp = [],nextMonthPushDays = 1
|
||||
for (i = 1; i <= lastDateOfMonth; i++) {
|
||||
let day = new Date(y, m, i).getDay() //返回星期几(0~6)
|
||||
let k
|
||||
// 第一行
|
||||
if (day == 0) {
|
||||
temp[line] = []
|
||||
} else if (i == 1) {
|
||||
temp[line] = []
|
||||
k = lastDayOfLastMonth - firstDayOfMonth + 1
|
||||
for (let j = 0; j < firstDayOfMonth; j++) {
|
||||
// console.log("第一行",lunarYear,lunarMonth,lunarValue,lunarInfo)
|
||||
temp[line].push(Object.assign(
|
||||
{day: k,disabled: true},
|
||||
this.getLunarInfo(this.computedPrevYear(),this.computedPrevMonth(true),k),
|
||||
this.getEvents(this.computedPrevYear(),this.computedPrevMonth(true),k),
|
||||
))
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (this.range) { // 范围
|
||||
// console.log("日期范围",this.getLunarInfo(this.year,this.month+1,i))
|
||||
let options = Object.assign(
|
||||
{day: i},
|
||||
this.getLunarInfo(this.year,this.month+1,i),
|
||||
this.getEvents(this.year,this.month+1,i),
|
||||
)
|
||||
if (this.rangeBegin.length > 0) {
|
||||
let beginTime = Number(new Date(this.rangeBegin[0], this.rangeBegin[1], this.rangeBegin[2]))
|
||||
let endTime = Number(new Date(this.rangeEnd[0], this.rangeEnd[1], this.rangeEnd[2]))
|
||||
let stepTime = Number(new Date(this.year, this.month, i))
|
||||
if (beginTime <= stepTime && endTime >= stepTime) {
|
||||
options.selected = true
|
||||
}
|
||||
}
|
||||
if (this.begin.length>0) {
|
||||
let beginTime = Number(new Date(parseInt(this.begin[0]),parseInt(this.begin[1]) - 1,parseInt(this.begin[2])))
|
||||
if (beginTime > Number(new Date(this.year, this.month, i))) options.disabled = true
|
||||
}
|
||||
if (this.end.length>0){
|
||||
let endTime = Number(new Date(parseInt(this.end[0]),parseInt(this.end[1]) - 1,parseInt(this.end[2])))
|
||||
if (endTime < Number(new Date(this.year, this.month, i))) options.disabled = true
|
||||
}
|
||||
if (this.disabled.length>0){
|
||||
if (this.disabled.filter(v => {return this.year === v[0] && this.month === v[1]-1 && i === v[2] }).length>0) {
|
||||
options.disabled = true
|
||||
}
|
||||
}
|
||||
temp[line].push(options)
|
||||
}else if(this.multi){//多选
|
||||
let options
|
||||
// 判断是否选中
|
||||
if(this.value.filter(v => {return this.year === v[0] && this.month === v[1]-1 && i === v[2] }).length>0 ){
|
||||
options = Object.assign({day: i,selected:true},this.getLunarInfo(this.year,this.month+1,i),this.getEvents(this.year,this.month+1,i))
|
||||
}else{
|
||||
options = Object.assign({day: i,selected:false},this.getLunarInfo(this.year,this.month+1,i),this.getEvents(this.year,this.month+1,i))
|
||||
if (this.begin.length>0) {
|
||||
let beginTime = Number(new Date(parseInt(this.begin[0]),parseInt(this.begin[1]) - 1,parseInt(this.begin[2])))
|
||||
if (beginTime > Number(new Date(this.year, this.month, i))) options.disabled = true
|
||||
}
|
||||
if (this.end.length>0){
|
||||
let endTime = Number(new Date(parseInt(this.end[0]),parseInt(this.end[1]) - 1,parseInt(this.end[2])))
|
||||
if (endTime < Number(new Date(this.year, this.month, i))) options.disabled = true
|
||||
}
|
||||
if (this.disabled.length>0){
|
||||
if (this.disabled.filter(v => {return this.year === v[0] && this.month === v[1]-1 && i === v[2] }).length>0) {
|
||||
options.disabled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
temp[line].push(options)
|
||||
} else { // 单选
|
||||
// console.log(this.lunar(this.year,this.month,i));
|
||||
|
||||
let chk = new Date()
|
||||
let chkY = chk.getFullYear()
|
||||
let chkM = chk.getMonth()
|
||||
// 匹配上次选中的日期
|
||||
if (parseInt(seletSplit[0]) == this.year && parseInt(seletSplit[1]) - 1 == this.month && parseInt(seletSplit[2]) == i) {
|
||||
// console.log("匹配上次选中的日期",lunarYear,lunarMonth,lunarValue,lunarInfo)
|
||||
temp[line].push(Object.assign(
|
||||
{day: i,selected: true},
|
||||
this.getLunarInfo(this.year,this.month+1,i),
|
||||
this.getEvents(this.year,this.month+1,i),
|
||||
))
|
||||
this.today = [line, temp[line].length - 1]
|
||||
}
|
||||
// 没有默认值的时候显示选中今天日期
|
||||
else if (chkY == this.year && chkM == this.month && i == this.day && this.value == "") {
|
||||
|
||||
// console.log("今天",lunarYear,lunarMonth,lunarValue,lunarInfo)
|
||||
temp[line].push(Object.assign(
|
||||
{day: i,selected: true},
|
||||
this.getLunarInfo(this.year,this.month+1,i),
|
||||
this.getEvents(this.year,this.month+1,i),
|
||||
))
|
||||
this.today = [line, temp[line].length - 1]
|
||||
}else{
|
||||
// 普通日期
|
||||
// console.log("设置可选范围",i,lunarYear,lunarMonth,lunarValue,lunarInfo)
|
||||
let options = Object.assign(
|
||||
{day: i,selected:false},
|
||||
this.getLunarInfo(this.year,this.month+1,i),
|
||||
this.getEvents(this.year,this.month+1,i),
|
||||
)
|
||||
if (this.begin.length>0) {
|
||||
let beginTime = Number(new Date(parseInt(this.begin[0]),parseInt(this.begin[1]) - 1,parseInt(this.begin[2])))
|
||||
if (beginTime > Number(new Date(this.year, this.month, i))) options.disabled = true
|
||||
}
|
||||
if (this.end.length>0){
|
||||
let endTime = Number(new Date(parseInt(this.end[0]),parseInt(this.end[1]) - 1,parseInt(this.end[2])))
|
||||
if (endTime < Number(new Date(this.year, this.month, i))) options.disabled = true
|
||||
}
|
||||
if (this.disabled.length>0){
|
||||
if (this.disabled.filter(v => {return this.year === v[0] && this.month === v[1]-1 && i === v[2] }).length>0) {
|
||||
options.disabled = true
|
||||
}
|
||||
}
|
||||
temp[line].push(options)
|
||||
}
|
||||
}
|
||||
// 到周六换行
|
||||
if (day == 6 && i < lastDateOfMonth) {
|
||||
line++
|
||||
}else if (i == lastDateOfMonth) {
|
||||
// line++
|
||||
let k = 1
|
||||
for (let d=day; d < 6; d++) {
|
||||
// console.log(this.computedNextYear()+"-"+this.computedNextMonth(true)+"-"+k)
|
||||
temp[line].push(Object.assign(
|
||||
{day: k,disabled: true},
|
||||
this.getLunarInfo(this.computedNextYear(),this.computedNextMonth(true),k),
|
||||
this.getEvents(this.computedNextYear(),this.computedNextMonth(true),k),
|
||||
))
|
||||
k++
|
||||
}
|
||||
// 下个月除了补充的前几天开始的日期
|
||||
nextMonthPushDays=k
|
||||
}
|
||||
} //end for
|
||||
|
||||
// console.log(this.year+"/"+this.month+"/"+this.day+":"+line)
|
||||
// 补充第六行让视觉稳定
|
||||
if(line<=5 && nextMonthPushDays>0){
|
||||
// console.log({nextMonthPushDays:nextMonthPushDays,line:line})
|
||||
for (let i = line+1; i<=5; i++) {
|
||||
temp[i] = []
|
||||
let start=nextMonthPushDays+(i-line-1)*7
|
||||
for (let d=start; d <= start+6; d++) {
|
||||
temp[i].push(Object.assign(
|
||||
{day: d,disabled: true},
|
||||
this.getLunarInfo(this.computedNextYear(),this.computedNextMonth(true),d),
|
||||
this.getEvents(this.computedNextYear(),this.computedNextMonth(true),d),
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
this.days = temp
|
||||
},
|
||||
computedPrevYear(){
|
||||
let value=this.year
|
||||
if(this.month-1<0){
|
||||
value--
|
||||
}
|
||||
return value
|
||||
},
|
||||
computedPrevMonth(isString){
|
||||
let value=this.month
|
||||
if(this.month-1<0){
|
||||
value=11
|
||||
}else{
|
||||
value--
|
||||
}
|
||||
// 用于显示目的(一般月份是从0开始的)
|
||||
if(isString){
|
||||
return value+1
|
||||
}
|
||||
return value
|
||||
},
|
||||
computedNextYear(){
|
||||
let value=this.year
|
||||
if(this.month+1>11){
|
||||
value++
|
||||
}
|
||||
return value
|
||||
},
|
||||
computedNextMonth(isString){
|
||||
let value=this.month
|
||||
if(this.month+1>11){
|
||||
value=0
|
||||
}else{
|
||||
value++
|
||||
}
|
||||
// 用于显示目的(一般月份是从0开始的)
|
||||
if(isString){
|
||||
return value+1
|
||||
}
|
||||
return value
|
||||
},
|
||||
// 获取农历信息
|
||||
getLunarInfo(y,m,d){
|
||||
let lunarInfo=calendar.solar2lunar(y,m,d)
|
||||
let lunarValue=lunarInfo.IDayCn
|
||||
// console.log(lunarInfo)
|
||||
let isLunarFestival=false
|
||||
let isGregorianFestival=false
|
||||
if(this.festival.lunar[lunarInfo.lMonth+"-"+lunarInfo.lDay]!=undefined){
|
||||
lunarValue=this.festival.lunar[lunarInfo.lMonth+"-"+lunarInfo.lDay]
|
||||
isLunarFestival=true
|
||||
}else if(this.festival.gregorian[m+"-"+d]!=undefined){
|
||||
lunarValue=this.festival.gregorian[m+"-"+d]
|
||||
isGregorianFestival=true
|
||||
}
|
||||
return {
|
||||
lunar:lunarValue,
|
||||
isLunarFestival:isLunarFestival,
|
||||
isGregorianFestival:isGregorianFestival,
|
||||
}
|
||||
},
|
||||
// 获取自定义事件
|
||||
getEvents(y,m,d){
|
||||
if(Object.keys(this.events).length==0)return false;
|
||||
let eventName=this.events[y+"-"+m+"-"+d]
|
||||
let data={}
|
||||
if(eventName!=undefined){
|
||||
data.eventName=eventName
|
||||
}
|
||||
return data
|
||||
},
|
||||
// 上月
|
||||
prev(e) {
|
||||
e.stopPropagation()
|
||||
if (this.month == 0) {
|
||||
this.month = 11
|
||||
this.year = parseInt(this.year) - 1
|
||||
} else {
|
||||
this.month = parseInt(this.month) - 1
|
||||
}
|
||||
this.$emit('search', this.year, this.month+1) // 调用父组件方法
|
||||
this.render(this.year, this.month)
|
||||
this.$emit('selectMonth',this.month+1,this.year)
|
||||
this.$emit('prev',this.month+1,this.year)
|
||||
},
|
||||
// 下月
|
||||
next(e) {
|
||||
e.stopPropagation()
|
||||
if (this.month == 11) {
|
||||
this.month = 0
|
||||
this.year = parseInt(this.year) + 1
|
||||
} else {
|
||||
this.month = parseInt(this.month) + 1
|
||||
}
|
||||
this.$emit('search', this.year, this.month+1) // 调用父组件方法
|
||||
this.render(this.year, this.month)
|
||||
this.$emit('selectMonth',this.month+1,this.year)
|
||||
this.$emit('next',this.month+1,this.year)
|
||||
},
|
||||
// 选中日期
|
||||
select(k1, k2, e) {
|
||||
if (e != undefined) e.stopPropagation()
|
||||
// 日期范围
|
||||
if (this.range) {
|
||||
if (this.rangeBegin.length == 0 || this.rangeEndTemp != 0) {
|
||||
this.rangeBegin = [this.year, this.month,this.days[k1][k2].day]
|
||||
this.rangeBeginTemp = this.rangeBegin
|
||||
this.rangeEnd = [this.year, this.month, this.days[k1][k2].day]
|
||||
this.rangeEndTemp = 0
|
||||
|
||||
} else {
|
||||
this.rangeEnd = [this.year, this.month,this.days[k1][k2].day]
|
||||
this.rangeEndTemp = 1
|
||||
// 判断结束日期小于开始日期则自动颠倒过来
|
||||
if (+new Date(this.rangeEnd[0], this.rangeEnd[1], this.rangeEnd[2]) < +new Date(this.rangeBegin[0], this.rangeBegin[1], this.rangeBegin[2])) {
|
||||
this.rangeBegin = this.rangeEnd
|
||||
this.rangeEnd = this.rangeBeginTemp
|
||||
}
|
||||
// 小于10左边打补丁
|
||||
let begin=[]
|
||||
let end=[]
|
||||
if(this.zero){
|
||||
this.rangeBegin.forEach((v,k)=>{
|
||||
if(k==1)v=v+1
|
||||
begin.push(this.zeroPad(v))
|
||||
})
|
||||
this.rangeEnd.forEach((v,k)=>{
|
||||
if(k==1)v=v+1
|
||||
end.push(this.zeroPad(v))
|
||||
})
|
||||
}else{
|
||||
begin=this.rangeBegin
|
||||
end=this.rangeEnd
|
||||
}
|
||||
// console.log("选中日期",begin,end)
|
||||
this.$emit('select',begin,end)
|
||||
}
|
||||
this.render(this.year, this.month)
|
||||
}else if (this.multi) {
|
||||
// 如果已经选过则过滤掉
|
||||
let filterDay=this.multiDays.filter(v => {
|
||||
return this.year === v[0] && this.month === v[1]-1 && this.days[k1][k2].day === v[2]
|
||||
})
|
||||
if( filterDay.length>0 ){
|
||||
this.multiDays=this.multiDays.filter(v=> {
|
||||
return this.year !== v[0] || this.month !== v[1]-1 || this.days[k1][k2].day !== v[2]
|
||||
})
|
||||
}else{
|
||||
this.multiDays.push([this.year,this.month+1,this.days[k1][k2].day]);
|
||||
}
|
||||
this.days[k1][k2].selected = !this.days[k1][k2].selected
|
||||
this.$emit('select',this.multiDays)
|
||||
} else {
|
||||
// 取消上次选中
|
||||
if (this.today.length > 0) {
|
||||
this.days.forEach(v=>{
|
||||
v.forEach(vv=>{
|
||||
vv.selected= false
|
||||
})
|
||||
})
|
||||
}
|
||||
// 设置当前选中天
|
||||
this.days[k1][k2].selected = true
|
||||
this.day = this.days[k1][k2].day
|
||||
this.today = [k1, k2]
|
||||
this.$emit('select',[this.year,this.zero?this.zeroPad(this.month + 1):this.month + 1,this.zero?this.zeroPad(this.days[k1][k2].day):this.days[k1][k2].day])
|
||||
}
|
||||
},
|
||||
changeYear(){
|
||||
if(this.yearsShow){
|
||||
this.yearsShow=false
|
||||
return false
|
||||
}
|
||||
this.yearsShow=true
|
||||
this.years=[];
|
||||
for(let i=~~this.year-10;i<~~this.year+10;i++){
|
||||
this.years.push(i)
|
||||
}
|
||||
},
|
||||
selectYear(value){
|
||||
this.yearsShow=false
|
||||
this.year=value
|
||||
this.render(this.year,this.month)
|
||||
this.$emit('selectYear',value)
|
||||
this.$emit('search', this.year, this.month+1) // 调用父组件方法
|
||||
},
|
||||
// 返回今天
|
||||
setToday(){
|
||||
let now = new Date();
|
||||
this.year = now.getFullYear()
|
||||
this.month = now.getMonth()
|
||||
this.day = now.getDate()
|
||||
|
||||
this.render(this.year,this.month)
|
||||
// 遍历当前日找到选中
|
||||
this.days.forEach(v => {
|
||||
let day=v.find(vv => {
|
||||
return vv.day==this.day && !vv.disabled
|
||||
})
|
||||
if(day!=undefined ){
|
||||
day.selected=true
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
// 日期补零
|
||||
zeroPad(n){
|
||||
return String(n < 10 ? '0' + n : n)
|
||||
},
|
||||
}
|
||||
}
|
||||
/* eslint-enable */
|
||||
</script>
|
||||
1
src/icons/svg/FactoryCalendar.svg
Normal file
1
src/icons/svg/FactoryCalendar.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1544748307988" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2116" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M865.6 136.4h-48.8V188h36c51.2 0 92.4 40.8 92.4 91.6v525.2c0 50.4-41.2 91.6-92.4 91.6h-684c-51.2 0-92.4-40.8-92.4-91.6V279.6C76.4 229.2 117.6 188 168.8 188h38.8V136.4H156c-73.2 0-132.4 58.8-132.4 131.2v549.6c0 72.4 59.2 131.2 132.4 131.2h710c73.2 0 132.4-58.8 132.4-131.2V267.6c-0.4-72.4-59.6-131.2-132.8-131.2z m-246.4 0h-217.2v52.8h217.2V136.4z m-306.8 108h18c10 0 18-8.4 18-18.4V100c0-10-8-18.4-18-18.4h-18c-10 0-18 8-18 18.4v126c-0.4 10.4 8 18.4 18 18.4z m379.2 0h18c10 0 18-8.4 18-18.4V100c0-10-8-18.4-18-18.4h-18c-10 0-18 8-18 18.4v126c0 10.4 8 18.4 18 18.4zM266 515.2h56.4c14.4 0 26-11.6 26-26v-56c0-14.4-11.6-26-26-26H266c-14.4 0-26 11.6-26 26v56c-0.4 14.4 11.6 26 26 26z m298.8-82c0-14.4-11.6-26-26-26h-56.4c-14.4 0-26 11.6-26 26v56c0 14.4 11.6 26 26 26h56.4c14.4 0 26-11.6 26-26v-56z m134 82h56.4c14.4 0 26-11.6 26-26v-56c0-14.4-11.6-26-26-26h-56.4c-14.4 0-26 11.6-26 26v56c0 14.4 11.6 26 26 26zM266 731.6h56.4c14.4 0 26-11.6 26-26v-56.4c0-14.4-11.6-26-26-26H266c-14.4 0-26 11.6-26 26v56.4c-0.4 14.4 11.6 26 26 26z m272.8-108h-56.4c-14.4 0-26 11.6-26 26v56.4c0 14.4 11.6 26 26 26h56.4c14.4 0 26-11.6 26-26v-56.4c0-14.4-11.6-26-26-26z m160 108h56.4c14.4 0 26-11.6 26-26v-56.4c0-14.4-11.6-26-26-26h-56.4c-14.4 0-26 11.6-26 26v56.4c0 14.4 11.6 26 26 26z m0 0" p-id="2117"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
7
src/icons/svg/PerformanceBond.svg
Normal file
7
src/icons/svg/PerformanceBond.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Svg Vector Icons : http://www.sfont.cn -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
|
||||
<metadata> Svg Vector Icons : http://www.sfont.cn </metadata>
|
||||
<g><path d="M500,10C229.8,10,10,229.8,10,500c0,270.2,219.8,490,490,490c270.2,0,490-219.8,490-490C990,229.8,770.2,10,500,10z M500,846.3C309,846.3,153.6,691,153.6,500c0-191,155.4-346.3,346.4-346.3c191,0,346.3,155.4,346.3,346.3C846.4,691,691,846.3,500,846.3z"/><path d="M645.1,359.8l-40.7-41L500,422.5L395.6,318.8l-40.7,41l75,74.5h-76v57.8h117.2v46.8H353.9v57.8h117.2V697h57.8V596.7h117.2v-57.8H528.9v-46.8h117.2v-57.8h-76L645.1,359.8z"/></g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 891 B |
1
src/icons/svg/ShiftManagement.svg
Normal file
1
src/icons/svg/ShiftManagement.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1544748646937" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2862" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M474.624 752.64H259.072c-17.408 0-26.624-13.824-26.624-26.624V472.064h534.528V332.8c0-40.96-32.256-72.704-72.704-72.704h-51.2v-41.472h-46.592v41.472H356.864v-41.472h-46.592v41.472h-51.2c-40.96 0-72.704 32.256-72.704 72.704v389.632c0 40.96 32.256 72.704 72.704 72.704l215.552 4.096c11.776 0 23.04-11.264 23.04-23.04S486.4 752.64 474.624 752.64z m-117.76-384.512V306.176h235.52v61.952h46.592V306.176h51.2c17.408 0 26.624 13.824 26.624 26.624v92.672H232.448V332.8c0-17.408 13.824-26.624 26.624-26.624h51.2v61.952h46.592z" fill="" p-id="2863"></path><path d="M289.792 525.312h145.92v46.592H289.792v-46.592z m411.136 61.952h-46.592v108.544H762.88v-46.592h-61.952v-61.952z m-411.136 61.952h145.92v46.592H289.792v-46.592z" fill="" p-id="2864"></path><path d="M794.112 556.032c-30.208-30.208-72.704-47.616-116.736-47.616-44.032 0-86.528 17.408-116.736 47.616s-47.616 72.704-47.616 116.736 17.408 86.528 47.616 116.736 72.704 47.616 116.736 47.616c45.568 0 84.992-15.872 116.736-47.616 30.208-30.208 47.616-72.704 47.616-116.736s-17.408-86.528-47.616-116.736z m-116.224 238.08c-67.072 0-121.856-54.784-121.856-121.856 0-67.072 54.784-121.856 121.856-121.856s121.856 54.784 121.856 121.856c0 67.584-55.296 121.856-121.856 121.856z" fill="" p-id="2865"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -230,7 +230,7 @@ export default {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
callback.call(this) // 回调函数修正this指向组件本身
|
||||
} else { this.$message.error('删除失败') }
|
||||
} else { this.$message.error('数据占用') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
|
||||
257
src/views/BasicData/FactoryCalendar/index.vue
Normal file
257
src/views/BasicData/FactoryCalendar/index.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<div style="width: 100%;">
|
||||
<el-card style="width: 400px;margin: auto;margin-top: 20px">
|
||||
<div class="flex">
|
||||
<div>
|
||||
<calendar :events="calendar1.events" :value="calendar1.value" :begin="calendar1.begin" :end="calendar1.end" :weeks="calendar1.weeks" :months="calendar1.months" @search="search" @select="select" />
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="width: 400px;text-align: center;margin: auto">
|
||||
<el-button type="primary" plain @click="setWork">上班</el-button>
|
||||
<el-button type="success" plain @click="setRest">休息</el-button>
|
||||
<el-button type="warning" plain @click="setToday">返回今天</el-button>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initClendar, changeState } from '@/api/BasicData/FactoryCalendar'
|
||||
import calendar from '@/components/Calendar/calendar.vue'
|
||||
export default {
|
||||
components: {
|
||||
calendar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
year: '', // 年
|
||||
month: '', // 月
|
||||
selectDate: '', // 选择的日期
|
||||
time: '',
|
||||
serNum: [], // 工作日流水号
|
||||
serNumValue: '', // 工作日流水号值
|
||||
arr: [], // 日期数组
|
||||
arr1: [], // 日期数组
|
||||
calendar1: {
|
||||
value: [],
|
||||
weeks: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], // 周的显示
|
||||
months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], // 月的显示
|
||||
events: {} // 上不上班
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
select(val) { // 选择
|
||||
this.selectDate = val[0] + '-' + val[1] + '-' + val[2]
|
||||
},
|
||||
setToday() { // 返回今天
|
||||
this.fetchData()
|
||||
},
|
||||
fetchData() { // 日历初始化
|
||||
var date = new Date()
|
||||
this.year = date.getFullYear()
|
||||
this.month = date.getMonth() + 1
|
||||
this.day = date.getDate()
|
||||
this.calendar1.value = [this.year, this.month, this.day] // 当前日期!
|
||||
var events = Object() // 声明events是object对象
|
||||
initClendar(this.year, this.month).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) { // 这个循环是将时间1900-01-01转成1900-1-1型
|
||||
var str = response.data[i].工作日期
|
||||
var str1 = str.substr(0, 10)
|
||||
var nian = str.substr(0, 4)
|
||||
var yue = str.substr(5, 2)
|
||||
var ri = str.substr(8, 2)
|
||||
if (str.substr(5, 1) === '0') {
|
||||
yue = yue.replace('0', '')
|
||||
}
|
||||
if (str.substr(8, 1) === '0') {
|
||||
ri = ri.replace('0', '')
|
||||
}
|
||||
var x = nian + '-' + yue + '-' + ri
|
||||
events[x] = response.data[i].是否工作
|
||||
this.arr.push(x)
|
||||
this.arr1.push(str1)
|
||||
}
|
||||
this.calendar1.events = events
|
||||
})
|
||||
},
|
||||
search(year1, month1) { // !子组件的,上下月,改变年
|
||||
var events = Object() // 声明events是object对象
|
||||
initClendar(year1, month1).then(response => {
|
||||
this.serNum = []
|
||||
this.arr = []
|
||||
this.arr1 = []
|
||||
for (let i = 0; i < response.data.length; i++) { // 这个循环是将时间1900-01-01转成1900-1-1型
|
||||
var str = response.data[i].工作日期
|
||||
var str1 = str.substr(0, 10)
|
||||
var nian = str.substr(0, 4)
|
||||
var yue = str.substr(5, 2)
|
||||
var ri = str.substr(8, 2)
|
||||
if (str.substr(5, 1) === '0') {
|
||||
yue = yue.replace('0', '')
|
||||
}
|
||||
if (str.substr(8, 1) === '0') {
|
||||
ri = ri.replace('0', '')
|
||||
}
|
||||
var x = nian + '-' + yue + '-' + ri
|
||||
this.arr.push(x)
|
||||
this.arr1.push(str1)
|
||||
events[x] = response.data[i].是否工作
|
||||
}
|
||||
this.calendar1.events = events
|
||||
})
|
||||
},
|
||||
setWork() { // 上班
|
||||
this.code = 1
|
||||
for (let i = 0; i < this.arr.length; i++) {
|
||||
if (this.arr[i] === this.selectDate) {
|
||||
this.time = this.arr1[i]
|
||||
break
|
||||
}
|
||||
}
|
||||
changeState(this.time, this.code).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.fetchData()
|
||||
this.$message.success('更改状态成功')
|
||||
} else {
|
||||
this.$message.error('更改状态失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
setRest() { // 休息
|
||||
this.code = 0
|
||||
for (let i = 0; i < this.arr.length; i++) {
|
||||
if (this.arr[i] === this.selectDate) {
|
||||
this.time = this.arr1[i]
|
||||
break
|
||||
}
|
||||
}
|
||||
changeState(this.time, this.code).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.fetchData()
|
||||
this.$message.success('更改状态成功')
|
||||
} else {
|
||||
this.$message.error('更改状态失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/*demo*/
|
||||
.flex{
|
||||
box-sizing: border-box;
|
||||
|
||||
display: -webkit-box;
|
||||
-webkit-box-pack: start;
|
||||
-webkit-box-align: start;
|
||||
|
||||
display: -webkit-flex;
|
||||
-webkit-justify-content: space-between;
|
||||
-webkit-align-items: top;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: top;
|
||||
flex-flow:row wrap
|
||||
}
|
||||
.flex>div{
|
||||
margin:10px;
|
||||
padding:20px;
|
||||
width:25%;
|
||||
min-width:300px;
|
||||
border-radius: 2px;
|
||||
position: relative;
|
||||
}
|
||||
.flex>div>span{
|
||||
position: absolute;
|
||||
left:0px;
|
||||
top:0px;
|
||||
padding:2px 10px;
|
||||
font-size:10px;
|
||||
border-radius:0 0 2px 0;
|
||||
background:#ea6151;
|
||||
color:#fff;
|
||||
}
|
||||
.flex>div>input{
|
||||
box-sizing: border-box;
|
||||
width:100%;
|
||||
margin-top:20px;
|
||||
border-radius: 2px;
|
||||
border:1px solid #dedede;
|
||||
padding:10px;
|
||||
font-size: 16px;
|
||||
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwhW0NEQVRBWwpAZm9udC1mYWNlIHsgZm9udC1mYW1pbHk6IGlmb250OyBzcmM6IHVybCgiLy9hdC5hbGljZG4uY29tL3QvZm9udF8xNDQyMzczODk2XzQ3NTQ0NTUuZW90PyNpZWZpeCIpIGZvcm1hdCgiZW1iZWRkZWQtb3BlbnR5cGUiKSwgdXJsKCIvL2F0LmFsaWNkbi5jb20vdC9mb250XzE0NDIzNzM4OTZfNDc1NDQ1NS53b2ZmIikgZm9ybWF0KCJ3b2ZmIiksIHVybCgiLy9hdC5hbGljZG4uY29tL3QvZm9udF8xNDQyMzczODk2XzQ3NTQ0NTUudHRmIikgZm9ybWF0KCJ0cnVldHlwZSIpLCB1cmwoIi8vYXQuYWxpY2RuLmNvbS90L2ZvbnRfMTQ0MjM3Mzg5Nl80NzU0NDU1LnN2ZyNpZm9udCIpIGZvcm1hdCgic3ZnIik7IH0KCl1dPjwvc3R5bGU+PC9kZWZzPjxnIGNsYXNzPSJ0cmFuc2Zvcm0tZ3JvdXAiPjxnIHRyYW5zZm9ybT0ic2NhbGUoMC4wMTU2MjUsIDAuMDE1NjI1KSI+PHBhdGggZD0iTTcxMS4zMDYyIDI5MC42OTcyYzI0LjI4MjEgMCA0NS4zNzY1LTE5LjcwNjkgNDUuMzc2NS00NC4wMzJWNDYuNTYwMjU1OTk5OTk5OTk1YzAtMjQuMzI1MS0yMS4wOTU0LTQ0LjA1MzUtNDUuMzc2NS00NC4wNTM1LTI0LjMwMjYgMC00My45ODggMTkuNzI4NC00My45ODggNDQuMDUzNXYyMDAuMTA0OTZDNjY3LjMxODMgMjcwLjk5MDMgNjg3LjAwMzYgMjkwLjY5NzIgNzExLjMwNjIgMjkwLjY5NzJ6TTYyMy40ODA4IDExMy40MjAzSDQwMC43NjQ5Mjh2NjYuNTEzOTJoMjIyLjcxNTkwNDAwMDAwMDAyVjExMy40MjAyODh6TTg4NC4wNTMgMTEzLjQyMDNoLTgyLjc3NDAxNnY2Ni4xNDUyOGg4NS45NDAyMjRjMjUuMjc4NSAwIDQ2LjYxMTUgMjEuMzc2IDQ2LjYxMTUgNDYuNjc3djE1My45Mjc2OEg5MC40Mzg2NTYwMDAwMDAwMXYtMTUzLjkyNzY4YzAtMjUuMyAyMS4zMzMtNDYuNjc3IDQ2LjYxMTUtNDYuNjc3aDg2LjUwMzQyNFYxMTMuNDIwMjg4aC04Mi42NDI5NDRjLTY0LjA4NiAwLTExNi41MDc2IDUyLjUwODctMTE2LjUwNzYgMTE2LjcwMzJ2Njc2LjgwMTUzNTk5OTk5OTljMCA2NC4xNzQxIDUwLjQ5MTQgMTE2LjY4MDcgMTE0LjU3NzQgMTE2LjY4MDdIODg0LjA1Mjk5MmM2NC4wNjI1IDAgMTE2LjUwNjYtNTIuNTA2NiAxMTYuNTA2Ni0xMTYuNjgwN1YyMzAuMTIzNTE5OTk5OTk5OThDMTAwMC41NTk2IDE2NS45MjkgOTQ4LjExNDQgMTEzLjQyMDMgODg0LjA1MyAxMTMuNDIwM3pNOTMzLjgyOTYgOTEwLjM1MTRjMCAyNS4zLTIxLjMzMyA0Ni42NzYtNDYuNjExNSA0Ni42NzZIMTM3LjA1MDExMTk5OTk5OTk4Yy0yNS4yNzg1IDAtNDYuNjExNS0yMS4zNzYtNDYuNjExNS00Ni42NzZWNDQ2LjQ0NTU2OEg5MzMuODI5NjMyVjkxMC4zNTEzNnpNMjY3LjEwODQgNjQ2LjE4MTljMzYuODc3MyAwIDY2Ljc1MjUtMjkuOTM5NyA2Ni43NTI1LTY2Ljg4MTUgMC0zNi45MjI0LTI5Ljg3NTItNjYuODYxMS02Ni43NTI1LTY2Ljg2MTEtMzYuODU0OCAwLTY2Ljc1MjUgMjkuOTM5Ny02Ni43NTI1IDY2Ljg2MTFDMjAwLjM1NTggNjE2LjI0MjIgMjMwLjI1MjUgNjQ2LjE4MTkgMjY3LjEwODQgNjQ2LjE4MTl6TTUxMS41NDg0IDY0Ni4xODE5YzM2Ljg1NTggMCA2Ni43NTI1LTI5LjkzOTcgNjYuNzUyNS02Ni44ODE1IDAtMzYuOTIyNC0yOS44OTU3LTY2Ljg2MTEtNjYuNzUyNS02Ni44NjExLTM2Ljg3NzMgMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44NjExQzQ0NC43OTU5IDYxNi4yNDIyIDQ3NC42NzExIDY0Ni4xODE5IDUxMS41NDg0IDY0Ni4xODE5ek0yNjUuOTE2NCA4OTAuNzA5YzM2Ljg3NzMgMCA2Ni43NTE1LTI5LjkzOTcgNjYuNzUxNS02Ni44NjExIDAtMzYuOTQyOC0yOS44NzQyLTY2Ljg4MjYtNjYuNzUxNS02Ni44ODI2LTM2Ljg1NTggMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44ODI2QzE5OS4xNjM5IDg2MC43NjkzIDIyOS4wNTk2IDg5MC43MDkgMjY1LjkxNjQgODkwLjcwOXpNNTExLjU0ODQgODkwLjcwOWMzNi44NTU4IDAgNjYuNzUyNS0yOS45Mzk3IDY2Ljc1MjUtNjYuODYxMSAwLTM2Ljk0MjgtMjkuODk1Ny02Ni44ODI2LTY2Ljc1MjUtNjYuODgyNi0zNi44NzczIDAtNjYuNzUyNSAyOS45Mzk3LTY2Ljc1MjUgNjYuODgyNkM0NDQuNzk1OSA4NjAuNzY5MyA0NzQuNjcxMSA4OTAuNzA5IDUxMS41NDg0IDg5MC43MDl6TTc1NS42NDEzIDY0Ni4xODE5YzM2Ljg1NjggMCA2Ni43NTM1LTI5LjkzOTcgNjYuNzUzNS02Ni44ODE1IDAtMzYuOTIyNC0yOS44OTY3LTY2Ljg2MTEtNjYuNzUzNS02Ni44NjExLTM2Ljg3NzMgMC02Ni43NTI1IDI5LjkzOTctNjYuNzUyNSA2Ni44NjExQzY4OC44ODk5IDYxNi4yNDIyIDcxOC43NjQgNjQ2LjE4MTkgNzU1LjY0MTMgNjQ2LjE4MTl6TTMxMS43MDM2IDI5MC42OTcyYzI0LjI4MTEgMCA0NS4zNzY1LTE5LjcwNjkgNDUuMzc2NS00NC4wMzJWNDYuNTYwMjU1OTk5OTk5OTk1YzAtMjQuMzI1MS0yMS4wOTQ0LTQ0LjA1MzUtNDUuMzc2NS00NC4wNTM1LTI0LjMwMTYgMC00My45ODkgMTkuNzI4NC00My45ODkgNDQuMDUzNXYyMDAuMTA0OTZDMjY3LjcxNDYgMjcwLjk5MDMgMjg3LjQwMiAyOTAuNjk3MiAzMTEuNzAzNiAyOTAuNjk3MnoiIGZpbGw9IiM1ZTdhODgiPjwvcGF0aD48L2c+PC9nPjwvc3ZnPg==) no-repeat 8px 10px;
|
||||
padding-left: 36px;
|
||||
color:#666;
|
||||
}
|
||||
|
||||
/*transition*/
|
||||
.fade-enter-active,
|
||||
.fade-leave-active {
|
||||
transition: all .5s ease-in-out;
|
||||
}
|
||||
.fade-enter,.fade-leave-active{
|
||||
opacity: 0;
|
||||
transform: translateY(-10px);
|
||||
|
||||
}
|
||||
|
||||
/*下拉框*/
|
||||
.calendar-dropdown{
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
padding:20px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.calendar-dropdown:before {
|
||||
position: absolute;
|
||||
left:30px;
|
||||
top: -10px;
|
||||
content: "";
|
||||
border:5px solid rgba(0, 0, 0, 0);
|
||||
border-bottom-color: #DEDEDE;
|
||||
}
|
||||
.calendar-dropdown:after {
|
||||
position: absolute;
|
||||
left:30px;
|
||||
top: -9px;
|
||||
content: "";
|
||||
border:5px solid rgba(0, 0, 0, 0);
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
|
||||
/*弹出框*/
|
||||
.calendar-dialog{
|
||||
position: absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
}
|
||||
|
||||
.calendar-dialog-mask{
|
||||
background:rgba(255,255,255,.5);
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.calendar-dialog-body{
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
left:50%;
|
||||
top:50%;
|
||||
transform: translate(-50%,-50%);
|
||||
padding:20px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 2px;
|
||||
}
|
||||
</style>
|
||||
301
src/views/BasicData/ShiftManagement/index.vue
Normal file
301
src/views/BasicData/ShiftManagement/index.vue
Normal file
@@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<table style="width: 100%">
|
||||
|
||||
<el-card>
|
||||
<span style="margin-left: 15px">班次类型:</span>
|
||||
<el-select v-model="roleName" placeholder="班次类型" clearable size="small" style="width:200px">
|
||||
<el-option
|
||||
v-for="item in roleNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 15px" @click="pageCurrent1=1;searchTable()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="handelAdd">增加</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table :data="tableData" highlight-current-row>
|
||||
<el-table-column label="开始工作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.开始工作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column disabled label="结束工作时间" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.结束工作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="班次类型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.班次类型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="班次代码">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.班次代码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否夜班">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.是否夜班 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否工作">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.是否工作 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否工作">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.是否工作 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="日工作能力">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.日工作能力 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否可以安排高难度件">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.是否可以安排高难度件 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="submitEdit(scope.$index, scope.row)">修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="pageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40, 50]"
|
||||
:page-size="10"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</table>
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="增加" center style="min-height: 270px" width="800px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="员工姓名" prop="staffName">
|
||||
<el-input v-model="form1.staffName" placeholder="请双击选择" size="small" clearable style="width:200px" @dblclick.native="dialogTableVisible()"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-select v-model="form1.roleName" placeholder="角色名称" size="small" clearable style="width:200px">
|
||||
<el-option
|
||||
v-for="item in roleNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="考勤编号" >
|
||||
<el-input
|
||||
v-model="cjscgy"
|
||||
disabled
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门" >
|
||||
<el-input v-model="ssks" size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOFF">取 消</el-button>
|
||||
<el-button type="primary" @click="submitAdd1()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="dialogFormVisible2" title="编辑" center style="min-height: 270px" width="800px">
|
||||
<el-form ref="form2" :model="form2" :rules="rules1" label-position="left" label-width="110px" class="demo-ruleForm">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="员工姓名" >
|
||||
<el-input v-model="form2.staffName" disabled size="small" clearable style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-select v-model="form2.roleName" placeholder="角色名称" clearable size="small" style="width:200px">
|
||||
<el-option
|
||||
v-for="item in roleNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="考勤编号" >
|
||||
<el-input
|
||||
v-model="cjscgy"
|
||||
disabled
|
||||
size="small"
|
||||
style="width:200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item disabled="true" label="所属部门" >
|
||||
<el-input v-model="ssks" disabled size="small" style="width:200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOFF">取消</el-button>
|
||||
<el-button type="primary" @click="submitAdd2()">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getScheduling, searchProgramme, addShift, editShift, deleteShift } from '@/api/BasicData/ShiftManagement'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
roleName: '',
|
||||
roleNames: [],
|
||||
tableData: [],
|
||||
hour: '',
|
||||
minutes: '',
|
||||
seconds: '',
|
||||
tableDatate: [],
|
||||
dialogFormVisible: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchData()
|
||||
},
|
||||
methods: {
|
||||
searchData() {
|
||||
searchProgramme().then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.roleNames.push({
|
||||
label: response.data[i].班次代码,
|
||||
value: response.data[i].班次代码
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
searchTable() {
|
||||
getScheduling(this.roleName).then(response => {
|
||||
this.tableDatate = response.data
|
||||
console.log(response.data)
|
||||
for (let i = 0; i < this.tableDatate.length; i++) {
|
||||
this.hour = this.tableDatate[i].开始工作时间.Hours
|
||||
this.minutes = this.tableDatate[i].开始工作时间.Minutes
|
||||
this.seconds = this.tableDatate[i].开始工作时间.Seconds
|
||||
this.tableDatate[i].开始工作时间 = JSON.stringify(this.tableDatate[i].开始工作时间)
|
||||
this.tableDatate[i].开始工作时间 = this.hour.toString() + ':' + this.minutes.toString() + ':' + this.seconds.toString()
|
||||
}
|
||||
for (let i = 0; i < this.tableDatate.length; i++) {
|
||||
this.hour = this.tableDatate[i].结束工作时间.Hours
|
||||
this.minutes = this.tableDatate[i].结束工作时间.Minutes
|
||||
this.seconds = this.tableDatate[i].结束工作时间.Seconds
|
||||
this.tableDatate[i].结束工作时间 = JSON.stringify(this.tableDatate[i].结束工作时间)
|
||||
this.tableDatate[i].结束工作时间 = this.hour.toString() + ':' + this.minutes.toString() + ':' + this.seconds.toString()
|
||||
}
|
||||
this.tableData = this.tableDatate
|
||||
})
|
||||
},
|
||||
submitAdd1() {
|
||||
this.$refs['form1'].validate((valid) => {
|
||||
if (valid) {
|
||||
addShift(this.personnelNumber, this.form1.roleName).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('增加成功')
|
||||
this.ssks = ''
|
||||
this.form1.staffName = ''
|
||||
this.form1.roleName = ''
|
||||
this.searchData()
|
||||
this.dialogFormVisible1 = false
|
||||
} else { this.$message.error('增加失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
submitAdd2() {
|
||||
this.$refs['form2'].validate((valid) => {
|
||||
if (valid) {
|
||||
editShift(this.personnelStream, this.personnelNumber, this.form2.roleName).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改成功')
|
||||
this.ssks = ''
|
||||
this.searchData()
|
||||
this.dialogFormVisible2 = false
|
||||
} else { this.$message.error('修改失败') }
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!')
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDelete(row) { // 删除
|
||||
this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteShift(row.人员角色流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
} else { this.$message.error('删除失败') }
|
||||
this.searchData()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
handleCurrentChange(row) { // 获取当前行人员信息
|
||||
this.ssks = row.节点名称
|
||||
this.number = row.考勤编号
|
||||
this.name = row.姓名
|
||||
this.personnelNumber = row.人员编号
|
||||
},
|
||||
getName() { // 提交人员
|
||||
this.cjscgy = this.number
|
||||
this.dialogFormVisible = false
|
||||
this.form1.staffName = this.name
|
||||
this.form2.staffName = this.name
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-card{
|
||||
margin-bottom:15px;
|
||||
margin-left: 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
</style>
|
||||
@@ -218,7 +218,6 @@ import { searchRequestCard, initWarehouse, addRequestCard, searchInventoryNum, S
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: '', // 离线合同
|
||||
data() {
|
||||
return {
|
||||
purchasecard: '',
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading1"
|
||||
:data="tableData1"
|
||||
:data="tableData2"
|
||||
border
|
||||
style="width: 100%;max-height: 300px;"
|
||||
height="300px"
|
||||
@@ -205,7 +205,7 @@
|
||||
@click="addMateriel">选入物料</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData2" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
|
||||
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini" highlight-current-row @row-click="searchTable3">
|
||||
<el-table-column label="请购单状态" align="center" width="80" fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="parseInt(scope.row.是否传递)===0" type="warning" size="small">未传递</el-tag>
|
||||
@@ -250,7 +250,7 @@
|
||||
@current-change="handleCurrentChange2"/>
|
||||
<el-button style="margin-left:500px;" type="warning" size="mini" icon="el-icon-download" @click="doneRequestCard()">传递</el-button>
|
||||
</div>
|
||||
<el-table v-loading="" :data="tableData3" border style="max-height: 300px;" height="300px" size="mini">
|
||||
<el-table v-loading="" :data="tableData4" border style="max-height: 300px;" height="300px" size="mini">
|
||||
<el-table-column label="离线请购单编号" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请购单编号 }}
|
||||
@@ -287,7 +287,62 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initProject, searchmachine, searchTeam } from '@/api/Inventory/PartsReplacement'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ProjectValue: '',
|
||||
Project: [],
|
||||
MachineValue: '',
|
||||
Machine: [],
|
||||
GroupNumValue: '',
|
||||
GroupNum: '',
|
||||
tableData1: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'id' // 人员编号
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
fetchData() {
|
||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'Project') // 项目名称
|
||||
},
|
||||
searchMachine() { // 查询机床
|
||||
this.Machine = []
|
||||
this.GroupNum = []
|
||||
this.MachineValue = ''
|
||||
this.GroupNumValue = ''
|
||||
console.log(this.ProjectValue)
|
||||
if (this.ProjectValue !== '') {
|
||||
searchmachine(1, this.ProjectValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.Machine.push({
|
||||
label: response.data[i].机床图号,
|
||||
value: response.data[i].机床流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
searchGroupList() { // 查询组号
|
||||
this.GroupNum = []
|
||||
this.GroupNumValue = ''
|
||||
searchTeam(this.MachineValue).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.GroupNum.push({
|
||||
label: response.data[i].组号,
|
||||
value: response.data[i].组件流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
align="center"/>
|
||||
<el-table-column label="打印状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.备料打印!=='0'" type="success" size="small">已打印</el-tag>
|
||||
<el-tag v-else type="warning" size="small">未打印</el-tag>
|
||||
<el-tag v-if="scope.row.备料打印!=='0'" type="success" size="small">已导出</el-tag>
|
||||
<el-tag v-else type="warning" size="small">未导出</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="220px">
|
||||
@@ -27,7 +27,7 @@
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件图号" align="center" width="280px">
|
||||
<el-table-column label="零件图号" align="center" width="240px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
@@ -58,8 +58,8 @@
|
||||
<col style="width: 450px">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th>GAOJING</th>
|
||||
<th colspan="2"><span style="font-weight:bold">备料单</span></th>
|
||||
<th height="60px">GAOJING</th>
|
||||
<th colspan="2" height="60px"><span style="font-weight:bold">备料单</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">零件名称</td>
|
||||
@@ -101,6 +101,7 @@ export default {
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
this.tableData = []
|
||||
this.Data = []
|
||||
if (this.partName !== '' && this.partName !== null) {
|
||||
this.partNamecheck = true
|
||||
} else {
|
||||
@@ -119,6 +120,7 @@ export default {
|
||||
this.tableData.push({
|
||||
零件名称: this.Data[i].零件名称,
|
||||
零件图号: this.Data[i].零件图号,
|
||||
备料打印: this.Data[i].备料打印,
|
||||
工艺要求: response.data[i].工艺要求
|
||||
})
|
||||
})
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-row>
|
||||
<span>零件图号:</span>
|
||||
<el-input v-model="partName" placeholder="零件图号" size="small" clearable style="width:200px"/>
|
||||
<el-button size="small" icon="el-icon-search" type="success" style="margin-left: 10px" @click="pageSize=10; pageCurrent=1;searchTable()">查询</el-button>
|
||||
<el-checkbox v-model="all" size="mini">查询全部</el-checkbox>
|
||||
<el-button size="small" icon="el-icon-success" type="primary" style="margin-left: 10px" @click="edit()">到货</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="loading" :data="tableData" height="580" style="width: 100%;" border element-loading-text="拼命加载中" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center"/>
|
||||
<el-table-column label="到货状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.备料到货==='1'" type="success" size="small">已到货</el-tag>
|
||||
<el-tag v-if="scope.row.备料到货==='0'" type="warning" size="small">未到货</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件名称" align="center" width="220px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="零件图号" align="center" width="240px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备料" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工艺要求 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchtable, searchtable2, edit, handlechange } from '@/api/ManufacturingCenter/MaterialArrivalManagement'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
arrest: [],
|
||||
all: false,
|
||||
partName: '',
|
||||
loading: false,
|
||||
tableData: [], // 表格数据
|
||||
total: null, // 总条数
|
||||
pageSize: 10, // 每页显示条数
|
||||
pageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.searchTable()
|
||||
},
|
||||
methods: {
|
||||
// 查询表格数据
|
||||
searchTable() {
|
||||
this.loading = true
|
||||
this.tableData = []
|
||||
this.Data = []
|
||||
if (this.partName !== '' && this.partName !== null) {
|
||||
this.partNamecheck = true
|
||||
} else {
|
||||
this.partNamecheck = false
|
||||
}
|
||||
searchtable(this.partNamecheck, this.partName, !this.all, this.pageCurrent, this.pageSize).then(response => {
|
||||
if (response.data.total === 0) {
|
||||
this.loading = false
|
||||
} else {
|
||||
this.Data = response.data.rows
|
||||
this.total = response.data.total
|
||||
}
|
||||
}).then(() => {
|
||||
for (let i = 0; i < this.Data.length; i++) {
|
||||
searchtable2(this.Data[i].工艺计划流水号).then(response => {
|
||||
this.tableData.push({
|
||||
工艺计划流水号: this.Data[i].工艺计划流水号,
|
||||
零件名称: this.Data[i].零件名称,
|
||||
零件图号: this.Data[i].零件图号,
|
||||
备料到货: this.Data[i].备料到货,
|
||||
工艺要求: response.data[i].工艺要求,
|
||||
工序流水号: response.data[i].工序流水号
|
||||
})
|
||||
})
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.arrest = val
|
||||
},
|
||||
edit() {
|
||||
if (this.arrest.length === 0) {
|
||||
this.$message.warning('暂无数据')
|
||||
} else {
|
||||
for (let i = 0; i < this.arrest.length; i++) {
|
||||
edit(this.arrest[i].工艺计划流水号)
|
||||
handlechange(this.arrest[i].工序流水号, '0000')
|
||||
if (i === this.arrest.length - 1) {
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchTable()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchTable()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -32,7 +32,7 @@
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择结束日期"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addBidBond();flag1 = 2">增加</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">销售经理:</span>
|
||||
<el-input v-model="MarketingManagerValue" readonly clearable size="small" style="width:200px" placeholder="请双击选择营销经理" @dblclick.native="dialogFormVisiblePeople = true" @clear="clear()"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;tableData2=[];getTableData()">查询</el-button>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;tableData2=[];getTableData()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD('form2')">新增</el-button>
|
||||
<el-badge :value="value" :max="99" class="item">
|
||||
<el-button size="small" type="text" @click="AccountsReceivable">查看收款信息</el-button>
|
||||
@@ -61,6 +61,11 @@
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="已完成进度" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.执行进度名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="付款方式" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.付款方式 }}
|
||||
@@ -138,7 +143,7 @@
|
||||
<el-pagination
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="10"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@@ -243,12 +248,15 @@
|
||||
title="收款计划"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
<div v-show="!scope.row.计划付款时间" style="text-align: center">
|
||||
<div v-show="(scope.row.计划付款时间 === '' || scope.row.计划付款时间 === null) && parseInt(scope.row.未收金额)!==0 " style="text-align: center">
|
||||
<h4>{{ scope.row.执行进度名 }} 未完成</h4>
|
||||
</div>
|
||||
<div v-show="scope.row.计划付款时间">
|
||||
<div v-show="scope.row.计划付款时间 !== '' && scope.row.计划付款时间 !== null && parseInt(scope.row.未收金额)!==0">
|
||||
<h4>{{ scope.row.执行进度名 }}于{{ scope.row.节点日期 }}完成,计划于{{ scope.row.计划付款时间 }}进行收款,距离计划截止还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}天</h4>
|
||||
</div>
|
||||
<div v-show="parseInt(scope.row.未收金额)=== 0 " style="text-align: center">
|
||||
<h4>{{ scope.row.执行进度名 }}阶段收款已完成</h4>
|
||||
</div>
|
||||
<el-tag v-if="scope.row.计划付款时间===''||scope.row.计划付款时间===null" slot="reference" size="small" style="width: 66px">进度未完</el-tag>
|
||||
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&parseInt(scope.row.未收金额)===0" slot="reference" type="success" size="small" style="width: 66px">已完成</el-tag>
|
||||
<el-tag v-else-if="scope.row.计划付款时间!==''&&scope.row.计划付款时间!==null&&scope.row.状态==='未开始'" slot="reference" type="primary" size="small" style="width: 66px">未开始</el-tag>
|
||||
@@ -279,7 +287,7 @@
|
||||
:current-page="PageCurrent2"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="10"
|
||||
:total="total2"
|
||||
:total="PageSize2"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
@@ -1091,7 +1099,7 @@ export default {
|
||||
})
|
||||
this.$message.success('删除成功')
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
this.$message.error('数据占用')
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -1146,7 +1154,7 @@ export default {
|
||||
this.$message.success('删除成功')
|
||||
this.tableData2 = []
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
this.$message.error('数据占用')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择结束日期"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD()">增加</el-button>
|
||||
</el-card>
|
||||
<el-card>
|
||||
@@ -148,7 +148,7 @@
|
||||
{{ scope.row.电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合同信息备注" width="150">
|
||||
<el-table-column align="center" label="合同信息备注" width="250">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合同信息备注 }}
|
||||
</template>
|
||||
@@ -507,7 +507,7 @@
|
||||
<!--客户选择-->
|
||||
<el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px">
|
||||
<el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
|
||||
<el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange">
|
||||
<el-table-column label="省份" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
@@ -533,7 +533,7 @@
|
||||
<el-pagination
|
||||
:current-page="PageCurrent1"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="10"
|
||||
:page-size="PageSize1"
|
||||
:total="total1"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange1"
|
||||
|
||||
@@ -818,7 +818,7 @@ export default {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.getTable(addressSearch, [this.pageCurrent1, this.pageSize1], ['addressData', 'total1'])
|
||||
} else { this.$message.error('删除失败') }
|
||||
} else { this.$message.error('数据占用') }
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
@@ -928,7 +928,7 @@ export default {
|
||||
this.$message.sucess('删除成功')
|
||||
this.getSelect(searchCargoBox, ['货箱号', '货箱号编号'], 'cargoBox', this.invoiceNum)
|
||||
} else {
|
||||
this.$message.error('删除失败')
|
||||
this.$message.error('数据占用')
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -1107,7 +1107,7 @@ export default {
|
||||
}
|
||||
})
|
||||
if (data[0].result === '0') {
|
||||
this.$message.error('删除失败了。')
|
||||
this.$message.error('数据占用')
|
||||
}
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择结束日期"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
</el-card>
|
||||
<!--项目表格-->
|
||||
<el-card>
|
||||
@@ -286,7 +286,7 @@
|
||||
<!--客户选择-->
|
||||
<el-dialog :visible.sync="dialogCustomerFormVisible" title="客户选择" center width="600px">
|
||||
<el-input v-model="Customer" clearable size="small" style="width:200px" placeholder="请输入客户名称"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize1 = 10;PageCurrent1 = 1;fetchCustomerData()">查询</el-button>
|
||||
<el-table v-loading="loading1" :data="CustomerData" highlight-current-row height="300" show-overflow-tooltip style="height: 330px; margin-top: 20px" @row-click="handleCustomerChange">
|
||||
<el-table-column label="省份" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
@@ -491,7 +491,7 @@ export default {
|
||||
this.fetchTableData1()
|
||||
this.fetchTableData2(row)
|
||||
} else {
|
||||
this.$message.error('修改失败')
|
||||
this.$message.error('数据占用')
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -596,7 +596,7 @@ export default {
|
||||
this.tableData2 = data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('增加失败')
|
||||
this.$message.error('数据占用')
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -630,7 +630,7 @@ export default {
|
||||
this.tableData2 = data
|
||||
})
|
||||
} else {
|
||||
this.$message.error('修改失败')
|
||||
this.$message.error('数据占用')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
373
src/views/MarketingCenter/PerformanceBond/index.vue
Normal file
373
src/views/MarketingCenter/PerformanceBond/index.vue
Normal file
@@ -0,0 +1,373 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<span>项目名称:</span>
|
||||
<el-select v-model="entryNameValue" filterable placeholder="项目名称" style="margin-right: 10px" size="small" clearable>
|
||||
<el-option
|
||||
v-for="item in entryName"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">开始日期:</span>
|
||||
<el-date-picker
|
||||
v-model="startTime"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择开始日期"/>
|
||||
<span style="margin-left: 10px">结束日期:</span>
|
||||
<el-date-picker
|
||||
v-model="endTime"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择结束日期"/>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table
|
||||
v-loading="listLoading1"
|
||||
:data="tableData1"
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
height="400"
|
||||
border
|
||||
size="mini"
|
||||
@row-click="fetchTableData2">
|
||||
<el-table-column align="center" label="合同编号" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="primary">{{ scope.row.合同编号 }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="项目名称" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.项目名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="已完成进度" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.执行进度名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合同签订日期">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合同签订日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="销售经理" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="客户名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.客户名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="联系人" width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.姓名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="联系电话" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.电话 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合同信息备注">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合同信息备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="260px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
@click.stop="openAddInvoiceRecordingDialog(); flag = 1">履约保证金</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
@click.stop="openAddInvoiceRecordingDialog(); flag = 3">履约保函</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
:current-page="PageCurrent"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="PageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template>
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="履约保证金" name="first">
|
||||
<el-table
|
||||
v-loading="listLoading2"
|
||||
:data="tableData2"
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
height="100"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="履约保证金金额">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="primary" size="small">{{ scope.row.履约保证金金额 }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="保证金类型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.保证金类型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="收回条件">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.执行进度名 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="截止时间">
|
||||
<template slot-scope="scope">
|
||||
后{{ scope.row.提前X天提醒我 }}天内收回
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="是否收回">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="parseInt(scope.row.是否收回) === 1" slot="reference" size="small" type="success" style="width: 66px">已收回</el-tag>
|
||||
<el-tag v-else-if="parseInt(scope.row.是否收回) === 0" slot="reference" type="danger" size="small" style="width: 66px">未收回</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="实际收回日期">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.实际收回日期 === '' || scope.row.实际收回日期 === null ? scope.row.实际收回日期 = '暂未收回' : scope.row.实际收回日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
placement="top-start"
|
||||
title="收回计划"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
<div v-show="(scope.row.计划收款日期 === '' || scope.row.计划收款日期 === null) && parseInt(scope.row.是否收回)!== 1 " style="text-align: center">
|
||||
<h4>{{ scope.row.执行进度名 }} 未完成</h4>
|
||||
</div>
|
||||
<div v-show="scope.row.计划收款日期 !== '' && scope.row.计划收款日期 !== null && parseInt(scope.row.是否收回)!== 1">
|
||||
<h4>{{ scope.row.执行进度名 }}于{{ scope.row.节点日期 }}完成,计划于{{ scope.row.计划收款日期 }}进行收款,距离计划截止还剩{{ parseInt(scope.row.剩余天数) > 0 ? scope.row.剩余天数 : 0 }}天</h4>
|
||||
</div>
|
||||
<div v-show="parseInt(scope.row.是否收回)=== 1 " style="text-align: center">
|
||||
<h4>已于{{ scope.row.实际收回日期 }}收回</h4>
|
||||
</div>
|
||||
<el-tag v-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null && parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 1" slot="reference" size="small" type="warning" style="width: 66px">即将拖期</el-tag>
|
||||
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 2" slot="reference" type="danger" size="small" style="width: 66px">已经拖期</el-tag>
|
||||
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 0 && parseInt(scope.row.状态) === 0" slot="reference" type="primer" size="small" style="width: 66px">无计划</el-tag>
|
||||
<el-tag v-else-if="scope.row.计划收款日期!==''&& scope.row.计划收款日期!==null &&parseInt(scope.row.是否收回) === 1" slot="reference" type="success" size="small" style="width: 66px">已完成</el-tag>
|
||||
<el-tag v-else-if="scope.row.计划收款日期===''||scope.row.计划收款日期===null" slot="reference" size="small" style="width: 66px">进度未完</el-tag>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="260px">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:disabled="scope.row.是否禁用收回"
|
||||
size="mini"
|
||||
type="success"
|
||||
@click.stop="takeBack(scope.row)">收回</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
@click.stop="openAddInvoiceRecordingDialog(); flag = 3">编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click.stop="openAddInvoiceRecordingDialog(); flag = 3">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="履约保函" name="second">
|
||||
履约保函
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :visible.sync="dialogTimeVisible" title="实际收回日期" center style="min-height: 300px" width="23%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
||||
<el-form-item label="实际收回日期" prop="实际收回日期">
|
||||
<el-date-picker
|
||||
v-model="form.实际收回日期"
|
||||
style="width: 200px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
type="date"
|
||||
placeholder="请选择实际收回日期"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="callOffTime('form')">取消</el-button>
|
||||
<el-button type="primary" @click="submitTime('form')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import elInput from 'element-ui/packages/input'
|
||||
import { initProject, searchTableData1, typeOfPerformanceBond, searchTableData2, takeBack } from '@/api/MarketingCenter/PerformanceBond'
|
||||
export default {
|
||||
components: {
|
||||
elInput
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
entryNameValue: '', // 查询条件_项目名称
|
||||
entryName: [], // 查询条件_项目名称数组
|
||||
startTime: '', // 查询条件_开始时间
|
||||
endTime: '', // 查询条件_结束时间
|
||||
PageSize: 10, // 项目信息表格初始一页显示十条
|
||||
PageCurrent: 1, // 项目信息表格一次翻一页
|
||||
total: null,
|
||||
tableData1: [], // 项目信息表格数据
|
||||
listLoading1: false, // 项目信息表格加载动画
|
||||
flag: '', // 旗帜变量
|
||||
activeName: 'first', // 标签页初始
|
||||
projectId: '', // 项目流水号中间变量
|
||||
tableData2: [], // 履约保证金信息
|
||||
listLoading2: false,
|
||||
dialogTimeVisible: false,
|
||||
performanceBondCode: '', // 履约保证金流水号
|
||||
form: {
|
||||
实际收回日期: ''
|
||||
},
|
||||
rules: { // 表单验证规则
|
||||
实际收回日期: [{ required: true, message: '请选择实际收回日期', trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
// 初始化条件
|
||||
init() {
|
||||
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
|
||||
},
|
||||
// 查询合同(项目)信息
|
||||
fetchTableData1() {
|
||||
if (this.entryNameValue === '' || this.entryNameValue === null) { this.entryNameValue_check = 0 } else { this.entryNameValue_check = 1 }
|
||||
if (this.startTime === '' || this.startTime === null) { this.startTime_check = 0 } else { this.startTime_check = 1 }
|
||||
if (this.endTime === '' || this.endTime === null) { this.endTime_check = 0 } else { this.endTime_check = 1 }
|
||||
this.listLoading1 = true
|
||||
searchTableData1(this.PageCurrent, this.PageSize, this.entryNameValue, this.entryNameValue_check, this.startTime_check, this.endTime_check, this.startTime, this.endTime).then(response => {
|
||||
this.listLoading1 = false
|
||||
const data = response.data
|
||||
for (let i = 0; i < data.rows.length; i++) {
|
||||
data.rows[i].合同签订日期 = data.rows[i].合同签订日期.substring(0, data.rows[i].合同签订日期.length - 8)
|
||||
}
|
||||
this.tableData1 = data.rows
|
||||
this.total = data.total
|
||||
})
|
||||
},
|
||||
// 项目信息表格改变每页显示条数
|
||||
handleSizeChange(val) {
|
||||
this.PageCurrent = 1
|
||||
this.PageSize = val
|
||||
this.fetchTableData1()
|
||||
},
|
||||
// 项目信息表格翻页
|
||||
handleCurrentChange(val) {
|
||||
this.PageCurrent = val
|
||||
this.fetchTableData1()
|
||||
},
|
||||
// 履约保证金查询
|
||||
fetchTableData2(row) {
|
||||
this.projectId = row.项目流水号
|
||||
typeOfPerformanceBond(this.projectId).then(response => {
|
||||
const data = response.data[0].履约保证金类型
|
||||
return data
|
||||
}).then(data => {
|
||||
if (data === 1) {
|
||||
this.activeName = 'first'
|
||||
this.listLoading2 = true
|
||||
searchTableData2(this.projectId).then(response => {
|
||||
this.listLoading2 = false
|
||||
const data = response.data
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
|
||||
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
|
||||
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
|
||||
parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
|
||||
}
|
||||
this.tableData2 = data
|
||||
})
|
||||
} else if (data === 1) {
|
||||
this.activeName = 'second'
|
||||
} else {
|
||||
this.$message.warning('未缴纳履约保证金')
|
||||
}
|
||||
})
|
||||
},
|
||||
takeBack(row) {
|
||||
this.addForm('form')
|
||||
this.performanceBondCode = row.履约保证金流水号
|
||||
this.dialogTimeVisible = true
|
||||
},
|
||||
callOffTime() {
|
||||
this.dialogTimeVisible = false
|
||||
},
|
||||
submitTime(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
takeBack(this.performanceBondCode, this.form.实际收回日期).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('操作成功')
|
||||
this.dialogTimeVisible = false
|
||||
typeOfPerformanceBond(this.projectId).then(response => {
|
||||
const data = response.data[0].履约保证金类型
|
||||
return data
|
||||
}).then(data => {
|
||||
if (data === 1) {
|
||||
this.activeName = 'first'
|
||||
this.listLoading2 = true
|
||||
searchTableData2(this.projectId).then(response => {
|
||||
this.listLoading2 = false
|
||||
const data = response.data
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].实际收回日期 !== '' && data[i].实际收回日期 !== null ? data[i].实际收回日期 = data[i].实际收回日期.substring(0, data[i].实际收回日期.length - 8) : data[i].实际收回日期
|
||||
data[i].节点日期 !== '' && data[i].节点日期 !== null ? data[i].节点日期 = data[i].节点日期.substring(0, data[i].节点日期.length - 8) : data[i].节点日期
|
||||
data[i].计划收款日期 !== '' && data[i].计划收款日期 !== null ? data[i].计划收款日期 = data[i].计划收款日期.substring(0, data[i].计划收款日期.length - 8) : data[i].计划收款日期
|
||||
parseInt(data[i].是否收回) === 1 ? data[i].是否禁用收回 = true : data[i].是否禁用收回 = false
|
||||
}
|
||||
this.tableData2 = data
|
||||
})
|
||||
} else if (data === 1) {
|
||||
this.activeName = 'second'
|
||||
} else {
|
||||
this.$message.warning('未缴纳履约保证金')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error('操作失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -12,7 +12,7 @@
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="pageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
|
||||
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px;margin-right: 15px" @click="addSafetyMargin();flag1 = 1">增加</el-button>
|
||||
<span>预警颜色说明:</span>
|
||||
<el-tag type="info">未到时间</el-tag>
|
||||
|
||||
Reference in New Issue
Block a user