updateModules.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view>
  3. <form @submit="updata">
  4. <view class="body">
  5. 更换原因:<textarea class="input-two" name="replaceReason" />
  6. </view>
  7. <view class="">
  8. <button type="primary" formType="submit" class="button">
  9. <p class="p">提交</p>
  10. </button>
  11. </view>
  12. </form>
  13. </view>
  14. </template>
  15. <script>
  16. import {
  17. mapState,
  18. mapActions,
  19. mapMutations
  20. } from 'vuex'
  21. export default {
  22. data() {
  23. return {
  24. }
  25. },
  26. methods: {
  27. updata(event) {
  28. var serverUrl = this.serverurl;
  29. const {
  30. value: modules
  31. } = event.detail;
  32. var token = uni.getStorageSync("token");
  33. var coding = uni.getStorageSync("updateModules");
  34. var machineCoding = uni.getStorageSync("updateMachineCode");
  35. var personnel = uni.getStorageSync("name");
  36. uni.request({
  37. url: serverUrl + "/TModules/updateModules",
  38. method: "POST",
  39. data: {
  40. "replaceReason": modules.replaceReason,
  41. "coding": coding,
  42. "machineCoding": machineCoding,
  43. "replacePersonnel": personnel
  44. },
  45. header: {
  46. 'token': token
  47. },
  48. success: (Result) => {
  49. var res = Result;
  50. if (res.data.code == true) {
  51. }
  52. uni.showModal({
  53. title: '提示',
  54. content: res.data.message,
  55. });
  56. }
  57. });
  58. },
  59. }
  60. }
  61. </script>
  62. <style>
  63. .body {
  64. background-color: #FFFFFF;
  65. padding: 20upx 25upx 20upx 20upx;
  66. display: flex;
  67. flex-direction: row;
  68. justify-content: flex-start;
  69. }
  70. .input-two{
  71. padding-left: 20upx;
  72. width: 450upx;
  73. box-shadow: 0upx 0upx 20upx #D3D3D3;
  74. border-radius: 5upx;
  75. }
  76. .button {
  77. margin: auto;
  78. width: 60%;
  79. height: 100upx;
  80. }
  81. .p {
  82. /* #ifdef H5 */
  83. top: -13%;
  84. /* #endif */
  85. width: 80upx;
  86. height: 60upx;
  87. font-size: 40upx;
  88. padding-top: 6upx;
  89. /* #ifndef H5 */
  90. padding-top: 10upx;
  91. /* #endif */
  92. position: absolute;
  93. /* 水平居中 */
  94. left: 50%;
  95. -webkit-transform: translateX(-50%);
  96. transform: translateX(-50%);
  97. }
  98. </style>