index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <template>
  2. <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
  3. <u-tabs :list="tabsList" :current="tabsCurrent" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }" :scrollable="false"></u-tabs>
  4. </u-sticky>
  5. <oa-scroll
  6. customClass="invoicing-container scroll-height"
  7. :customStyle="{}"
  8. :refresherLoad="false"
  9. :refresherEnabled="false"
  10. :refresherDefaultStyle="'none'"
  11. :refresherThreshold="44"
  12. :refresherBackground="'#f5f6f7'"
  13. :scrollIntoView="scrollIntoView"
  14. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  15. >
  16. <view v-show="tabsCurrent == 0">
  17. <u-notice-bar id="noticeBar" v-if="promptStatus" text="注:查询到您近期有开票记录,请勿重复开票" :duration="9000" color="#FF0000" bgColor="#FFFFFF"></u-notice-bar>
  18. <view class="menu-list" style="font-size: 15px; line-height: 30px">
  19. <view class="list-cell">
  20. <view class="menu-item">
  21. <view>
  22. 您的物联网服务
  23. <span style="color: red">即将到期</span>
  24. ,如需续费请联系您的专职销售顾问,如已付费可直接填写开票信息。
  25. </view>
  26. </view>
  27. </view>
  28. <view class="list-cell" style="color: #666666">
  29. <view class="menu-item">
  30. <view> 客户经理:李鹏 </view>
  31. </view>
  32. <view class="menu-item">
  33. <view> 联系方式:18621761642(同微信) </view>
  34. <view class="iconfont oaIcon-copy menu-item-icon" style="font-size: 14px; color: #909399" @click="copy('18621761642')"> </view>
  35. </view>
  36. <view class="menu-item">
  37. <view style="margin-right: 10px"> 邮箱:seven.li@chinausky.com </view>
  38. <view class="iconfont oaIcon-copy menu-item-icon" style="font-size: 14px; color: #909399" @click="copy('seven.li@chinausky.com')"> </view>
  39. </view>
  40. <view class="menu-item">
  41. <view> 客服电话:021-65376655</view>
  42. <view class="iconfont oaIcon-dial menu-item-icon" style="font-size: 14px; color: #909399; margin-left: 5px" @click="proxy.$common.makePhoneCall('02165376655')"> </view>
  43. </view>
  44. <view class="menu-item">
  45. <view> 公司邮箱:admin@chinausky.com</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="menu-list" style="font-size: 15px">
  50. <view class="list-cell" style="color: #666666">
  51. <view class="menu-item">
  52. <view>开票信息</view>
  53. </view>
  54. <u--form :model="form" ref="uForm" :rules="rules" labelWidth="80">
  55. <view style="padding: 10px 0 10px 0; background: #ffffff">
  56. <view style="padding-left: 9px">
  57. <u-form-item label="发票抬头" prop="invoiceTitle" :borderBottom="true" required>
  58. <u-input v-model="form.invoiceTitle" placeholder="请填写发票抬头" border="none" />
  59. </u-form-item>
  60. <u-form-item label="税号" prop="dutyId" :borderBottom="true" required>
  61. <u-input v-model="form.dutyId" placeholder="请填写税号" border="none" maxlength="18" />
  62. </u-form-item>
  63. <u-form-item label="电子邮箱" prop="email" :borderBottom="true" required>
  64. <u-input v-model="form.email" placeholder="请填写电子邮箱" border="none" />
  65. </u-form-item>
  66. <u-form-item label="申请人" prop="applicant" :borderBottom="true" required>
  67. <u-input v-model="form.applicant" placeholder="请填写申请人" border="none" maxlength="10" />
  68. </u-form-item>
  69. <u-form-item label="手机号" prop="phone" :borderBottom="true" required>
  70. <u-input v-model="form.phone" placeholder="请填写手机号" border="none" maxlength="11" />
  71. </u-form-item>
  72. <u-form-item label="金额" prop="amount" :borderBottom="true" required>
  73. <u-input type="number" v-model="form.amount" placeholder="请填写金额" border="none" />
  74. </u-form-item>
  75. <u-form-item label="发票类型" prop="invoiceType" :borderBottom="true" required>
  76. <u-radio-group v-model="form.invoiceType" placement="row">
  77. <u-radio :activeColor="proxy.$settingStore.themeColor.color" name="1" label="普票" style="margin-right: 15px"></u-radio>
  78. <u-radio :activeColor="proxy.$settingStore.themeColor.color" name="2" label="专票"></u-radio>
  79. </u-radio-group>
  80. </u-form-item>
  81. <u-form-item label="发票性质" prop="invoiceAttribute" :borderBottom="true" required>
  82. <u-radio-group v-model="form.invoiceAttribute" placement="row">
  83. <u-radio :activeColor="proxy.$settingStore.themeColor.color" name="1" label="电子发票" style="margin-right: 15px"></u-radio>
  84. <u-radio :activeColor="proxy.$settingStore.themeColor.color" name="2" label="纸质发票"></u-radio>
  85. </u-radio-group>
  86. </u-form-item>
  87. <u-form-item v-if="form.invoiceAttribute == 2" label="邮寄地址" prop="sendAddress" :borderBottom="true" required>
  88. <u-input v-model="form.sendAddress" placeholder="请填写邮寄地址" border="none" />
  89. </u-form-item>
  90. <u-form-item label="付款回执" prop="paymentReceipt" :borderBottom="true">
  91. <oa-upload :uploadCount="1" :uploadImage="form.paymentReceipt" @uploadSuccessChange="uploadSuccessChange" @uploadDeleteChange="uploadDeleteChange"></oa-upload>
  92. <view style="color: #666666">图片支持png、jpg</view>
  93. <!-- <view>
  94. <u-input placeholder="点击上传" border="none" maxlength="10" disabledColor="transparent" disabled>
  95. <template #prefix>
  96. <view
  97. class="iconfont oaIcon-shangchuan menu-item-icon"
  98. :style="{
  99. fontSize: '14px',
  100. color: proxy.$settingStore.themeColor.color,
  101. }"
  102. >
  103. </view>
  104. </template>
  105. </u-input>
  106. <view style="color: #666666">请上传付款回执图片,支持png、jpg</view>
  107. </view> -->
  108. </u-form-item>
  109. </view>
  110. </view>
  111. </u--form>
  112. </view>
  113. </view>
  114. <view class="app-button">
  115. <view class="app-button-padding" :style="{ paddingBottom: `calc(60px + 44px + ${proxy.$settingStore.tabBarHeight}) !important` }"></view>
  116. <view class="app-button-fixed">
  117. <u-button class="app-buttom" type="primary" @click="handleSubmit('提交')" shape="circle"> 提交 </u-button>
  118. </view>
  119. </view>
  120. </view>
  121. <view v-show="tabsCurrent == 1">
  122. <view class="menu-list mt0 mlr0" style="padding: 0.625rem">
  123. <view class="list-cell">
  124. <view class="menu-item" style="justify-content: center; margin-bottom: 15px; font-size: 15px">
  125. <view>对公转账</view>
  126. </view>
  127. <view class="menu-item">
  128. <view style="width: 90px">企业全称</view>
  129. <view style="color: #666666">上海永天科技股份有限公司</view>
  130. </view>
  131. </view>
  132. <view class="list-cell">
  133. <view class="menu-item">
  134. <view style="width: 90px">银行账户</view>
  135. <view style="color: #666666">16523652265865685</view>
  136. </view>
  137. </view>
  138. <view class="list-cell">
  139. <view class="menu-item">
  140. <view style="width: 90px">开户行</view>
  141. <view style="color: #666666">上海银行徐家汇支行</view>
  142. </view>
  143. </view>
  144. <view class="list-cell">
  145. <view class="menu-item">
  146. <view style="width: 90px">转账备注</view>
  147. <view style="color: #666666">打款时请备注付款公司名称等信息</view>
  148. </view>
  149. </view>
  150. <view class="list-cell">
  151. <view class="menu-item" style="justify-content: center">
  152. <u-button style="width: auto" @click="copy(`上海永天科技股份有限公司\n16523652265865685\n上海银行徐家汇支行`)" shape="circle"> 复制汇款信息 </u-button>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </oa-scroll>
  158. </template>
  159. <script setup>
  160. import config from "@/config";
  161. import storage from "@/utils/storage";
  162. import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  163. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  164. import { useStores, commonStores } from "@/store/modules/index";
  165. import { crmInvoiceInfo, page } from "@/api/common/invoicing.js";
  166. const { proxy } = getCurrentInstance();
  167. const commonStore = commonStores();
  168. const uForm = ref(null);
  169. const data = reactive({
  170. tabsList: [
  171. {
  172. name: "开票申请",
  173. },
  174. {
  175. name: "汇款信息",
  176. },
  177. ],
  178. tabsCurrent: 0,
  179. form: {
  180. customId: "", //客户管理id
  181. invoiceTitle: "", //发票抬头
  182. dutyId: "", //税号
  183. email: "", //电子邮箱
  184. applicant: "", //申请人
  185. phone: "", //手机号码
  186. amount: "", //金额
  187. invoiceType: "1", //发票类型;1:普票,2:专票
  188. invoiceAttribute: "1", //发票性质;1:电子发票,2:纸质发票
  189. sendAddress: "", //邮寄地址
  190. paymentReceipt: "", //付款回执
  191. },
  192. rules: {
  193. invoiceTitle: [
  194. {
  195. required: true,
  196. message: "请填写发票抬头",
  197. trigger: ["blur", "change"],
  198. },
  199. ],
  200. dutyId: [
  201. {
  202. required: true,
  203. message: "请填写税号",
  204. trigger: ["blur", "change"],
  205. },
  206. {
  207. type: "string",
  208. min: 18,
  209. required: true,
  210. message: "请填写18位税号",
  211. trigger: ["change"],
  212. },
  213. ],
  214. email: [
  215. {
  216. required: true,
  217. message: "请填写电子邮箱",
  218. trigger: ["blur", "change"],
  219. },
  220. {
  221. type: "string",
  222. min: 11,
  223. required: true,
  224. message: "请填写正确的邮箱格式",
  225. pattern: /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/,
  226. trigger: ["blur", "change"],
  227. },
  228. ],
  229. applicant: [
  230. {
  231. required: true,
  232. message: "请填写申请人",
  233. trigger: ["blur", "change"],
  234. },
  235. ],
  236. phone: [
  237. {
  238. required: true,
  239. message: "请填写手机号",
  240. trigger: ["blur", "change"],
  241. },
  242. {
  243. type: "string",
  244. min: 11,
  245. required: true,
  246. message: "请填写正确11位手机号",
  247. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  248. trigger: ["blur", "change"],
  249. },
  250. ],
  251. amount: [
  252. {
  253. required: true,
  254. message: "请填写金额",
  255. trigger: ["blur", "change"],
  256. },
  257. ],
  258. invoiceType: [
  259. {
  260. required: true,
  261. message: "请选择发票类型",
  262. trigger: ["blur", "change"],
  263. },
  264. ],
  265. invoiceAttribute: [
  266. {
  267. required: true,
  268. message: "请选择发票性质",
  269. trigger: ["blur", "change"],
  270. },
  271. ],
  272. sendAddress: [
  273. {
  274. required: true,
  275. message: "请填写邮寄地址",
  276. trigger: ["blur", "change"],
  277. },
  278. ],
  279. },
  280. scrollIntoView: "",
  281. promptStatus: false,
  282. });
  283. const { tabsList, tabsCurrent, form, rules, scrollIntoView, promptStatus } = toRefs(data);
  284. /**
  285. * @提交
  286. */
  287. function handleSubmit(value) {
  288. scrollIntoView.value = "";
  289. uForm.value
  290. .validate()
  291. .then((res) => {
  292. uni.$u.toast("校验通过");
  293. proxy.$modal.loading("加载中");
  294. page({
  295. current: 1,
  296. size: 10,
  297. invoiceTitle: form.value.invoiceTitle,
  298. startTime: commonStore.getYearLast(new Date()),
  299. endTime: commonStore.formatterDateTime(new Date()),
  300. }).then((requset) => {
  301. if (requset.status === "SUCCESS") {
  302. proxy.$modal.closeLoading();
  303. if (requset.data.records.length > 0) {
  304. promptStatus.value = true;
  305. scrollIntoView.value = "noticeBar";
  306. } else {
  307. var param = {
  308. customId: parseInt(form.value.customId), //客户管理id
  309. invoiceTitle: form.value.invoiceTitle, //发票抬头
  310. dutyId: form.value.dutyId, //税号
  311. email: form.value.email, //电子邮箱
  312. applicant: form.value.applicant, //申请人
  313. phone: form.value.phone, //手机号码
  314. amount: parseFloat(form.value.amount), //金额
  315. invoiceType: parseInt(form.value.invoiceType), //发票类型;1:普票,2:专票
  316. invoiceAttribute: parseInt(form.value.invoiceAttribute), //发票性质;1:电子发票,2:纸质发票
  317. sendAddress: form.value.sendAddress, //邮寄地址
  318. paymentReceipt: form.value.paymentReceipt, //付款回执
  319. };
  320. crmInvoiceInfo(param).then((requset) => {
  321. if (requset.status === "SUCCESS") {
  322. proxy.$tab.navigateTo("/pages/common/success/index?codeName=提交成功");
  323. }
  324. });
  325. }
  326. }
  327. });
  328. })
  329. .catch((errors) => {
  330. uni.$u.toast("校验失败");
  331. });
  332. }
  333. /**
  334. * @图片上传成功回调
  335. */
  336. function uploadSuccessChange(e) {
  337. form.value.paymentReceipt = e.url;
  338. }
  339. /**
  340. * @图片删除回调
  341. */
  342. function uploadDeleteChange(e) {
  343. form.value.paymentReceipt = e;
  344. }
  345. /**
  346. * @复制粘贴板
  347. */
  348. function copy(value) {
  349. // 触发方法
  350. proxy.$common.uniCopy({
  351. content: value,
  352. success: (res) => {
  353. uni.showToast({
  354. title: res,
  355. icon: "none",
  356. });
  357. },
  358. error: (e) => {
  359. uni.showToast({
  360. title: e,
  361. icon: "none",
  362. duration: 3000,
  363. });
  364. },
  365. });
  366. }
  367. /**
  368. * @tabs点击事件
  369. */
  370. function tabsClick(e) {
  371. tabsCurrent.value = e.index;
  372. }
  373. onLoad((options) => {
  374. if ("customId" in options) {
  375. form.value.customId = options.customId;
  376. document.getElementsByClassName("uni-page-head-hd")[0].style.cssText = "display: none;";
  377. }
  378. });
  379. onReady(() => {});
  380. onShow(() => {
  381. //调用系统主题颜色
  382. proxy.$settingStore.systemThemeColor([1]);
  383. });
  384. // 自定义导航事件
  385. onNavigationBarButtonTap((e) => {
  386. if (e.float == "right") {
  387. }
  388. });
  389. </script>
  390. <style lang="scss" scoped>
  391. :deep(.uni-page-head__title) {
  392. opacity: 1 !important;
  393. }
  394. </style>