signForm.js 4.8 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesClass/signForm"],{"0bb6":function(t,e,n){"use strict";var i=n("5bf9"),u=n.n(i);u.a},"268b":function(t,e,n){"use strict";n.r(e);var i=n("71d5"),u=n("8f20");for(var r in u)"default"!==r&&function(t){n.d(e,t,(function(){return u[t]}))}(r);n("0bb6"),n("c5bd");var o,s=n("f0c5"),c=Object(s["a"])(u["default"],i["b"],i["c"],!1,null,"1c4dea48",null,!1,i["a"],o);e["default"]=c.exports},"5bf9":function(t,e,n){},"6d82":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("2f62");function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=n("157c"),c=n("f344"),a={computed:r({},(0,i.mapGetters)(["mainColor","customStyle"])),data:function(){return{classId:"",status:"",uploadUrl:c.uploadFile,uploadHeader:{Authorization:t.getStorageSync("token")},studentList:[],cardStyle:{fontWeight:"bold"},gridCustomStyle:{padding:"0 2px"}}},onLoad:function(t){this.classId=t.id,this.status=t.status},onShow:function(){this.initialize()},methods:{initialize:function(){var e=this;s.request(c.getSignStudentList,{id:this.classId},"POST").then((function(n){n.data.forEach((function(t){return t.checked=!1})),e.studentList=n.data;var i=t.getStorageSync("signUserList").length?t.getStorageSync("signUserList"):[];i.forEach((function(t){0==e.studentList.filter((function(e){return t.id==e.id})).length&&e.studentList.push(t)}))})).catch((function(t){e.$refs.uTips.show({title:t.message,type:"warning"})}))},uploadSuccess:function(t,e,n,i){return this.studentList[i].url=t.data.url,this.studentList[i].fileId=t.data.id,this.$refs.uTips.show({title:"文件上传成功",type:"success"}),!0},uploadError:function(t,e,n,i){this.$refs.uTips.show({title:"文件上传失败",type:"warning"})},uploadRemove:function(t,e,n){this.studentList[n].url="",this.studentList[n].fileId=""},uploadPreview:function(t,e,n){0==this.status&&(this.studentList[n].checked=!this.studentList[n].checked)},setSignCheck:function(t){0==this.status&&(t.checked=!t.checked)},goToSelectStudent:function(){t.navigateTo({url:"/pagesClass/signStudentList"})},goToSignForm:function(){t.navigateTo({url:"/pagesMember/signForm?id="+this.classId})},submitForm:function(){var e=this;s.request(c.submitSignForm,{classId:this.classId,signStudentIdList:this.studentList.filter((function(t){return 1==t.state||t.checked})).map((function(t){return t.fileId?{id:t.id,fileId:t.fileId}:{id:t.id}}))},"POST").then((function(n){e.$refs.uTips.show({title:"签到成功",type:"success"}),setTimeout((function(){t.navigateBack()}),1e3)})).catch((function(t){e.$refs.uTips.show({title:t.message,type:"warning"})}))}}};e.default=a}).call(this,n("543d")["default"])},"71d5":function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i}));var i={uCard:function(){return n.e("uview-ui/components/u-card/u-card").then(n.bind(null,"af68"))},uGrid:function(){return n.e("uview-ui/components/u-grid/u-grid").then(n.bind(null,"53f4"))},uGridItem:function(){return n.e("uview-ui/components/u-grid-item/u-grid-item").then(n.bind(null,"1395"))},uAvatar:function(){return n.e("uview-ui/components/u-avatar/u-avatar").then(n.bind(null,"3479"))},uUpload:function(){return Promise.all([n.e("common/vendor"),n.e("uview-ui/components/u-upload/u-upload")]).then(n.bind(null,"7fe5"))},uIcon:function(){return n.e("uview-ui/components/u-icon/u-icon").then(n.bind(null,"c4c2"))},uButton:function(){return n.e("uview-ui/components/u-button/u-button").then(n.bind(null,"0198"))},uTopTips:function(){return n.e("uview-ui/components/u-top-tips/u-top-tips").then(n.bind(null,"14ca"))}},u=function(){var t=this,e=t.$createElement;t._self._c},r=[]},"8e2f":function(t,e,n){"use strict";(function(t){n("e744");i(n("66fd"));var e=i(n("268b"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"8f20":function(t,e,n){"use strict";n.r(e);var i=n("6d82"),u=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=u.a},ae89:function(t,e,n){},c5bd:function(t,e,n){"use strict";var i=n("ae89"),u=n.n(i);u.a}},[["8e2f","common/runtime","common/vendor"]]]);