index.wxml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <!--pages/create-order/index.wxml-->
  2. <view class="sg-container">
  3. <view class="sg-tabs sg-flex sg-align-center sg-space-around">
  4. <block wx:for="{{tabs}}" wx:key="index">
  5. <view class="sg-tab sg-pad {{index == tabIndex ? 'sg-seleted' : 'sg-gray-color'}}" bindtap="switchTab"
  6. data-index="{{index}}">{{item}}</view>
  7. </block>
  8. </view>
  9. <view class="sg-order-box" wx:if="{{tabIndex == 0}}">
  10. <view class="sg-form">
  11. <view class="sg-form-item sg-pad sg-top-border">
  12. <view class="sg-label">项目名称</view>
  13. <input value="{{project ? project.name : ''}}" class="sg-input" disabled="true"></input>
  14. </view>
  15. <!-- <view class="sg-form-item sg-pad sg-top-border">
  16. <view class="sg-label">需求工点</view>
  17. <picker bindchange="onChange" value="{{pointIndex}}" range="{{work_points}}" range-key="name"
  18. data-name="pointIndex" class="sg-input">
  19. <view class="picker sg-gray-color">
  20. {{pointIndex >= 0 ? work_points[pointIndex].name : '选择所需的工点'}}
  21. </view>
  22. </picker>
  23. </view> -->
  24. <view class="sg-form-item sg-pad sg-top-border" bindtap="switchShow" data-name="showDevice">
  25. <view class="sg-label">维修设备</view>
  26. <view class="sg-input sg-gray-color">{{deviceIndex >= 0 ? inner_devices[deviceIndex].device_name.name : '选择需要维修的设备'}}</view>
  27. </view>
  28. <view class="sg-form-item sg-pad sg-top-border">
  29. <view class="sg-label">维修总金额</view>
  30. <input value="{{money}}" class="sg-input" disabled="true" bindinput="onChange" data-name="money" placeholder="请填写维修总金额"></input>
  31. </view>
  32. <view class="sg-form-item sg-pad sg-top-border">
  33. <view class="sg-label">维修原因</view>
  34. <input value="{{reason}}" class="sg-input" bindinput="onChange" data-name="reason"
  35. placeholder="请填写维修原因"></input>
  36. </view>
  37. <view class="sg-form-item sg-pad sg-top-border">
  38. <view class="sg-label">维修天数</view>
  39. <input value="{{day}}" class="sg-input" bindinput="onChange" type="digit" data-name="day" placeholder="请填写维修天数"></input>
  40. </view>
  41. <view class="sg-form-item sg-pad sg-top-border">
  42. <view class="sg-label">备注</view>
  43. <input value="{{remark}}" class="sg-input" bindinput="onChange" data-name="remark" placeholder="订单备注填写"></input>
  44. </view>
  45. </view>
  46. </view>
  47. <van-popup show="{{ showDevice }}" bind:close="switchShow" data-name="showDevice" custom-style="width: 90%;">
  48. <view class="sg-pad">
  49. <view class="sg-font-lg sg-bold sg-text-center">已调用设备</view>
  50. <view class="sg-list sg-height-limit">
  51. <view class="sg-item sg-pad-tb-sm sg-flex sg-align-center sg-space-between sg-bottom-border sg-font-small" wx:for="{{inner_devices}}" wx:key="index" bindtap="switchChecked" data-name="inner_devices" data-index="{{index}}">
  52. <view>
  53. <view class="sg-bold">{{item.device_name ? item.device_name.name : ''}}-{{item.spec_name ? item.spec_name : ''}}</view>
  54. <view class="sg-font-xs">固定资产编号:{{item.number}}</view>
  55. </view>
  56. <van-icon name="checked" class="sg-icon sg-index-color" wx:if="{{item.checked}}"/>
  57. <van-icon name="circle" wx:else class="sg-icon"/>
  58. </view>
  59. </view>
  60. <view class="sg-btns sg-flex sg-align-center sg-space-between sg-white-bg sg-pad-top">
  61. <van-button type="danger" color="#737477" class="sg-popup-btn" block bind:click="switchShow" round data-name="showDevice">取消</van-button>
  62. <van-button type="info" class="sg-popup-btn" block bind:click="switchShow" round data-name="showDevice">确认</van-button>
  63. </view>
  64. </view>
  65. </van-popup>
  66. <van-calendar show="{{ showDate }}" bind:close="switchShowDate" bind:confirm="confirmDate" data-show="{{false}}"
  67. type="range" class="sg-calendar" default-date="{{default_dates}}" />
  68. <view class="sg-device-box" wx:if="{{tabIndex == 1}}">
  69. <view class="sg-device-list sg-top-border">
  70. <block wx:if="{{parts.length <= 0}}">
  71. <view class="sg-center sg-pad">暂无维修配件</view>
  72. </block>
  73. <block wx:else>
  74. <view class="sg-item sg-flex sg-align-center sg-bottom-border" wx:for="{{parts}}" wx:key="index"
  75. bindtap="selectDevice" data-index="{{index}}">
  76. <view class="sg-left sg-flex-grow sg-pad sg-flex-column">
  77. <view class="sg-left-top sg-flex sg-align-center" style="justify-content: space-between">
  78. <view>
  79. <view class="sg-name">
  80. 设备维修部位:{{item.name}}
  81. </view>
  82. <view class="sg-name">
  83. 需要更换配件:{{item.change}}
  84. </view>
  85. </view>
  86. <view class="sg-left-right sg-quantity-price sg-gray-color">
  87. ¥<text>{{item.price}}</text>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="sg-right sg-pad sg-flex sg-align-center" style="background-color: #737477;color:#fff" bindtap="delete" data-index="{{index}}">删除
  92. </view>
  93. </view>
  94. </block>
  95. </view>
  96. </view>
  97. <van-dialog show="{{ showAdd }}" use-slot title="{{dialog_type == 'create' ? '维修配件添加' : '修改设备'}}" show-cancel-button
  98. bind:confirm="add" z-index="1" confirm-button-color="#5693FC" bind:cancel="cancel">
  99. <view class="sg-add-device-box sg-pad sg-font-small">
  100. <view class="sg-form-item sg-pad-tb sg-top-border">
  101. <view class="sg-label">设备维修部位</view>
  102. <input value="{{part_name}}" class="sg-input" bindinput="onChange" data-name="part_name"
  103. placeholder="请输入设备维修部位"></input>
  104. </view>
  105. <view class="sg-form-item sg-pad-tb sg-top-border">
  106. <view class="sg-label">需要更换配件</view>
  107. <input value="{{part_change}}" class="sg-input" bindinput="onChange" data-name="part_change"
  108. placeholder="请输入更换的配件"></input>
  109. </view>
  110. <view class="sg-form-item sg-pad-tb sg-top-border">
  111. <view class="sg-label">更换配件价格</view>
  112. <input value="{{part_price}}" type="digit" class="sg-input" bindinput="onChange" data-name="part_price"
  113. placeholder="请输入更换配件价格(元)"></input>
  114. </view>
  115. </view>
  116. </van-dialog>
  117. <block wx:if="{{tabIndex == 1}}">
  118. <view class="sg-submit-box sg-pad sg-fix-bottom sg-flex sg-align-center sg-center" bindtap="switchShowAdd"
  119. data-show="true">
  120. <van-icon name="plus" /><text>立即添加</text>
  121. </view>
  122. </block>
  123. <view class="sg-submit-box sg-fix-bottom sg-flex sg-align-center sg-center" wx:if="{{tabIndex == 0}}">
  124. <view class="sg-action sg-pad sg-index-bg sg-white" bindtap="submit" data-type='save'>提交</view>
  125. </view>
  126. </view>