inFactory.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. <el-button type="text" @click="selectClothWashProblems(scope.$index)" :v-if="isAdjunct == 'N'">问题</el-button>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. </div>
  47. </el-col>
  48. <el-col :span="6" :xs="24">
  49. <el-card class="box-card">
  50. <div slot="header" class="clearfix">
  51. <span>衣服信息</span>
  52. </div>
  53. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="40px">
  54. <el-form-item label="条码" prop="washCode">
  55. <el-input v-model="queryParams.washCode" placeholder="请输入条码" clearable @keyup.enter.native="searchCloth" />
  56. </el-form-item>
  57. <el-form-item>
  58. <el-button type="primary" icon="el-icon-search" @click="searchCloth">查询</el-button>
  59. </el-form-item>
  60. </el-form>
  61. <el-descriptions title="衣物信息" :column="1">
  62. <el-descriptions-item label="衣物条码">{{ orderClothItemVO ? orderClothItemVO.washCode : '' }} </el-descriptions-item>
  63. <el-descriptions-item label="衣物名称">{{ orderClothItemVO ? orderClothItemVO.clothItemName : '' }} </el-descriptions-item>
  64. <el-descriptions-item label="颜色">
  65. <template v-if="orderClothItemVO">
  66. <template v-for="(color, index) in orderClothItemVO.orderClothColors">
  67. {{ index == 0 ? color.clothColorName : ',' + color.clothColorName }}
  68. </template>
  69. </template>
  70. </el-descriptions-item>
  71. <el-descriptions-item label="瑕疵">
  72. <template v-if="orderClothItemVO">
  73. <template v-for="(color, index) in orderClothItemVO.orderClothFlaws">
  74. {{ index == 0 ? color.clothFlawName : ',' + color.clothFlawName }}
  75. </template>
  76. </template>
  77. </el-descriptions-item>
  78. <el-descriptions-item label="特殊处理">
  79. <template v-if="orderClothItemVO">
  80. <template v-for="(color, index) in orderClothItemVO.orderClothCrafts">
  81. {{ index == 0 ? color.clothCraftName : ',' + color.clothCraftName }}
  82. </template>
  83. </template>
  84. </el-descriptions-item>
  85. <el-descriptions-item label="附件" v-if="orderClothItemVO && orderClothItemVO.isAdjunct == 'N'">
  86. <template v-if="orderClothItemVO">
  87. <template v-for="(color, index) in orderClothItemVO.orderClothAdjuncts">
  88. {{ index == 0 ? color.adjunctName : ',' + color.adjunctName }}
  89. </template>
  90. </template>
  91. </el-descriptions-item>
  92. <el-descriptions-item label="收衣门店">{{ orderClothItemVO ? orderClothItemVO.orgName : '' }} </el-descriptions-item>
  93. <el-descriptions-item label="状态">
  94. <template v-if="orderClothItemVO">
  95. <span style="color: red">
  96. <template v-if="orderClothItemVO.flowStatus == 0"> 待入场 </template>
  97. <template v-if="orderClothItemVO.flowStatus == 1"> 已入厂 </template>
  98. <template v-if="orderClothItemVO.flowStatus == 2"> 已检查 </template>
  99. <template v-if="orderClothItemVO.flowStatus == 3"> 已出厂 </template>
  100. </span>
  101. </template>
  102. </el-descriptions-item>
  103. </el-descriptions>
  104. <el-button type="primary" icon="el-icon-s-order" @click="showClothItemDetail">详情</el-button>
  105. </el-card>
  106. </el-col>
  107. </el-row>
  108. <el-dialog title="入厂信息" :visible.sync="clothItemDetailOpen" width="50%" :before-close="handleClose" center>
  109. <el-descriptions :column="3">
  110. <el-descriptions-item label="衣物条码" :span="3">{{ orderClothItemVO ? orderClothItemVO.washCode : '' }} </el-descriptions-item>
  111. <el-descriptions-item label="衣物名称" :span="3">{{ orderClothItemVO ? orderClothItemVO.clothItemName : '' }} </el-descriptions-item>
  112. <el-descriptions-item label="天数">{{ orderClothItemVO ? orderClothItemVO.clothWashDayNum : '' }}天 </el-descriptions-item>
  113. <el-descriptions-item label="总额">{{ orderClothItemVO ? orderClothItemVO.totalPrice : '' }}元 </el-descriptions-item>
  114. <el-descriptions-item label="洗衣方式">{{ orderClothItemVO ? orderClothItemVO.clothWashModeName : '' }} </el-descriptions-item>
  115. <el-descriptions-item label="特殊处理">{{ orderClothItemVO ? orderClothItemVO.clothSpeedName : '' }} </el-descriptions-item>
  116. <el-descriptions-item label="是否保值">
  117. {{ orderClothItemVO ? (orderClothItemVO.isHedging == 'Y' ? '是' : '否') : '' }}
  118. </el-descriptions-item>
  119. <el-descriptions-item label="保值金额">{{ orderClothItemVO ? orderClothItemVO.hedgingPrice : '' }}元 </el-descriptions-item>
  120. <el-descriptions-item label="颜色">
  121. <template v-if="orderClothItemVO">
  122. <template v-for="(color, index) in orderClothItemVO.orderClothColors">
  123. {{ index == 0 ? color.clothColorName : ',' + color.clothColorName }}
  124. </template>
  125. </template>
  126. </el-descriptions-item>
  127. <el-descriptions-item label="瑕疵">
  128. <template v-if="orderClothItemVO">
  129. <template v-for="(color, index) in orderClothItemVO.orderClothFlaws">
  130. {{ index == 0 ? color.clothFlawName : ',' + color.clothFlawName }}
  131. </template>
  132. </template>
  133. </el-descriptions-item>
  134. <el-descriptions-item label="特殊工艺">
  135. <template v-if="orderClothItemVO">
  136. <template v-for="(color, index) in orderClothItemVO.orderClothCrafts">
  137. {{ index == 0 ? color.clothCraftName : ',' + color.clothCraftName }}
  138. </template>
  139. </template>
  140. </el-descriptions-item>
  141. <el-descriptions-item label="附件" v-if="orderClothItemVO && orderClothItemVO.isAdjunct == 'N'">
  142. <template v-if="orderClothItemVO">
  143. <template v-for="(color, index) in orderClothItemVO.orderClothAdjuncts">
  144. {{ index == 0 ? color.adjunctName : ',' + color.adjunctName }}
  145. </template>
  146. </template>
  147. </el-descriptions-item>
  148. </el-descriptions>
  149. </el-dialog>
  150. <el-dialog title="衣服问题" :visible.sync="selectClothWashProblemOpen" width="50%" :before-close="handleClose" center>
  151. <el-row :gutter="15">
  152. <el-form size="small" label-width="120px">
  153. <el-col :span="24">
  154. <el-form-item label="检查的问题" prop="washCode">
  155. <el-input v-model="clothProblemContent" placeholder="请输入检查的问题" type="textarea" :rows="5" maxlength="500" show-word-limit :style="{ width: '100%' }" />
  156. </el-form-item>
  157. </el-col>
  158. <el-col :span="24">
  159. <el-table :data="washProblems" style="width: 100%" max-height="400" highlight-current-row @cell-dblclick="addSelectWashProblem">
  160. <el-table-column label="问题" align="center" prop="content" />
  161. </el-table>
  162. </el-col>
  163. </el-form>
  164. </el-row>
  165. <span slot="footer" class="dialog-footer">
  166. <el-button @click="selectClothWashProblemOpen = false">取 消</el-button>
  167. <el-button type="primary" @click="saveWashProblem">确 定</el-button>
  168. </span>
  169. </el-dialog>
  170. </div>
  171. </template>
  172. <script>
  173. import { inFactory, deleteInFactory, setClothProblem } from '../../../api/order/clothItem'
  174. import { allWashProblem } from '@/api/cloth/washProblem'
  175. import order from '@/views/recharge/order/index.vue'
  176. export default {
  177. name: 'InFactory',
  178. computed: {},
  179. dicts: ['sys_yes_no', 'cloth_type', 'cloth_send_type'],
  180. data() {
  181. return {
  182. // 查询参数
  183. queryParams: {},
  184. orderClothItemVO: null,
  185. orderClothItemVOS: [],
  186. clothItemDetailOpen: false,
  187. washProblems: [],
  188. selectClothWashProblemOpen: false,
  189. selectClothItemIndex: null,
  190. clothProblemContent: ''
  191. }
  192. },
  193. created() {
  194. allWashProblem().then((res) => {
  195. this.washProblems = res.data
  196. })
  197. },
  198. methods: {
  199. searchCloth() {
  200. if (this.isEmpty(this.queryParams.washCode)) {
  201. this.$message.error('请先输入衣服条码')
  202. return
  203. }
  204. inFactory(this.queryParams).then((res) => {
  205. this.orderClothItemVO = res.data
  206. this.orderClothItemVOS.push(res.data)
  207. })
  208. },
  209. showClothItemDetail() {
  210. this.clothItemDetailOpen = true
  211. },
  212. handleClose(done) {
  213. this.$confirm('确认关闭?')
  214. .then((_) => {
  215. done()
  216. })
  217. .catch((_) => {})
  218. },
  219. rollbackOrderClothItem(index, washCode) {
  220. this.$confirm('确定要删除这条入厂记录吗?')
  221. .then((_) => {
  222. deleteInFactory({ washCode: washCode }).then((res) => {
  223. this.orderClothItemVOS.splice(index, 1)
  224. })
  225. })
  226. .catch((_) => {})
  227. },
  228. selectClothWashProblems(index) {
  229. this.selectClothItemIndex = index
  230. this.clothProblemContent = this.orderClothItemVOS[index].clothProblem
  231. this.selectClothWashProblemOpen = true
  232. },
  233. addSelectWashProblem(row, column, cell, event) {
  234. if (this.clothProblemContent == null) {
  235. this.clothProblemContent = ''
  236. }
  237. if (!this.isEmpty(this.clothProblemContent)) {
  238. this.clothProblemContent += ','
  239. }
  240. this.clothProblemContent += row.content
  241. },
  242. saveWashProblem() {
  243. setClothProblem({
  244. id: this.orderClothItemVOS[this.selectClothItemIndex].id,
  245. clothProblem: this.clothProblemContent
  246. }).then((res) => {
  247. this.orderClothItemVOS[this.selectClothItemIndex].clothProblem = this.clothProblemContent
  248. this.selectClothWashProblemOpen = false
  249. this.$message.success('设置成功')
  250. })
  251. },
  252. onOrderClothItemSelect(row) {
  253. this.orderClothItemVO = row
  254. this.queryParams.washCode = this.orderClothItemVO.washCode
  255. }
  256. }
  257. }
  258. </script>
  259. <style scoped></style>