callSet.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <div class="content">
  3. <div class="search">
  4. <div class="title">催缴设置</div>
  5. <div class="search-icon">
  6. <el-button type="primary" @click="goBack">返回</el-button>
  7. </div>
  8. </div>
  9. <div class="organ-tree">
  10. <el-input v-model="filterText" placeholder="请输入关键字" clearable suffix-icon="el-icon-search"></el-input>
  11. <div class="tops">
  12. <template v-for="(item, index) in communityArr">
  13. <div
  14. class="organ-tree-item"
  15. :class="activeIndex === index ? 'active' : ''"
  16. :key="index"
  17. @click="toggle(index, item.id)"
  18. >
  19. {{ item.communityName }}
  20. </div>
  21. </template>
  22. </div>
  23. </div>
  24. <div class="content-right">
  25. <div class="">
  26. <div class="blockName">催缴设置(<span class="show-required-icon-star"></span>为必填项)</div>
  27. <el-form label-width="120px" :rules="formRules">
  28. <el-form-item label="催缴方式" prop="callType">
  29. <el-radio v-model="callPayment.callType" :label="1">短信</el-radio>
  30. <el-radio v-model="callPayment.callType" :label="2">微信</el-radio>
  31. </el-form-item>
  32. <el-form-item label="欠费时间">
  33. >
  34. <el-input style="width: 40%; margin: 0 15px" clearable v-trim v-model.trim="callPayment.arrearageDays"></el-input>天
  35. </el-form-item>
  36. <el-form-item label="催缴时间">
  37. <el-time-picker
  38. style="display: block"
  39. @change="toggleTime"
  40. v-model="callTime"
  41. placeholder="选择日期"
  42. ></el-time-picker>
  43. <el-radio v-model="callPayment.callFrequency" :label="1">一次</el-radio>
  44. <el-radio v-model="callPayment.callFrequency" :label="2">每天</el-radio>
  45. </el-form-item>
  46. </el-form>
  47. <div class="blockName">短信模板配置<span class="show-required-icon-star"></span>为必填项)</div>
  48. <zz-form :cols="formCols" :data="smsTemplate" :rules="formRules" labelWidth="120" ref="form" class="width50">
  49. <template slot="smsTemplate">
  50. <el-input
  51. v-model="smsTemplate.smsTemplate"
  52. type="textarea"
  53. resize="none"
  54. rows="6"
  55. :placeholder="textareaMsg"
  56. maxlength="300"
  57. show-word-limit="300"
  58. ></el-input>
  59. </template>
  60. <template slot="titleMsg">
  61. <div class="titleMsg">
  62. <div class="msgTitle">特别说明:</div>
  63. {accountname} :业主姓名 <br />
  64. {address}:房产信息<br />
  65. {Accountperiod}:费用账期 <br />
  66. {expenditure}:费用名称<br />
  67. {amount}:费用金额
  68. <div class="msgred">注意: 请勿随意修改模板字段名称,如需修改模板字段或字段含义,请联系相关技术人员</div>
  69. </div>
  70. </template>
  71. </zz-form>
  72. </div>
  73. <div class="buttons">
  74. <el-button type="primary" @click="addEdit()">保存</el-button>
  75. </div>
  76. </div>
  77. </div>
  78. </template>
  79. <script>
  80. export default {
  81. data() {
  82. return {
  83. filterText: '',
  84. communityArr: [],
  85. textareaMsg:
  86. '尊敬的业主{accountname},您位于{address} 的房产,需要缴纳 {Accountperiod} 的{expenditure}{amount}。请您尽快缴纳,谢谢合作。如已缴纳,请忽略本信息。',
  87. smsTemplate: {
  88. gatewaySign: '',
  89. smsName: '',
  90. smsPassword: '',
  91. smsSign: '',
  92. smsTemplate: ''
  93. },
  94. communityId: '',
  95. callTime: '',
  96. callPayment: {
  97. arrearageDays: '',
  98. callTime: '',
  99. callType: 1,
  100. callFrequency: 1
  101. },
  102. formCols: [
  103. [
  104. {
  105. label: 'SMS用户名',
  106. prop: 'smsName',
  107. slot: 'smsName',
  108. input: true
  109. },
  110. {
  111. label: 'SMS密码',
  112. prop: 'smsPassword',
  113. slot: 'smsPassword',
  114. input: true
  115. },
  116. {
  117. label: '短信签名',
  118. prop: 'smsSign',
  119. slot: 'smsSign',
  120. input: true
  121. },
  122. {
  123. label: '网关签名编码',
  124. prop: 'gatewaySign',
  125. input: true
  126. },
  127. {
  128. label: ' 短信模板',
  129. prop: 'smsTemplate',
  130. slot: 'smsTemplate'
  131. },
  132. {
  133. label: ' ',
  134. slot: 'titleMsg'
  135. }
  136. ]
  137. ],
  138. formRules: {
  139. gatewaySign: [this.$valid.inputRequired('网关签名编码')],
  140. smsName: [this.$valid.inputRequired('SMS用户名')],
  141. smsPassword: [this.$valid.inputRequired('SMS密码')],
  142. smsSign: [this.$valid.inputRequired('短信签名')],
  143. smsTemplate: [this.$valid.inputRequired('短信模板')],
  144. callType: [this.$valid.selectRequired('催缴方式')]
  145. },
  146. activeIndex: 0
  147. };
  148. },
  149. watch: {
  150. filterText(val) {
  151. this.communityArr.forEach((item, index) => {
  152. if (val) {
  153. if (JSON.stringify(item.communityName).indexOf(val) !== -1) {
  154. this.activeIndex = index;
  155. }
  156. } else {
  157. if (item.id === this.communityId) {
  158. this.activeIndex = index;
  159. }
  160. }
  161. });
  162. }
  163. },
  164. created() {
  165. this.getorgTree();
  166. },
  167. mounted() {},
  168. methods: {
  169. getorgTree() {
  170. this.$http
  171. .get('/sc-community/assets/community/list')
  172. .then((data) => {
  173. this.communityArr = data.data;
  174. this.$store.commit('setAreaSelect', data.data);
  175. if (data.data.length !== 0) {
  176. this.toggle(0, data.data[0].id);
  177. }
  178. })
  179. .catch(function () {});
  180. },
  181. toggle(index, id) {
  182. const time = new Date();
  183. this.communityId = id;
  184. this.$http.post('/sc-charge/scChargeCallPayment/find/' + id).then(({ status, data, msg }) => {
  185. if (status === 0) {
  186. const { callPayment, smsTemplate } = data;
  187. this.callPayment = {
  188. arrearageDays: '',
  189. callTime: '',
  190. callType: 1,
  191. callFrequency: 1
  192. };
  193. this.callTime = '';
  194. this.smsTemplate = {
  195. gatewaySign: '',
  196. smsName: '',
  197. smsPassword: '',
  198. smsSign: '',
  199. smsTemplate: ''
  200. };
  201. this.$nextTick(() => {
  202. if (!!smsTemplate) {
  203. this.smsTemplate = smsTemplate;
  204. }
  205. if (!!callPayment) {
  206. this.callPayment = callPayment;
  207. let hfm = callPayment.callTime.split(':');
  208. this.callTime = new Date(time.getFullYear(), time.getMonth(), time.getDate(), hfm[0], hfm[1], hfm[2]);
  209. }
  210. });
  211. }
  212. });
  213. this.activeIndex = index;
  214. },
  215. toggleTime(e) {
  216. this.callPayment.callTime = this.timeFi(e.getHours()) + ':' + this.timeFi(e.getMinutes()) + ':' + this.timeFi(e.getSeconds());
  217. },
  218. timeFi(val) {
  219. let time = val;
  220. time = time.toString().length === 2 ? time : '0' + time;
  221. return time;
  222. },
  223. addEdit() {
  224. new Promise((resolve) => {
  225. this.$refs.form.validate(resolve);
  226. })
  227. .then(() => {
  228. let url = '/sc-charge/scChargeCallPayment/save';
  229. let params = {
  230. smsTemplate: this.smsTemplate,
  231. callPayment: this.callPayment,
  232. communityId: this.communityId
  233. };
  234. this.$http
  235. .post(url, params)
  236. .then(({ status, msg }) => {
  237. if (status == 0) {
  238. this.$message.success(msg);
  239. this.closes();
  240. } else {
  241. this.$message.error(msg);
  242. }
  243. })
  244. .catch(() => {});
  245. })
  246. .catch(() => {});
  247. },
  248. goBack() {
  249. this.$parent.isShowStatus = 'list';
  250. this.$parent.mixins_search();
  251. }
  252. }
  253. };
  254. </script>
  255. <style scoped lang="scss">
  256. .title {
  257. float: left;
  258. font-size: 16px;
  259. font-weight: 600;
  260. color: #424656;
  261. line-height: 30px;
  262. }
  263. .organ-tree {
  264. width: 260px;
  265. background: #ffffff;
  266. padding: 20px;
  267. box-sizing: border-box;
  268. float: left;
  269. overflow: auto;
  270. &::before {
  271. clear: both;
  272. }
  273. .tops {
  274. margin-top: 15px;
  275. }
  276. .organ-tree-item {
  277. line-height: 30px;
  278. position: relative;
  279. color: #7a7d88;
  280. padding-left: 10px;
  281. cursor: pointer;
  282. &.active {
  283. color: #0eaeff;
  284. &::before {
  285. background: #0eaeff;
  286. }
  287. }
  288. &::before {
  289. position: absolute;
  290. left: 0px;
  291. top: 12px;
  292. width: 4px;
  293. height: 4px;
  294. border-radius: 4px;
  295. background: #7a7d88;
  296. display: block;
  297. content: ' ';
  298. }
  299. }
  300. // .tree-style-box {
  301. // margin-top: 20px;
  302. // max-height: calc(100vh - 200px);
  303. // overflow: scroll;
  304. // }
  305. }
  306. .content-right {
  307. background: white;
  308. padding: 20px;
  309. .blockName {
  310. padding-bottom: 20px;
  311. margin-bottom: 20px;
  312. border-bottom: 1px solid #e0e1e3;
  313. }
  314. .width50 {
  315. width: 50%;
  316. }
  317. .show-required-icon-star {
  318. &:before {
  319. content: '*';
  320. color: #f56c6c;
  321. }
  322. }
  323. }
  324. .titleMsg {
  325. font-size: 12px;
  326. font-weight: 400;
  327. color: #424656;
  328. line-height: 17px;
  329. .msgTitle {
  330. color: #0eaeff;
  331. margin-bottom: 10px;
  332. }
  333. .msgred {
  334. color: #ff7171;
  335. margin-top: 15px;
  336. }
  337. }
  338. .buttons {
  339. text-align: right;
  340. }
  341. </style>