index.wxml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <view class="container">
  2. <van-search use-action-slot placeholder='请输入搜索关键词' shape='round' bind:search="onSearch" bind:clear="onSearch" />
  3. <view class="header" style="height: 20rpx;"></view>
  4. <Yl_ListBox id='ListBox' bind:getlist='getList'>
  5. <view class="item" wx:for="{{list}}" wx:key="sys_enterprise_stockid">
  6. <view class="top">
  7. <view class="name">{{item.stockname || '--'}}</view>
  8. <view class="actions">
  9. <van-button size="small" type="primary" bindtap="editWarehouse" data-id="{{item.sys_enterprise_stockid}}">编辑
  10. </van-button>
  11. <van-button size="small" type="danger" bindtap="deleteWarehouse" data-id="{{item.sys_enterprise_stockid}}" wx:if="{{item.issystem != 1}}">删除
  12. </van-button>
  13. </view>
  14. </view>
  15. <view class="content">
  16. <view class="row">
  17. <view class="exp">
  18. 仓库编码:{{item.stockno || '--'}}
  19. </view>
  20. <view class="exp">
  21. 是否启用:{{item.isused == 1 ? '是' : '否'}}
  22. </view>
  23. </view>
  24. <view class="row">
  25. <view class="exp">
  26. {{item.issystem == 1 ? '系统预设' : '自建'}}
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <Yl_Empty wx:if="{{list.length==0}}" />
  32. <view style="height:150rpx;" />
  33. </Yl_ListBox>
  34. <view class="footer">
  35. <van-button custom-class='but' bindtap="addWarehouse">新增仓库</van-button>
  36. </view>
  37. <!-- 新增/编辑仓库模态框 -->
  38. <van-dialog show="{{showModal}}" title="{{isEdit ? '编辑仓库' : '新增仓库'}}" use-slot show-cancel-button
  39. confirm-button-text="确定" cancel-button-text="取消" bind:confirm="saveWarehouse" bind:cancel="closeModal"
  40. confirm-button-color="#3874F6" custom-style="width: 90%;">
  41. <view class="modal-content">
  42. <van-field value="{{formData.stockname}}" label="仓库名称" placeholder="请输入仓库名称" bind:change="handleInput"
  43. data-field="stockname" required />
  44. <van-field value="{{formData.stockno}}" label="仓库编码" placeholder="请输入仓库编码" bind:change="handleInput"
  45. data-field="stockno" required />
  46. <view class="radio-group">
  47. <van-radio-group value="{{formData.isused}}" bind:change="handleRadioChange" direction="horizontal">
  48. <van-radio name="1">启用</van-radio>
  49. <van-radio name="0">停用</van-radio>
  50. </van-radio-group>
  51. </view>
  52. </view>
  53. </van-dialog>
  54. </view>