global.webpackJsonp([8],{ /***/ 318: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _vue = __webpack_require__(1); var _vue2 = _interopRequireDefault(_vue); var _index = __webpack_require__(319); var _index2 = _interopRequireDefault(_index); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var app = new _vue2.default(_index2.default); app.$mount(); exports.default = { config: { navigationBarTitleText: '值班调班' } }; /***/ }), /***/ 319: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue__ = __webpack_require__(321); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_mpvue_loader_lib_template_compiler_index_id_data_v_18bb78ca_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_mpvue_loader_lib_selector_type_template_index_0_index_vue__ = __webpack_require__(322); var disposed = false function injectStyle (ssrContext) { if (disposed) return __webpack_require__(320) } var normalizeComponent = __webpack_require__(0) /* script */ /* template */ /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = "data-v-18bb78ca" /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue___default.a, __WEBPACK_IMPORTED_MODULE_1__node_modules_mpvue_loader_lib_template_compiler_index_id_data_v_18bb78ca_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_mpvue_loader_lib_selector_type_template_index_0_index_vue__["a" /* default */], __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) Component.options.__file = "src\\pages\\schedule\\index.vue" if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")} /* hot reload */ if (false) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-18bb78ca", Component.options) } else { hotAPI.reload("data-v-18bb78ca", Component.options) } module.hot.dispose(function (data) { disposed = true }) })()} /* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ 320: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ 321: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _NoData = __webpack_require__(8); var _NoData2 = _interopRequireDefault(_NoData); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var week = ['日', '一', '二', '三', '四', '五', '六']; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // exports.default = { components: { NoData: _NoData2.default }, data: function data() { return { schedule: [], loaded: false, changing: false, changingIndex: 0, replace: false, replaceIndex: 0, tomorrow: '', targetDate: '', submitting: false, cause: '', sub_id: '', SCID: '', sub_date: '', LawFirm: { columnOne: [], index: 0, arrStruct: [], label: '点击选择代班人' } }; }, computed: { initialDateValue: function initialDateValue() { return this.targetDate.substring(0, 10) || (this.schedule.length ? this.schedule[this.changingIndex].schedule_Date.substring(0, 10) : ''); } }, methods: { getSchedule: function getSchedule() { var _this = this; var showLoading = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; this.loaded = false; if (showLoading) wx.showLoading({ title: '正在加载' }); wx.request({ url: this.rootUrl + 'sch/schDatebyliid', method: 'POST', header: { 'content-type': 'application/x-www-form-urlencoded' }, data: { sessionID: wx.getStorageSync('sessionID') }, success: function success(res) { console.log(res.data); if (res.statusCode == '500') { _this.service.getUnionId(_this.rootAvatar, _this.rootUrl).then(function (res) { return _this.getSchedule(showLoading); }); } else { _this.schedule = []; _this.schedule = res.data; _this.schedule.forEach(function (v) { v.schedule_Date = _this.service.correctTime(v.schedule_Date) + ' (星期' + week[_this.service.correctTime(v.schedule_Date, 'DateObj').getDay()] + ')'; }); _this.loaded = true; if (showLoading) wx.hideLoading(); } } }); }, changeSchedule: function changeSchedule(i) { this.tomorrow = this.service.formatDate(new Date(new Date().getTime() + 24 * 60 * 60 * 1000)); this.changingIndex = i; this.changing = true; }, replaceSchedule: function replaceSchedule(i) { var _this2 = this; this.replaceIndex = i; var scheduleDate = this.schedule[this.replaceIndex].schedule_Date; // console.log(scheduleDate) // console.log(this.schedule[this.replaceIndex].schedule_Date.substring(0,10)) wx.request({ url: this.rootUrl + 'lawSubstitute/getSubstituteByApplyId', method: 'get', header: { 'content-type': 'application/x-www-form-urlencoded' }, data: { scheduleDate: scheduleDate.substring(0, 10), sessionID: wx.getStorageSync('sessionID') }, success: function success(res) { // console.log(res.data) if (res.statusCode == '500') {} else { if (res.data > 0) { _this2.replace = false; wx.showModal({ title: '', content: '您已申请代班,请耐心等待审批!', showCancel: false, confirmText: '知道了' }); } else { _this2.replace = true; } } } }); this.getLawFirmByLIID(); }, pickerConfirm: function pickerConfirm(e) { var time = e.mp.detail.value; this.targetDate = this.service.correctTime(time) + ' (星期' + week[this.service.correctTime(time, 'DateObj').getDay()] + ')'; }, cancel: function cancel() { this.changing = false; this.replace = false; this.targetDate = ''; }, confirm: function confirm() { var _this3 = this; wx.showModal({ title: '', content: '\u786E\u8BA4\u5C06\u8BE5\u6B21\u503C\u73ED\u8C03\u5230' + this.targetDate.substring(0, 10) + '\u5417?', success: function success(res) { if (res.confirm) { _this3.changeScheduleRequest(); // this.changing = false // this.targetDate = '' } } }); }, changeScheduleRequest: function changeScheduleRequest() { var _this4 = this; this.submitting = true; wx.showLoading({ title: '正在修改' }); wx.request({ url: this.rootUrl + 'sch/updatesch', method: 'POST', header: { 'content-type': 'application/x-www-form-urlencoded' }, data: { lsid: this.schedule[this.changingIndex].lsid, schedule_date: this.targetDate.substring(0, 10), sessionID: wx.getStorageSync('sessionID') }, success: function success(res) { if (res.statusCode == '500') { _this4.service.getUnionId(_this4.rootAvatar, _this4.rootUrl).then(function () { return _this4.changeScheduleRequest(); }); } else if (res.data === 1) { wx.hideLoading(); wx.showToast({ title: '修改成功' }); _this4.getSchedule(false); _this4.changing = false; _this4.submitting = false; _this4.targetDate = ''; } else if (res.data === -1) { wx.hideLoading(); wx.showModal({ title: '修改失败', content: _this4.targetDate.substring(0, 10) + '\u5DF2\u6709\u60A8\u7684\u6392\u73ED', showCancel: false }); _this4.submitting = false; } } }); }, getLawFirmByLIID: function getLawFirmByLIID() { var _this5 = this; wx.request({ url: this.rootUrl + 'law/getLawFirmByLIID', method: 'get', header: { 'content-type': 'application/x-www-form-urlencoded' }, data: { sessionID: wx.getStorageSync('sessionID') }, success: function success(res) { console.log(res.data); if (res.statusCode == '500') {} else { _this5.LawFirm.columnOne = res.data.map(function (v) { return v.name; }); _this5.LawFirm.arrStruct = res.data.map(function (v) { return { label: v.name, value: v.liid }; }); // res.data.forEach( v => { // this.LawFirmArray.push(v.name) // }) } } }); }, pickerConfirmLawFirm: function pickerConfirmLawFirm(e, s) { this.LawFirm.index = e.mp.detail.value; this.LawFirm.label = this.LawFirm.columnOne[this.LawFirm.index]; }, commit: function commit(e) { var _this6 = this; if (this.commiting) return; var inputs = this.service.filter(e.mp.detail.value); var LawFirm = this.LawFirm.label.replace('点击选择代班人', ''); if (!this.service.checkEmptyInput([LawFirm, this.cause], ['代班人', '事由'])) { return; } if (!this.service.checkBadWords([this.cause], ['事由'])) { return; } wx.showModal({ title: '', content: '确定要代班吗?', success: function success(res) { if (res.confirm) { _this6.execCommit(e); } } }); }, execCommit: function execCommit(e) { var _this7 = this; console.log(this.schedule[this.replaceIndex]); console.log(this.LawFirm.arrStruct[this.LawFirm.index].value); this.commiting = true; wx.showLoading({ title: '正在提交' }); wx.request({ url: this.rootUrl + 'lawSubstitute/addLawSubstitute', method: 'POST', header: { 'content-type': 'application/x-www-form-urlencoded' }, data: { sub_id: this.LawFirm.arrStruct[this.LawFirm.index].value, cause: this.cause, LSID: this.schedule[this.replaceIndex].lsid, sub_date: this.schedule[this.replaceIndex].schedule_Date, sessionID: wx.getStorageSync('sessionID') }, success: function success(res) { console.log(res); if (res.statusCode == '500') { _this7.service.getUnionId(_this7.rootAvatar, _this7.rootUrl).then(function (res) { return _this7.submit_exec(content); }); } else { // wx.hideLoading() if (res.data === 1) { wx.showModal({ title: '提交成功', content: '', showCancel: false }); _this7.text = ''; wx.hideLoading(); // this.toHomelist() } else { wx.showToast({ title: '提交失败', icon: 'none' }); } _this7.LawFirm = { columnOne: [], index: 0, arrStruct: [], label: '点击选择代班人' }; _this7.cause = ''; _this7.replaceIndex = 0; _this7.commiting = false; _this7.changing = false; _this7.replace = false; } } }); } }, onLoad: function onLoad() { this.getSchedule(); }, onShow: function onShow() { wx.showModal({ title: '', content: '本页面列出您未来10次的值班\n日期,您可以进行调班请至少提前\n一天进行调班,不支持当天调班', showCancel: false, confirmText: '知道了' }); }, onUnload: function onUnload() { this.changing = false; this.targetDate = ''; this.submitting = false; this.cause = ''; this.LawFirm = { columnOne: [], index: 0, arrStruct: [], label: '点击选择代班人' }; this.replaceIndex = 0; this.replace = false; } }; /***/ }), /***/ 322: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { staticClass: "container" }, [_vm._l((_vm.schedule), function(v, i) { return _c('div', { key: i, staticClass: "list-item" }, [_c('div', { staticClass: "schedule" }, [_c('div', { staticClass: "time" }, [_vm._v(_vm._s(v.schedule_Date))]), _vm._v(" "), _c('div', { staticClass: "locate" }, [_c('img', { attrs: { "src": "/static/imgs/community.png" } }), _vm._v(_vm._s(v.comm_Name))])]), _vm._v(" "), _c('button', { attrs: { "type": "primary", "disabled": _vm.changing, "eventid": '0-' + i }, on: { "tap": function($event) { _vm.changeSchedule(i) } } }, [_vm._v("调班")]), _vm._v(" "), _c('button', { attrs: { "type": "primary", "disabled": _vm.replace, "eventid": '1-' + i }, on: { "tap": function($event) { _vm.replaceSchedule(i) } } }, [_vm._v("代班")])], 1) }), _vm._v(" "), (_vm.loaded && _vm.schedule.length == 0) ? _c('NoData', { attrs: { "paddingTop": "0", "mpcomid": '0' } }) : _vm._e(), _vm._v(" "), (_vm.changing) ? _c('div', { staticClass: "change-box-mask", attrs: { "eventid": '6' }, on: { "touchmove": function($event) { $event.stopPropagation(); } } }, [_c('div', { staticClass: "change-box", attrs: { "eventid": '5' }, on: { "tap": function($event) { $event.stopPropagation(); } } }, [_c('div', { staticClass: "info" }, [_c('div', { staticClass: "title" }, [_vm._v("值班社区")]), _vm._v(" "), _c('div', { staticClass: "value" }, [_vm._v(_vm._s(_vm.schedule[_vm.changingIndex].comm_Name))])]), _vm._v(" "), _c('div', { staticClass: "info" }, [_c('div', { staticClass: "title" }, [_vm._v("值班日期")]), _vm._v(" "), _c('div', { staticClass: "value" }, [_vm._v(_vm._s(_vm.schedule[_vm.changingIndex].schedule_Date))])]), _vm._v(" "), _c('div', { staticClass: "info" }, [_c('div', { staticClass: "title" }, [_vm._v("调班日期")]), _vm._v(" "), _c('picker', { staticClass: "value", staticStyle: { "color": "#AA001A" }, attrs: { "mode": "date", "start": _vm.tomorrow, "value": _vm.initialDateValue, "eventid": '2' }, on: { "change": _vm.pickerConfirm } }, [_vm._v(_vm._s(_vm.targetDate || '点击选择调班的目标日期'))])], 1), _vm._v(" "), _c('div', { staticClass: "btn" }, [_c('button', { attrs: { "type": "primary", "eventid": '3' }, on: { "tap": _vm.cancel } }, [_vm._v("取消")]), _vm._v(" "), _c('button', { attrs: { "type": "warn", "disabled": !_vm.targetDate || _vm.submitting, "eventid": '4' }, on: { "tap": _vm.confirm } }, [_vm._v("确认")])], 1)])]) : _vm._e(), _vm._v(" "), _c('form', { attrs: { "eventid": '12' }, on: { "submit": _vm.commit } }, [(_vm.replace) ? _c('div', { staticClass: "change-box-mask", attrs: { "eventid": '11' }, on: { "touchmove": function($event) { $event.stopPropagation(); } } }, [_c('div', { staticClass: "change-box", attrs: { "eventid": '10' }, on: { "tap": function($event) { $event.stopPropagation(); } } }, [_c('div', { staticClass: "info" }, [_c('div', { staticClass: "title" }, [_vm._v("代班人")]), _vm._v(" "), _c('picker', { attrs: { "value": _vm.LawFirm.index, "range": _vm.LawFirm.columnOne, "name": "name", "eventid": '7' }, on: { "change": function($event) { _vm.pickerConfirmLawFirm($event, 'LawFirm') } } }, [_c('div', { attrs: { "hover-class": "hover" } }, [_vm._v(_vm._s(_vm.LawFirm.label))])])], 1), _vm._v(" "), _c('div', { staticClass: "info" }, [_c('div', { staticClass: "title" }, [_vm._v("事由")])]), _vm._v(" "), _c('textarea', { directives: [{ name: "model", rawName: "v-model", value: (_vm.cause), expression: "cause" }], staticClass: "reason", attrs: { "name": "cause", "placeholder": "请输入事由", "value": _vm.cause, "eventid": '8' }, domProps: { "value": (_vm.cause) }, on: { "input": function($event) { if ($event.target.composing) { return; } _vm.cause = $event.target.value } } }), _vm._v(" "), _c('div', { staticClass: "btn" }, [_c('button', { attrs: { "type": "primary", "eventid": '9' }, on: { "tap": _vm.cancel } }, [_vm._v("取消")]), _vm._v(" "), _c('button', { attrs: { "type": "warn", "form-type": "submit", "hover-class": "fade", "disabled": _vm.commiting } }, [_vm._v("确认")])], 1)])]) : _vm._e()])], 2) } var staticRenderFns = [] render._withStripped = true var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); if (false) { module.hot.accept() if (module.hot.data) { require("vue-hot-reload-api").rerender("data-v-18bb78ca", esExports) } } /***/ }) },[318]); //# sourceMappingURL=main.js.map