|
@@ -17,17 +17,21 @@ class work_path(Load):
|
|
|
,height = '600'
|
|
|
,add = False
|
|
|
,edit = False
|
|
|
- ,search = (('label-1','workdate-time-start','workdate-time-end','category_id-select-'), (u'日期范围',u'开始时间',u'截止时间',u'劳作分类'))
|
|
|
- ,thead = (u'劳作时间', u'劳作分类', u'劳作方式', u'劳作地块', u'劳作用量', u'更新时间')
|
|
|
- ,tbody = ('workdate', 'category', 'method', 'land', 'amount', 'cdate')
|
|
|
+ ,search = (('label-1','workdate-time-start','workdate-time-end','farm_id-select-','category_id-select-'), (u'日期范围',u'开始时间',u'截止时间',u'选择农场',u'劳作分类'))
|
|
|
+ ,thead = (u'所属农场', u'劳作时间', u'劳作分类', u'劳作方式', u'劳作地块', u'劳作用量', u'更新时间')
|
|
|
+ ,tbody = ('farm','workdate', 'category', 'method', 'land', 'amount', 'cdate')
|
|
|
,state = False
|
|
|
)
|
|
|
+ self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
|
|
|
self.list('device_gateway')
|
|
|
|
|
|
self.data['common']['search_category_id-select-'] = self.service('common').list('farm_work_category')
|
|
|
self.list('farm_work')
|
|
|
if self.data['list']:
|
|
|
for key, value in enumerate(self.data['list']):
|
|
|
+ farm = self.service('common').one('farm', id=value['farm_id'])
|
|
|
+
|
|
|
+ self.data['list'][key]['farm'] = farm['name']
|
|
|
category = self.service('common').one('farm_work_category', id=value['category_id'])
|
|
|
self.data['list'][key]['category'] = category['name']
|
|
|
method = self.service('common').one('farm_work_method', id=value['method_id'])
|
|
@@ -42,11 +46,12 @@ class work_update_path(Load):
|
|
|
def get(self):
|
|
|
self.set(
|
|
|
path = '/work/work'
|
|
|
- ,label = (u'劳作时间',u'劳作类别',u'劳作方式',u'劳作用量',u'劳作地块',u'图像记录')
|
|
|
- ,update = ('workdate-date-required','category_id-select-required-method_id','method_id-select-required--category_id','amount-input-required','land_id-select-required','pic-pic-required')
|
|
|
+ ,label = (u'所属农场',u'劳作时间',u'劳作类别',u'劳作方式',u'劳作用量',u'劳作地块',u'图像记录')
|
|
|
+ ,update = ('farm_id-select-required', 'workdate-date-required','category_id-select-required-method_id','method_id-select-required--category_id','amount-input-required','land_id-select-required','pic-pic-required')
|
|
|
,update_category_id = self.service('common').list('farm_work_category')
|
|
|
,update_method_id = self.service('common').list('farm_work_method')
|
|
|
,update_land_id = self.service('common').list('farm_work_land')
|
|
|
+ ,update_farm_id = self.service('common').list('farm', search={'eros_status':2})
|
|
|
)
|
|
|
self.one('farm_work')
|
|
|
self.show('update')
|
|
@@ -70,15 +75,18 @@ class method_path(Load):
|
|
|
,height = '300'
|
|
|
,add = False
|
|
|
,edit = False
|
|
|
- ,search = (('label-1','cdate-time-start','cdate-time-end','category_id-select-','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'劳作分类',u'劳作内容'))
|
|
|
- ,thead = (u'劳作内容', u'劳作分类', u'更新时间')
|
|
|
- ,tbody = ('name', 'category', 'cdate')
|
|
|
+ ,search = (('label-1','cdate-time-start','cdate-time-end','farm_id-select-','category_id-select-','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'选择农场',u'劳作分类',u'劳作内容'))
|
|
|
+ ,thead = (u'所属农场',u'劳作内容', u'劳作分类', u'更新时间')
|
|
|
+ ,tbody = ('farm','name', 'category', 'cdate')
|
|
|
,state = False
|
|
|
)
|
|
|
+ self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
|
|
|
self.data['common']['search_category_id-select-'] = self.service('common').list('farm_work_category')
|
|
|
self.list('farm_work_method')
|
|
|
if self.data['list']:
|
|
|
for key, value in enumerate(self.data['list']):
|
|
|
+ farm = self.service('common').one('farm', id=value['farm_id'])
|
|
|
+ self.data['list'][key]['farm'] = farm['name']
|
|
|
category = self.service('common').one('farm_work_category', id=value['category_id'])
|
|
|
self.data['list'][key]['category'] = category['name']
|
|
|
self.show('list')
|
|
@@ -89,9 +97,10 @@ class method_update_path(Load):
|
|
|
def get(self):
|
|
|
self.set(
|
|
|
path = '/work/method'
|
|
|
- ,label = (u'劳作内容',u'劳作分类')
|
|
|
- ,update = ('name-input-required','category_id-select-required')
|
|
|
+ ,label = (u'所属农场', u'劳作内容',u'劳作分类')
|
|
|
+ ,update = ('farm_id-select-required', 'name-input-required','category_id-select-required')
|
|
|
,update_category_id = self.service('common').list('farm_work_category')
|
|
|
+ ,update_farm_id = self.service('common').list('farm', search={'eros_status':2})
|
|
|
)
|
|
|
self.one('farm_work_method')
|
|
|
self.show('update')
|
|
@@ -115,12 +124,17 @@ class category_path(Load):
|
|
|
,height = '300'
|
|
|
,add = False
|
|
|
,edit = False
|
|
|
- ,search = (('label-1','cdate-time-start','cdate-time-end','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'选择农场',u'分类名称'))
|
|
|
- ,thead = (u'分类名称', u'更新时间')
|
|
|
- ,tbody = ('name', 'cdate')
|
|
|
+ ,search = (('label-1','cdate-time-start','cdate-time-end','farm_id-select-','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'选择农场',u'分类名称'))
|
|
|
+ ,thead = (u'所属农场',u'分类名称', u'更新时间')
|
|
|
+ ,tbody = ('farm', 'name', 'cdate')
|
|
|
,state = False
|
|
|
)
|
|
|
+ self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
|
|
|
self.list('farm_work_category')
|
|
|
+ if self.data['list']:
|
|
|
+ for key, value in enumerate(self.data['list']):
|
|
|
+ farm = self.service('common').one('farm', id=value['farm_id'])
|
|
|
+ self.data['list'][key]['farm'] = farm['name']
|
|
|
self.show('list')
|
|
|
|
|
|
class category_update_path(Load):
|
|
@@ -129,8 +143,9 @@ class category_update_path(Load):
|
|
|
def get(self):
|
|
|
self.set(
|
|
|
path = '/work/category'
|
|
|
- ,label = (u'分类名称')
|
|
|
- ,update = ('name-input-required')
|
|
|
+ ,label = (u'所属农场', u'分类名称')
|
|
|
+ ,update = ('farm_id-select-required', 'name-input-required')
|
|
|
+ ,update_farm_id = self.service('common').list('farm', search={'eros_status':2})
|
|
|
)
|
|
|
self.one('farm_work_category')
|
|
|
self.show('update')
|
|
@@ -155,12 +170,17 @@ class land_path(Load):
|
|
|
,height = '300'
|
|
|
,add = False
|
|
|
,edit = False
|
|
|
- ,search = (('label-1','cdate-time-start','cdate-time-end','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'地块名称'))
|
|
|
- ,thead = (u'地块名称', u'更新时间')
|
|
|
- ,tbody = ('name', 'cdate')
|
|
|
+ ,search = (('label-1','cdate-time-start','cdate-time-end','farm_id-select-','name-input-mlike'), (u'日期范围',u'开始时间',u'截止时间',u'选择农场',u'地块名称'))
|
|
|
+ ,thead = (u'所属农场',u'地块名称', u'更新时间')
|
|
|
+ ,tbody = ('farm', 'name', 'cdate')
|
|
|
,state = False
|
|
|
)
|
|
|
+ self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
|
|
|
self.list('farm_work_land')
|
|
|
+ if self.data['list']:
|
|
|
+ for key, value in enumerate(self.data['list']):
|
|
|
+ farm = self.service('common').one('farm', id=value['farm_id'])
|
|
|
+ self.data['list'][key]['farm'] = farm['name']
|
|
|
self.show('list')
|
|
|
|
|
|
class land_update_path(Load):
|
|
@@ -169,8 +189,9 @@ class land_update_path(Load):
|
|
|
def get(self):
|
|
|
self.set(
|
|
|
path = '/work/land'
|
|
|
- ,label = (u'地块名称',)
|
|
|
- ,update = ('name-input-required',)
|
|
|
+ ,label = (u'所属农场', u'地块名称')
|
|
|
+ ,update = ('farm_id-select-required','name-input-required')
|
|
|
+ ,update_farm_id = self.service('common').list('farm', search={'eros_status':2})
|
|
|
)
|
|
|
self.one('farm_work_land')
|
|
|
self.show('update')
|