index.vue 14 KB

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