addVersion.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view class="page">
  3. <view class="step">
  4. <uni-steps active-color="#07c160" :options="options" :active="4"></uni-steps>
  5. </view>
  6. <view style="height: 130rpx;"></view>
  7. <view class="home">
  8. <form @submit="addVersion">
  9. <view class="homeForm ft28">
  10. <picker mode="selector" :range="tableTypeList" range-key="title" @change="onTableTypeChange">
  11. <view class="item flex-y-center box-pack-between">
  12. <text>门店id(仅限审核使用)</text>
  13. <view>
  14. <text>{{tableTypeActive}}</text>
  15. <text class="iconfont icongengduo" style="font-size: 26rpx;"></text>
  16. </view>
  17. </view>
  18. </picker>
  19. <picker mode="selector" :range="tableList" range-key="id" @change="onTableChange">
  20. <view class="item flex-y-center box-pack-between">
  21. <text>位置id(仅限审核使用): </text>
  22. <view>
  23. <text>{{table_id}}</text>
  24. <text class="iconfont icongengduo" style="font-size: 26rpx;"></text>
  25. </view>
  26. <input type="text" :value="table_id" name="table_id" placeholder="请输入餐桌id"
  27. class="hide-input" />
  28. </view>
  29. </picker>
  30. <view class="item flex-y-center box-pack-between">
  31. <text>版本号:</text>
  32. <view class="border">
  33. <input type="text" :value="obj.user_version" name="user_version" placeholder="请输入版本号" />
  34. </view>
  35. </view>
  36. <view class="item box-pack-between" style="height: auto;padding: 20rpx 0;">
  37. <text class="flex-center" style="min-width:150rpx;">项目备注:</text>
  38. <view class="border itemTextarea flex-grow-1">
  39. <textarea type="text" auto-height="true" :value="obj.user_desc" name="user_desc"
  40. placeholder="请输入项目备注" />
  41. </view>
  42. </view>
  43. <!--
  44. <view class="tip">
  45. Tip:进入门店列表(对应审核门店id)>进入餐桌管理>即可找到餐桌ID。提交的版本号需大于当前版本号。
  46. </view> -->
  47. <button hover-class="none" form-type="submit" class="flex-grow-1 flex-center submit ft28">
  48. 提交版本
  49. </button>
  50. </view>
  51. </form>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import optionsData from './data.js'
  57. export default {
  58. data() {
  59. return {
  60. tableTypeList: [],
  61. tableTypeActive: "请选择",
  62. table_id: "",
  63. store_id: '',
  64. obj: {},
  65. tableList: [],
  66. options:optionsData.options
  67. }
  68. },
  69. onLoad() {
  70. this.MiniVersion();
  71. },
  72. methods: {
  73. addVersion(e) {
  74. let {
  75. table_id,
  76. user_version,
  77. user_desc
  78. } = e.detail.value;
  79. this.request({
  80. url: 'setting/uploadCode',
  81. data: {
  82. admin_id: uni.getStorageSync("admin_id"),
  83. store_id: this.store_id,
  84. table_id,
  85. user_version,
  86. user_desc,
  87. }
  88. }).then(res => {
  89. if (res.code == '200') {
  90. console.log(res, "showModal")
  91. uni.showModal({
  92. title: '提示',
  93. content: res.message,
  94. showCancel: true,
  95. cancelText: '关闭',
  96. confirmText: '提交审核',
  97. success: r => {
  98. if (r.confirm) {
  99. uni.redirectTo({
  100. url: "./Versioning"
  101. })
  102. } else {
  103. uni.navigateBack({
  104. delta: 1
  105. })
  106. }
  107. },
  108. fail: () => {},
  109. complete: () => {}
  110. });
  111. }
  112. })
  113. },
  114. onTableTypeChange(e) {
  115. let store_id = this.tableTypeList[e.detail.value].id
  116. if (store_id != this.store_id) {
  117. this.tableTypeActive = this.tableTypeList[e.detail.value].title;
  118. this.store_id = store_id
  119. this.table_id = ""
  120. this.getTableList(this.store_id)
  121. }
  122. },
  123. onTableChange(e) {
  124. let table_id = this.tableList[e.detail.value].id
  125. this.table_id = table_id
  126. },
  127. // 版本列表
  128. MiniVersion(e) {
  129. this.request({
  130. url: 'setting/wechat_infos',
  131. data: {
  132. admin_id: uni.getStorageSync("admin_id"),
  133. }
  134. }).then(res => {
  135. if (res.code == 200) {
  136. this.obj = res.data
  137. this.shop_store_index();
  138. }
  139. })
  140. },
  141. shop_store_index() {
  142. this.request({
  143. url: 'Smdcshop/shop_store_index',
  144. data: {
  145. admin_id: uni.getStorageSync("admin_id"),
  146. }
  147. }).then(res => {
  148. if (res.code == 200) {
  149. this.tableTypeList = res.data;
  150. if (this.obj.store_id) {
  151. let info = res.data.find((item) => item.id == this.obj.store_id)
  152. this.tableTypeActive = info.title;
  153. this.store_id = info.id;
  154. } else {
  155. this.tableTypeActive = res.data[0].title;
  156. this.store_id = res.data[0].id;
  157. }
  158. if(this.obj.table_id){
  159. this.table_id = this.obj.table_id
  160. }
  161. this.getTableList(this.store_id)
  162. }
  163. })
  164. },
  165. getTableList(store_id) {
  166. this.request({
  167. url: 'setting/tablelist',
  168. data: {
  169. store_id
  170. }
  171. }).then(res => {
  172. if (res.code == 200) {
  173. this.tableList = res.data;
  174. }
  175. })
  176. },
  177. }
  178. }
  179. </script>
  180. <style>
  181. @import url("../css/style.css");
  182. .tip {
  183. color: red;
  184. font-size: 24rpx;
  185. }
  186. .itemTextarea {
  187. /* border: 1rpx solid #F1F1F1; */
  188. }
  189. .itemTextarea textarea {
  190. width: 100%;
  191. }
  192. .homeForm {
  193. padding: 20rpx;
  194. padding-bottom: 40rpx;
  195. }
  196. .border {
  197. padding: 10rpx;
  198. border-bottom: 1rpx solid #F1F1F1;
  199. text-align: right;
  200. }
  201. .submit {
  202. background-color: #07c160;
  203. color: #FFFFFF;
  204. width: 630rpx;
  205. margin: 0 auto;
  206. height: 98rpx;
  207. margin-top: 30rpx;
  208. }
  209. .Transfer {
  210. position: absolute;
  211. bottom: 100rpx;
  212. width: 100%;
  213. text-align: center;
  214. font-size: 28rpx;
  215. color: #007AFF;
  216. }
  217. .Transfer navigator {
  218. display: inline-block;
  219. }
  220. .hide-input {
  221. position: fixed;
  222. left: 1000px;
  223. top: -1000px;
  224. width: 0;
  225. height: 0;
  226. }
  227. </style>