wupdate.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view>
  3. <form>
  4. <view class="padding-sm bg-white"></view>
  5. <view class="echo-article-title bg-white">
  6. 普通公司升级为派遣公司
  7. </view>
  8. <view class="echo-article-meta bg-white">
  9. <view class="echo-article-meta-left">
  10. <text>提交升级信息后,需审核,请耐心等待。</text>
  11. </view>
  12. </view>
  13. <view class="padding-sm bg-white"></view>
  14. <view class="cu-form-group margin-top-sm">
  15. <view class="title">公司类型</view>
  16. <input class="text-gray" placeholder="请输入..." data-field="wtype" name="wtype" :value="workerinfo.wtype==1?'普通公司':'派遣公司'"
  17. disabled="true"></input>
  18. </view>
  19. <view class="cu-form-group">
  20. <view class="title">姓名</view>
  21. <input placeholder="请输入..." data-field="realname" name="realname" :value="workerinfo.realname" disabled="true"></input>
  22. </view>
  23. <view class="cu-form-group">
  24. <view class="title">手机号</view>
  25. <input placeholder="请输入..." data-field="mobile" name="mobile" :value="workerinfo.mobile" disabled="true"></input>
  26. </view>
  27. <view class="cu-form-group">
  28. <view class="title">公司名称</view>
  29. <input placeholder="请输入..." data-field="title" name="title" :value="workerinfo.title" disabled="true"></input>
  30. </view>
  31. <view class="cu-form-group">
  32. <view class="title">微店名称</view>
  33. <input placeholder="请输入..." data-field="ftitle" name="ftitle" :value="workerinfo.ftitle" disabled="true"></input>
  34. </view>
  35. <view class="cu-bar bg-white margin-top">
  36. <view class="action">
  37. 相关资质
  38. </view>
  39. </view>
  40. <view class="cu-form-group">
  41. <view class="grid col-3 grid-square flex-sub">
  42. <view class="bg-img solids" style="margin-bottom: 0rpx !important;" data-fieldimage="picone" @tap="chooseImage">
  43. <text v-if="workerinfo.picone==''" class='cuIcon-cameraadd'></text>
  44. <image v-else :src="workerinfo.picone" mode="aspectFill"></image>
  45. </view>
  46. <view class="bg-img solids" style="margin-bottom: 0rpx !important;" data-fieldimage="pictwo" @tap="chooseImage">
  47. <text v-if="workerinfo.pictwo==''" class='cuIcon-cameraadd'></text>
  48. <image v-else :src="workerinfo.pictwo" mode="aspectFill"></image>
  49. </view>
  50. <view class="bg-img solids" style="margin-bottom: 0rpx !important;" data-fieldimage="picthr" @tap="chooseImage">
  51. <text v-if="workerinfo.picthr==''" class='cuIcon-cameraadd'></text>
  52. <image v-else :src="workerinfo.picthr" mode="aspectFill"></image>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="cu-form-group" style="border-top: 0rpx; text-align: center;">
  57. <view class="grid col-3 flex-sub">
  58. <view>营业执照</view>
  59. <view>派遣许可证</view>
  60. <view>人力资源许可证</view>
  61. </view>
  62. </view>
  63. <view class="padding flex flex-direction">
  64. <button v-if="workerinfo.status==4" class="cu-btn bg-green margin-tb-sm lg" @tap="updateWorker">升级申请已提交,请耐心等待</button>
  65. <button v-if="workerinfo.status==5" class="cu-btn bg-green margin-tb-sm lg" @tap="updateWorker">立即提交升级</button>
  66. </view>
  67. <view class="padding"></view>
  68. </form>
  69. </view>
  70. </template>
  71. <script>
  72. var _this;
  73. export default {
  74. data() {
  75. return {
  76. isRotate: false,
  77. workerinfo: false
  78. }
  79. },
  80. onLoad: function() {
  81. _this = this;
  82. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  83. if (_this.workerinfo === false) {
  84. uni.reLaunch({
  85. url: "/pages/my/my"
  86. });
  87. return false;
  88. }
  89. },
  90. methods: {
  91. // 图片上传
  92. chooseImage: function(e) {
  93. var fieldimage = e.currentTarget.dataset.fieldimage;
  94. uni.chooseImage({
  95. count: 1,
  96. sizeType: ['original', 'compressed'],
  97. sourceType: ['album'],
  98. success: (res) => {
  99. _this.$req.ajaxFile({
  100. path: "attachment/tplfieldimage",
  101. title: '正在上传',
  102. filePath: res.tempFilePaths[0],
  103. fileName: 'file',
  104. }).then((filedata) => {
  105. var data = JSON.parse(filedata.data);
  106. _this.workerinfo[fieldimage] = data.data.src;
  107. }).catch((err) => {
  108. uni.showModal({
  109. title: '信息提示',
  110. content: err,
  111. showCancel: false
  112. });
  113. });
  114. }
  115. });
  116. },
  117. // 提交修改
  118. updateWorker: function() {
  119. if (_this.isRotate) {
  120. return false;
  121. }
  122. _this.isRotate = true;
  123. _this.$req.ajax({
  124. path: "worker/updateworker",
  125. title: "正在提交修改",
  126. data: {
  127. id: _this.workerinfo.id,
  128. userid: _this.workerinfo.userid,
  129. picone: _this.workerinfo.picone,
  130. pictwo: _this.workerinfo.pictwo,
  131. picthr: _this.workerinfo.picthr
  132. }
  133. }).then((data) => {
  134. uni.setStorageSync('workerinfo', data.worker);
  135. uni.showModal({
  136. title: '信息提示',
  137. content: '升级信息提交成功,请耐心等待审核。',
  138. showCancel: false,
  139. success: function(res) {
  140. if (res.confirm) {
  141. uni.redirectTo({
  142. url: "/pages/worker/worker"
  143. });
  144. }
  145. }
  146. });
  147. _this.isRotate = false;
  148. }).catch((err) => {
  149. uni.showModal({
  150. title: '信息提示',
  151. content: err,
  152. showCancel: false
  153. });
  154. _this.isRotate = false;
  155. });
  156. }
  157. }
  158. }
  159. </script>
  160. <style>
  161. .cu-form-group .title {
  162. min-width: calc(5em + 15px);
  163. }
  164. .cu-form-group input {
  165. text-align: right;
  166. }
  167. .fieldpic {
  168. width: 150rpx;
  169. height: 150rpx;
  170. }
  171. .fieldpictil {
  172. width: 230rpx;
  173. text-align: center;
  174. }
  175. </style>