checkCloth.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <el-col :span="18" :xs="24">
  5. <div style="width: 100%" class="verticle-view">
  6. <el-table :data="orderClothItemVOS" fit highlight-current-row border stripe @cell-click="onOrderClothItemSelect">
  7. <el-table-column label="序号" type="index" align="center" fixed="left" width="80"> </el-table-column>
  8. <el-table-column label="衣服条码" align="center" prop="name" width="200">
  9. <template slot-scope="scope">
  10. <span>{{ scope.row.washCode }}</span>
  11. </template>
  12. </el-table-column>
  13. <el-table-column label="衣服名称" align="center" prop="name" width="150">
  14. <template slot-scope="scope">
  15. <span>{{ scope.row.clothItemName }}</span>
  16. </template>
  17. </el-table-column>
  18. <el-table-column label="衣服品牌" align="center" prop="name" width="120">
  19. <template slot-scope="scope">
  20. <span>{{ scope.row.clothBrandName }}</span>
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="衣服颜色" align="center" prop="name" width="150">
  24. <template slot-scope="scope">
  25. <template v-for="(item, index) in scope.row.orderClothColors">
  26. {{ index == 0 ? item.clothColorName : ',' + item.clothColorName }}
  27. </template>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="衣服瑕疵" align="center" prop="name">
  31. <template slot-scope="scope">
  32. <span>
  33. <template v-for="(item, index) in scope.row.orderClothFlaws">
  34. {{ index == 0 ? item.clothFlawName : ',' + item.clothFlawName }}
  35. </template>
  36. </span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
  40. <template slot-scope="scope">
  41. <el-button type="text" @click="rollbackOrderClothItem(scope.$index, scope.row.washCode)">重洗</el-button>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. </div>
  46. </el-col>
  47. <el-col :span="6" :xs="24">
  48. <el-card class="box-card">
  49. <div slot="header" class="clearfix">
  50. <span>衣服信息</span>
  51. </div>
  52. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="40px">
  53. <el-form-item label="条码" prop="washCode">
  54. <el-input v-model="queryParams.washCode" placeholder="请输入条码" clearable @keyup.enter.native="searchCloth" />
  55. </el-form-item>
  56. <el-form-item>
  57. <el-button type="primary" icon="el-icon-search" @click="searchCloth">查询</el-button>
  58. </el-form-item>
  59. </el-form>
  60. <el-descriptions title="衣物信息" :column="1">
  61. <el-descriptions-item label="衣物条码">{{ orderClothItemVO ? orderClothItemVO.washCode : '' }}</el-descriptions-item>
  62. <el-descriptions-item label="衣物名称">{{ orderClothItemVO ? orderClothItemVO.clothItemName : '' }}</el-descriptions-item>
  63. <el-descriptions-item label="是否重洗">
  64. <template v-if="orderClothItemVO">
  65. <span v-if="orderClothItemVO && orderClothItemVO.repeatCount > 0" style="color: red"> 重洗 {{ orderClothItemVO.repeatCount }} 次 </span>
  66. <span v-else> 否 </span>
  67. </template>
  68. </el-descriptions-item>
  69. <el-descriptions-item label="颜色">
  70. <template v-if="orderClothItemVO">
  71. <template v-for="(color, index) in orderClothItemVO.orderClothColors">
  72. {{ index == 0 ? color.clothColorName : ',' + color.clothColorName }}
  73. </template>
  74. </template>
  75. </el-descriptions-item>
  76. <el-descriptions-item label="瑕疵">
  77. <template v-if="orderClothItemVO">
  78. <template v-for="(color, index) in orderClothItemVO.orderClothFlaws">
  79. {{ index == 0 ? color.clothFlawName : ',' + color.clothFlawName }}
  80. </template>
  81. </template>
  82. </el-descriptions-item>
  83. <el-descriptions-item label="特殊处理">
  84. <template v-if="orderClothItemVO">
  85. <template v-for="(color, index) in orderClothItemVO.orderClothCrafts">
  86. {{ index == 0 ? color.clothCraftName : ',' + color.clothCraftName }}
  87. </template>
  88. </template>
  89. </el-descriptions-item>
  90. <el-descriptions-item label="附件">
  91. <template v-if="orderClothItemVO">
  92. <template v-for="(color, index) in orderClothItemVO.orderClothAdjuncts">
  93. {{ index == 0 ? color.adjunctName : ',' + color.adjunctName }}
  94. </template>
  95. </template>
  96. </el-descriptions-item>
  97. <el-descriptions-item label="收衣门店">{{ orderClothItemVO ? orderClothItemVO.orgName : '' }}</el-descriptions-item>
  98. <el-descriptions-item label="状态">
  99. <template v-if="orderClothItemVO">
  100. <span style="color: red">
  101. <template v-if="orderClothItemVO.flowStatus == 0"> 待入场 </template>
  102. <template v-if="orderClothItemVO.flowStatus == 1"> 已入厂 </template>
  103. <template v-if="orderClothItemVO.flowStatus == 2"> 已检查 </template>
  104. <template v-if="orderClothItemVO.flowStatus == 3"> 已出厂 </template>
  105. <template v-if="orderClothItemVO.flowStatus == 100"> 重洗 </template>
  106. </span>
  107. </template>
  108. </el-descriptions-item>
  109. </el-descriptions>
  110. <el-button type="primary" icon="el-icon-s-order" @click="rollbackOrderClothItemByObj">重洗</el-button>
  111. </el-card>
  112. </el-col>
  113. </el-row>
  114. </div>
  115. </template>
  116. <script>
  117. import { checkCloth, rewashCloth } from '../../../api/order/clothItem'
  118. export default {
  119. name: 'CheckCloth',
  120. computed: {},
  121. dicts: ['sys_yes_no', 'cloth_type', 'cloth_send_type'],
  122. data() {
  123. return {
  124. // 查询参数
  125. queryParams: {},
  126. orderClothItemVO: null,
  127. orderClothItemVOS: [],
  128. clothItemDetailOpen: false,
  129. selectClothItemIndex: null
  130. }
  131. },
  132. created() {
  133. // allWashProblem().then(res => {
  134. // this.washProblems = res.data
  135. // })
  136. },
  137. methods: {
  138. searchCloth() {
  139. if (this.isEmpty(this.queryParams.washCode)) {
  140. this.$message.error('请先输入衣服条码')
  141. return
  142. }
  143. checkCloth(this.queryParams).then((res) => {
  144. this.orderClothItemVO = res.data
  145. this.orderClothItemVOS.push(res.data)
  146. })
  147. },
  148. showClothItemDetail() {
  149. this.clothItemDetailOpen = true
  150. },
  151. handleClose(done) {
  152. this.$confirm('确认关闭?')
  153. .then((_) => {
  154. done()
  155. })
  156. .catch((_) => {})
  157. },
  158. rollbackOrderClothItem(index, washCode) {
  159. this.$confirm('确定要重洗这件衣服吗?')
  160. .then((_) => {
  161. rewashCloth({ washCode: washCode }).then((res) => {
  162. this.orderClothItemVOS.splice(index, 1)
  163. })
  164. if (this.orderClothItemVO && this.orderClothItemVO.washCode == washCode) {
  165. this.orderClothItemVO.flowStatus = '100'
  166. }
  167. this.$forceUpdate()
  168. })
  169. .catch((_) => {})
  170. },
  171. rollbackOrderClothItemByObj() {
  172. if (!this.orderClothItemVO) {
  173. this.$message.error('请先选择衣物')
  174. return
  175. }
  176. this.$confirm('确定要重洗这件衣服吗?')
  177. .then((_) => {
  178. rewashCloth({ washCode: this.orderClothItemVO.washCode }).then((res) => {
  179. for (let i = 0; i < this.orderClothItemVOS.length; i++) {
  180. if (this.orderClothItemVOS[i].washCode == this.orderClothItemVO.washCode) {
  181. this.orderClothItemVOS.splice(i, 1)
  182. break
  183. }
  184. }
  185. this.orderClothItemVO.flowStatus = '100'
  186. this.$forceUpdate()
  187. })
  188. })
  189. .catch((_) => {})
  190. },
  191. onOrderClothItemSelect(row) {
  192. this.orderClothItemVO = row
  193. this.queryParams.washCode = this.orderClothItemVO.washCode
  194. }
  195. }
  196. }
  197. </script>
  198. <style scoped></style>