contractdetail.js 10 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/alldeatil/contractdetail"],{"1e30":function(t,e,n){"use strict";n.r(e);var i=n("2b72"),a=n.n(i);for(var c in i)"default"!==c&&function(t){n.d(e,t,(function(){return i[t]}))}(c);e["default"]=a.a},"2b72":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i,a=o(n("a34a")),c=n("595d");function o(t){return t&&t.__esModule?t:{default:t}}function s(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?s(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t,e,n,i,a,c,o){try{var s=t[c](o),r=s.value}catch(u){return void n(u)}s.done?e(r):Promise.resolve(r).then(i,a)}function f(t){return function(){var e=this,n=arguments;return new Promise((function(i,a){var c=t.apply(e,n);function o(t){l(c,i,a,o,s,"next",t)}function s(t){l(c,i,a,o,s,"throw",t)}o(void 0)}))}}var d={data:function(){return{editall:!1,quan:!1,state:0,fileList1:[],fileList2:[],fileList3:[],fileList4:[],msg:"",id:"",fankui:"",feedback:"",disabled:!1,delablepic:!0,placehodertitle:"请输入审核反馈"}},onLoad:function(t){i=this,t.id&&(this.id=t.id),this.state=this.$store.state.admin,1==this.state&&(this.disabled=!0,this.delablepic=!1)},onShow:function(){this.init()},methods:{init:function(){var e=this;t.showLoading(),t.$u.http.get("/api/Contract/".concat(this.id),{custom:{auth:!0}}).then((function(n){t.hideLoading(),e.msg=n,e.msg.contractDraft.result.forEach((function(t){t.checked=!1}));var i=n.picList.map((function(t){return{url:t}}));e.fileList1=i;var a=n.invoicePicList.map((function(t){return{url:t}}));e.fileList2=a;var c=n.tradePicList.map((function(t){return{url:t}}));if(e.fileList3=c,n.feedbackPics){var o=n.feedbackPics.map((function(t){return{url:t}}));e.fileList4=o}1==e.state?n.feedback.length>0?e.feedback=n.feedback:e.feedback="无":n.feedback.length>0?e.feedback=n.feedback:e.placehodertitle="请输入审核反馈"})).catch((function(e){t.hideLoading(),console.log(e)}))},openEidt:function(){this.editall=!0},checkBox:function(t){var e=this.msg.contractDraft.result;e.forEach((function(e){e.id==t&&(e.checked=!e.checked)})),this.msg.contractDraft.result=JSON.parse(JSON.stringify(e))},allSelect:function(){var t=this.msg.contractDraft.result;this.quan?t.forEach((function(t){t.checked=!0})):t.forEach((function(t){t.checked=!1})),this.msg.contractDraft.result=JSON.parse(JSON.stringify(t))},acpDetail:function(){t.navigateTo({url:"/pages/alldeatil/acptdetail"})},addBill:function(){var e={contractId:this.id};t.navigateTo({url:"/pages/alldeatil/addbill?obj="+JSON.stringify(e)})},billDetail:function(e,n){var i={id:e,index:n,contractId:this.id,statusText:this.msg.statusText};t.navigateTo({url:"/pages/alldeatil/billdetail?obj="+JSON.stringify(i)})},makeSureAll:function(){this.quan=!this.quan,this.allSelect()},selectDown:function(){this.editall=!1,this.quan=!0;var t=this.msg.contractDraft.result;t.forEach((function(t){t.checked=!1}))},tryAgain:function(){var e=this.msg;t.navigateTo({url:"/pages/alldeatil/upcontract?obj="+JSON.stringify(e)})},examineSuccess:function(){t.showModal({title:"提示",content:"是否审核成功?",success:function(e){if(e.confirm){var n={id:Number(i.id),approveStatus:1};if(i.fileList4.length>0){var a=[];i.fileList4.forEach((function(t){a.push(t.url)})),n.feedbackPicList=a}var c=i.feedback;c.length>0&&(n.feedback=c),t.showLoading(),t.$u.http.post("api/Contract/approveContract",n,{custom:{auth:!0}}).then((function(e){t.hideLoading(),i.editall=!1,i.quan=!1,i.$toast("操作成功"),setTimeout((function(){i.init()}),500)})).catch((function(e){t.hideLoading(),i.$toast(e.msg)}))}else e.cancel}})},examineFail:function(){t.showModal({title:"提示",content:"是否审核失败?",success:function(e){if(e.confirm){var n={id:Number(i.id),approveStatus:2};if(i.fileList4.length>0){var a=[];i.fileList4.forEach((function(t){a.push(t.url)})),n.feedbackPicList=a}var c=i.feedback;c.length>0&&(n.feedback=c),t.showLoading(),t.$u.http.post("api/Contract/approveContract",n,{custom:{auth:!0}}).then((function(e){t.hideLoading(),i.editall=!1,i.quan=!1,i.$toast("操作成功"),setTimeout((function(){i.init()}),500)})).catch((function(e){t.hideLoading(),i.$toast(e.msg)}))}else e.cancel}})},examineBillSuccess:function(){var e=[];this.msg.contractDraft.result.forEach((function(t){t.checked&&e.push(t.id)})),0!=e.length?t.showModal({title:"提示",content:"是否批量审核成功?",success:function(n){n.confirm?(t.showLoading(),t.$u.http.post("/api/Contract/contractDraft/manager",{ids:e,operateType:3},{custom:{auth:!0}}).then((function(e){t.hideLoading(),i.editall=!1,i.quan=!1,i.$toast("操作成功"),setTimeout((function(){i.init()}),500)})).catch((function(e){t.hideLoading(),i.$toast(e.msg)}))):n.cancel}}):i.$toast("请选择汇票")},examineBillFail:function(){var e=[];this.msg.contractDraft.result.forEach((function(t){t.checked&&e.push(t.id)})),0!=e.length?t.showModal({title:"提示",content:"是否审核失败?",success:function(n){n.confirm?(t.showLoading(),t.$u.http.post("/api/Contract/contractDraft/manager",{ids:e,operateType:4},{custom:{auth:!0}}).then((function(e){t.hideLoading(),i.editall=!1,i.quan=!1,i.$toast("操作成功"),setTimeout((function(){i.init()}),500)})).catch((function(e){t.hideLoading(),i.$toast(e.msg)}))):n.cancel&&console.log("用户点击取消")}}):this.$toast("请选择汇票")},dele:function(){var e=[];this.msg.contractDraft.result.forEach((function(t){t.checked&&e.push(t.id)})),0!=e.length?t.showModal({title:"提示",content:"是否删除汇票?",success:function(n){n.confirm?(t.showLoading(),t.$u.http.post("/api/Contract/contractDraft/manager",{ids:e,operateType:1},{custom:{auth:!0}}).then((function(e){t.hideLoading(),i.editall=!1,i.quan=!1,i.$toast("操作成功"),setTimeout((function(){i.init()}),500)})).catch((function(e){t.hideLoading(),i.$toast(e.msg)}))):n.cancel}}):i.$toast("请选择汇票")},restore:function(){var e=[];this.msg.contractDraft.result.forEach((function(t){t.checked&&e.push(t.id)})),0!=e.length?t.showModal({title:"提示",content:"是否复原汇票?",success:function(n){n.confirm?(t.showLoading(),t.$u.http.post("/api/Contract/contractDraft/manager",{ids:e,operateType:2},{custom:{auth:!0}}).then((function(e){t.hideLoading(),i.editall=!1,i.quan=!1,i.$toast("操作成功"),setTimeout((function(){i.init()}),500)})).catch((function(e){t.hideLoading(),i.$toast(e.msg)}))):n.cancel}}):i.$toast("请选择汇票")},deleContract:function(){var e=[];this.msg.contractDraft.result.forEach((function(t){t.checked&&e.push(t.id)})),0!=e.length?t.showModal({title:"提示",content:"是否删除汇票?",success:function(n){n.confirm?(t.showLoading(),t.$u.http.post("/api/Contract/contractDraft/manager",{ids:e,operateType:1},{custom:{auth:!0}}).then((function(e){t.hideLoading(),i.editall=!1,i.quan=!1,i.$toast("操作成功"),setTimeout((function(){i.init()}),500)})).catch((function(e){t.hideLoading(),i.$toast(e.msg)}))):n.cancel}}):i.$toast("请选择汇票")},restoreContract:function(){var e=[];this.msg.contractDraft.result.forEach((function(t){t.checked&&e.push(t.id)})),0!=e.length?t.showModal({title:"提示",content:"是否复原汇票?",success:function(n){n.confirm?(t.showLoading(),t.$u.http.post("/api/Contract/contractDraft/manager",{ids:e,operateType:2},{custom:{auth:!0}}).then((function(e){t.hideLoading(),i.editall=!1,i.quan=!1,i.$toast("操作成功"),setTimeout((function(){i.init()}),500)})).catch((function(e){t.hideLoading(),i.$toast(e.msg)}))):n.cancel}}):i.$toast("请选择汇票")},deletePic:function(t){this["fileList".concat(t.name)].splice(t.index,1)},afterRead:function(t){var e=this;return f(a.default.mark((function n(){var i,c,o,s,u;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:i=[].concat(t.file),c=e["fileList".concat(t.name)].length,i.map((function(n){e["fileList".concat(t.name)].push(r(r({},n),{},{status:"uploading",message:"上传中"}))})),o=0;case 4:if(!(o<i.length)){n.next=14;break}return n.next=7,e.uploadFilePromise(i[o].url);case 7:s=n.sent,u=e["fileList".concat(t.name)][c],e["fileList".concat(t.name)].splice(c,1,Object.assign(u,{status:"success",message:"",url:s})),c++;case 11:o++,n.next=4;break;case 14:case"end":return n.stop()}}),n)})))()},uploadFilePromise:function(e){return new Promise((function(n,i){t.uploadFile({url:c.mainUrl+"/api/File",filePath:e,name:"File",header:{"User-Agent":"apifox/1.0.0 (https://www.apifox.cn)"},formData:{File:JSON.stringify(e)},success:function(t){var e=JSON.parse(t.data);setTimeout((function(){n(e.data.file)}),1e3)}})}))}}};e.default=d}).call(this,n("543d")["default"])},4664:function(t,e,n){},5345:function(t,e,n){"use strict";(function(t){n("5413");i(n("66fd"));var e=i(n("8e50"));function i(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=n,t(e.default)}).call(this,n("543d")["createPage"])},"8e50":function(t,e,n){"use strict";n.r(e);var i=n("d618"),a=n("1e30");for(var c in a)"default"!==c&&function(t){n.d(e,t,(function(){return a[t]}))}(c);n("925a");var o,s=n("f0c5"),r=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],o);e["default"]=r.exports},"925a":function(t,e,n){"use strict";var i=n("4664"),a=n.n(i);a.a},d618:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return c})),n.d(e,"a",(function(){return i}));var i={uUpload:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-upload/u-upload")]).then(n.bind(null,"8bcb"))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("node-modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,"326d"))}},a=function(){var t=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.editall=!0})},c=[]}},[["5345","common/runtime","common/vendor"]]]);