accessoryAdd.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back"
  4. :title="title" @clickLeft="back">
  5. </uni-nav-bar>
  6. <u-subsection :list="list" :current="current" @change="sectionChange"></u-subsection>
  7. <u-cell-group v-show="current == 0">
  8. <u-cell title="编码" arrow-direction="down">
  9. <view slot="value" style="display: flex;align-items: center;width: 100%;">
  10. <u--input disabled style="flex:1" border="surround" v-model="form.code">
  11. </u--input>
  12. </view>
  13. </u-cell>
  14. <u-cell title="工单名称" arrow-direction="down">
  15. <view slot="value" style="display: flex;align-items: center;width: 100%;">
  16. <u--input :disabled="!isDisable" @click.native="selectWorkOrder" style="flex:1" border="surround"
  17. v-model="form.name">
  18. </u--input>
  19. </view>
  20. </u-cell>
  21. <u-cell title="领用部门" arrow-direction="down">
  22. <view slot="value" style="display: flex;align-items: center;width: 100%;">
  23. <u--input :disabled="!isDisable" style="flex:1" border="surround" v-model="form.contactName">
  24. </u--input>
  25. </view>
  26. </u-cell>
  27. <u-cell title="领用人" arrow-direction="down">
  28. <view slot="value" style="display: flex;align-items: center;width: 100%;">
  29. <u--input :disabled="!isDisable" style="flex:1" border="surround" v-model="form.contactName">
  30. </u--input>
  31. </view>
  32. </u-cell>
  33. <u-cell title="使用部门" arrow-direction="down">
  34. <view slot="value" style="display: flex;align-items: center;width: 100%;">
  35. <u--input :disabled="!isDisable" style="flex:1" border="surround" v-model="form.contactName">
  36. </u--input>
  37. </view>
  38. </u-cell>
  39. <u-cell title="使用人" arrow-direction="down">
  40. <view slot="value" style="display: flex;align-items: center;width: 100%;">
  41. <u--input :disabled="!isDisable" style="flex:1" border="surround" v-model="form.contactName">
  42. </u--input>
  43. </view>
  44. </u-cell>
  45. <u-cell title="使用时间" arrow-direction="down">
  46. <uni-datetime-picker :disabled="!isDisable" type="date" slot="value" v-model="form.usageTime">
  47. </uni-datetime-picker>
  48. </u-cell>
  49. <u-cell title="用途" arrow-direction="down">
  50. <view slot="value" style="display: flex;align-items: center;width: 100%;">
  51. <u--textarea style="flex:1" border="surround" placeholder="请输入内容"
  52. v-model="form.purpose"></u--textarea>
  53. </view>
  54. </u-cell>
  55. </u-cell-group>
  56. <view class="footerButton" v-if="isDisable">
  57. <u-button type="default" text="返回" @click="back"></u-button>
  58. <u-button type="primary" @click="save" text="保存"></u-button>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. computed: {
  65. isDisable() {
  66. let flag = this.type != 'view'
  67. return flag;
  68. }
  69. },
  70. data() {
  71. return {
  72. current: 0,
  73. list: ['基本信息', '配件信息'],
  74. title: '',
  75. type: '',
  76. form: {}
  77. }
  78. },
  79. onLoad(params) {
  80. this.title = params.type == 'view' ? '配件申请详情' : params.type == 'edit' ? '配件申请修改' : '配件申请新增';
  81. this.type = params.type;
  82. console.log(params, 'params --')
  83. },
  84. created() {
  85. uni.$off('updateWorkData')
  86. uni.$on('updateWorkData', ({
  87. data
  88. }) => {
  89. console.log(data, 'data');
  90. })
  91. },
  92. methods: {
  93. sectionChange(index) {
  94. this.current = index;
  95. },
  96. save() {
  97. },
  98. selectWorkOrder() {
  99. uni.navigateTo({
  100. url: `/pages/salesServiceManagement/accessory/components/selectWork`
  101. })
  102. console.log('打开工单数据');
  103. }
  104. }
  105. }
  106. </script>
  107. <style scoped lang="scss">
  108. /deep/.u-subsection__item__text {
  109. font-size: 28rpx !important;
  110. }
  111. /deep/.u-cell__body__content {
  112. flex: none;
  113. margin-right: 16rpx;
  114. }
  115. .footerButton {
  116. width: 100%;
  117. height: 84rpx;
  118. display: flex;
  119. position: fixed;
  120. bottom: 0;
  121. z-index: 10;
  122. /deep/.u-button {
  123. height: 100%;
  124. }
  125. >view {
  126. flex: 1;
  127. }
  128. }
  129. </style>