{
	"name": "plugin/vue-renderer/renderer/test-param.json",
	"html": "<div></div>",
	"file_name": "form/nc/nc-timecard/nc-timecard",
	"inline_template": true,
	"style": false,
	"js": "let a = 1;",
	"js-": "const rec = state.rec\nconst arr = state.arr\nconst hdr = state.hdr\nconst grid = state.grid\nprovide('state', state)\n// form/nc/nc-timecard/nc-timecard.js\n\nfunction queryRec() {\n\tif (state.data == null || state.data.em == null) {\n\t\treturn\n\t}\n\tlet emp = rec.employee_id\n\tif (emp !== '') {\n\t\temp = nc.findCaseInsensitiveRecFromArr(state.data.em.data, 'per.person_id', rec.employee_id)\n\t}\n\tconst callback = function () {\n\t\tif (rec.timecard_state === 'started') {\n\t\t\trec.end_time = dt.currentDate() // dt.currentDateUtc()\n\t\t\trec.work_time = dt.hourDifference(rec.start_time, rec.end_time)\n\t\t}\n\t}\n\tif (emp == null || emp.per == null || emp.per.person_id === '') {\n\t\t// \t\t\t\trec.employee_id = ''\n\t\tnc.callServer(\n\t\t\tstate,\n\t\t\t'query',\n\t\t\t{\n\t\t\t\tname: 'form/nc/nc-timecard/init.json'\n\t\t\t},\n\t\t\tcallback\n\t\t) // clear field values if employee was not found\n\t} else {\n\t\tnc.setRec(state, 'per', emp.per)\n\t\tnc.setRec(state, 'employee_id', emp.per.person_id)\n\t\tnc.callServer(\n\t\t\tstate,\n\t\t\t'query/rec',\n\t\t\t{\n\t\t\t\tname: 'form/nc/nc-timecard/query/employee.json',\n\t\t\t\tparameter: {\n\t\t\t\t\temployee: rec.employee_id,\n\t\t\t\t\toption: 'empty-record',\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\ttimec: {\n\t\t\t\t\t\t\temployee_id: rec.employee_id\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tscript: 'timec.employee_id'\n\t\t\t\t}\n\t\t\t},\n\t\t\tcallback\n\t\t)\n\t}\n}\n/*\n\t\tcallback = (ret) ->\n\t\t\tif ret and ret.rec and ret.rec.timecard_state == 'started'\n\t\t\t\tret.rec.end_time = dt.currentDateUtc()\n\t\t\t\tcalculateWorkTime(ret.rec)\n\t\t*/\n// nc.callServer(state, \"input/table-code\", {\"table\": \"timec\", \"rec\": rec, \"field_name\": \"timec.end_time\"})\nfunction save() {\n\tif (rec.employee_id !== '') {\n\t\tif (rec.timecard_state === 'started') {\n\t\t\trec.timecard_state = 'finish'\n\t\t\trec.end_time = dt.currentDateUtc()\n\t\t} else {\n\t\t\trec.timecard_state = 'started'\n\t\t\trec.start_time = dt.currentDateUtc() // dt.formatDateTime(dt.currentDateUtc()),  # new Date()\n\t\t\trec.end_time = rec.start_time\n\t\t\trec.work_time = 0\n\t\t}\n\t\tnc.saveRecord(state, 'timec', rec)\n\t\t// if rec.timecard_state == 'finish'\n\t\trec.employee_id = ''\n\t\tqueryRec() // clear field values\n\t}\n}\n",
	"vue_path": ""
}
