hide.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <view class="app-content">
  3. <view class="ex-page">
  4. <view class="input-wrap">
  5. <view style="padding:0 0upx 0 20upx;" >
  6. <button class="admin-button-com middle blue" style="background-color:green;border:1upx solid green;margin-right:20upx;" @click="allShow()">全部取消隐藏</button>
  7. </view>
  8. </view>
  9. <view style="margin-left:30upx;padding-top:10upx;padding-bottom:10upx;font-size:32upx;">点击红色的成本,可以将相应花材取消隐藏</view>
  10. <scroll-view scroll-y scroll-with-animation class="main-view">
  11. <view class="space-view ex-table">
  12. <t-table :headerBackgroundColor="'#F0F2F6'">
  13. <t-tr header>
  14. <t-th><view style="width:200upx;text-align:left;">花材</view></t-th>
  15. <t-th>库存</t-th>
  16. <t-th>路上</t-th>
  17. <t-th>大客</t-th>
  18. <t-th>批发</t-th>
  19. <t-th>零售</t-th>
  20. <t-th><view>成本</view></t-th>
  21. </t-tr>
  22. <block v-if="!$util.isEmpty(classItemData)">
  23. <block v-for="(classItem,classIndex) in classItemData" :key="classIndex">
  24. <block v-if="classItem.child && !$util.isEmpty(classItem.child)">
  25. <t-tr>
  26. <t-td>
  27. <text style="color:#3385FF;font-weight:bold;width:200upx;text-align:left;font-size:30upx;">
  28. {{ classItem.className }}
  29. </text>
  30. </t-td>
  31. <t-td>
  32. <text style="margin-left:30upx;color:green;font-weight:bold;font-size:30upx;" @click="cancelClassHide(classItem)">取消隐藏</text>
  33. </t-td>
  34. <t-td></t-td>
  35. </t-tr>
  36. <template v-if="classItem.child && !$util.isEmpty(classItem.child)">
  37. <block v-for="(productItem, productIndex) in classItem.child" :key="productIndex">
  38. <t-tr>
  39. <t-td>
  40. <view v-if="productItem.stock>0" style="width:200upx;text-align:left;color:black;font-size:29upx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" @click="pageTo({url:'/admin/item/detail?id='+productItem.id})">
  41. {{productItem.name}}
  42. </view>
  43. <view v-else style="width:200upx;text-align:left;color:#b5b3b3;font-size:29upx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" @click="pageTo({url:'/admin/item/detail?id='+productItem.id})">
  44. {{productItem.name}}
  45. </view>
  46. </t-td>
  47. <t-td>
  48. <view v-if="productItem.stock>0" style="color:#333333;font-weight:bold;font-size:29upx;">
  49. {{productItem.stock?parseFloat(productItem.stock):0}}
  50. </view>
  51. <view v-else style="color:#b5b3b3;font-weight:bold;font-size:29upx;">
  52. {{productItem.stock?parseFloat(productItem.stock):0}}
  53. </view>
  54. </t-td>
  55. <t-td>
  56. <text v-if="Number(productItem.onStock)>0" style="color:#0a97a9;font-size:30upx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
  57. {{productItem.onStock}}
  58. </text>
  59. <text v-else style="color:#0a97a9;font-size:30upx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
  60. -
  61. </text>
  62. </t-td>
  63. <t-td>
  64. <view style="font-size:28upx;">
  65. ¥{{productItem.hjPrice?parseFloat(productItem.hjPrice):0}}
  66. </view>
  67. </t-td>
  68. <t-td>
  69. <view style="color:#3385FF;font-size:30upx;">
  70. ¥{{productItem.price?parseFloat(productItem.price):0}}
  71. </view>
  72. </t-td>
  73. <t-td>
  74. <view style="font-size:28upx;">
  75. ¥{{productItem.skPrice?parseFloat(productItem.skPrice):0}}
  76. </view>
  77. </t-td>
  78. <t-td>
  79. <view style="font-size:28upx;color:red;" @click="showCurrentItme(productItem)">
  80. ¥{{productItem.avCost?parseFloat(productItem.avCost):0}}
  81. </view>
  82. </t-td>
  83. </t-tr>
  84. </block>
  85. </template>
  86. </block>
  87. </block>
  88. </block>
  89. </t-table>
  90. </view>
  91. </scroll-view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  97. import SelectList from "@/components/plugin/selectList";
  98. import { getProductDataApi } from "@/api/product";
  99. import { cancelAllItemHide,cancelClassItemHide,changeFrontHide } from "@/api/item";
  100. import { list } from "@/mixins";
  101. import ShopSelect from "@/components/module/shopSelect";
  102. import DateSelect from "@/components/module/dateSelect";
  103. import {mapGetters} from "vuex";
  104. import AppSearchModule from "@/components/module/app-search";
  105. export default {
  106. components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect,AppSearchModule},
  107. mixins: [list],
  108. computed: {
  109. ...mapGetters(["getDictionariesInfo","getLoginInfo","getMyShopInfo"])
  110. },
  111. data() {
  112. return {
  113. isShow:false,
  114. customizationTime:'',
  115. shopId:'',
  116. itemId:'',
  117. nowTime: "",
  118. showTimeDropdown: false,
  119. nowShop: "",
  120. showShopDropdown: false,
  121. dataList: [],
  122. profile:[],
  123. storageData:[],
  124. searchContent:'',
  125. shopId:0,
  126. classItemData:[],
  127. form:{shopId:0,shopName:'',hasSelect:0},
  128. confirmIn:0
  129. };
  130. },
  131. onLoad() {
  132. this.showHideItem()
  133. },
  134. methods: {
  135. init(){
  136. },
  137. cancelClassHide(classInfo){
  138. this.$util.confirmModal({content:'确认此分类下花材取消隐藏?'},() => {
  139. cancelClassItemHide({classId:classInfo.classId}).then(res=>{
  140. this.$msg('操作成功')
  141. this.showHideItem()
  142. })
  143. })
  144. },
  145. showCurrentItme(item){
  146. this.$util.confirmModal({content:'确认此花材取消隐藏?'},() => {
  147. changeFrontHide({id:item.id,status:0}).then(res=>{
  148. if(res.code == 1){
  149. this.$msg('操作成功')
  150. this.showHideItem()
  151. }
  152. })
  153. })
  154. },
  155. allShow(){
  156. this.$util.confirmModal({content:'确认所有花材取消隐藏?'},() => {
  157. cancelAllItemHide().then(res=>{
  158. if(res.code == 1){
  159. this.$msg('操作成功')
  160. this.showHideItem()
  161. }
  162. })
  163. })
  164. },
  165. showHideItem(){
  166. this.shopId = this.getMyShopInfo.id;
  167. let type = '';
  168. let that = this
  169. uni.showLoading()
  170. getProductDataApi({ type, shopId: this.shopId,status:0,requestType:'hideItem'}).then(res=>{
  171. uni.hideLoading()
  172. if(res.code == 1){
  173. that.classItemData = res.data.classItem ? res.data.classItem : []
  174. }
  175. })
  176. }
  177. }
  178. };
  179. </script>
  180. <style lang="scss" scoped>
  181. .ex-page {
  182. background: white;
  183. padding-top:20upx;
  184. height: 100%;
  185. display: flex;
  186. flex-direction: column;
  187. .input-wrap {
  188. display: flex;
  189. padding: 0upx 20upx 0upx 13upx;
  190. .search-bar {
  191. flex: 1;
  192. }
  193. }
  194. .top-bar {
  195. width: 100%;
  196. z-index: 20;
  197. .bar{
  198. width: 50%;
  199. height: 100%;
  200. text-align: center;
  201. &:nth-child(1){
  202. border-right: 1upx solid #eeeeec;
  203. }
  204. }
  205. }
  206. .main-view {
  207. margin-top:10upx;
  208. flex: 1;
  209. background-color: #f9fbfc;
  210. .space-view {
  211. background-color: #fff;
  212. }
  213. .ex-info {
  214. padding: 30upx;
  215. .info-cell {
  216. display: flex;
  217. align-items: center;
  218. font-size: 28upx;
  219. &:not(:first-child) {
  220. margin-top: 20upx;
  221. }
  222. .cell-label {
  223. width: 110upx;
  224. color: #666666;
  225. }
  226. .cell-value {
  227. margin-left: 40upx;
  228. color: #333;
  229. &.warning {
  230. color: #ffaf1d;
  231. }
  232. &.success {
  233. color: #27c325;
  234. }
  235. }
  236. }
  237. }
  238. .ex-table {
  239. ::v-deep.icon-info {
  240. color: #333333;
  241. }
  242. }
  243. }
  244. .bar-view {
  245. display: flex;
  246. justify-content: space-between;
  247. align-items: center;
  248. padding: 0 30upx;
  249. width: 100%;
  250. height: 100upx;
  251. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  252. .info-view {
  253. font-size: 26upx;
  254. }
  255. .btn-view {
  256. display: flex;
  257. .admin-button-com {
  258. margin: 0 10upx;
  259. }
  260. }
  261. }
  262. }
  263. </style>