index.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <div class="filter-container">
  5. <el-form
  6. label-width="100px"
  7. class="ele-form-search"
  8. @keyup.enter.native="reload"
  9. @submit.native.prevent
  10. >
  11. <el-row :gutter="15">
  12. <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
  13. <el-form-item label="销售订单号:" prop="orderNo">
  14. <el-input v-model="params.orderNo" clearable></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
  18. <el-form-item label="项目名称:" prop="projectName">
  19. <el-input v-model="params.projectName" clearable></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
  23. <el-form-item label="客户名称:" prop="customerName">
  24. <el-input v-model="params.customerName" clearable></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
  28. <el-form-item label="创建时间:" prop="createTime">
  29. <el-date-picker
  30. v-model="timeSearch"
  31. style="width: 100%"
  32. value-format="yyyy-MM-dd"
  33. type="daterange"
  34. range-separator="-"
  35. start-placeholder="开始日期"
  36. end-placeholder="结束日期"
  37. :default-time="['00:00:00', '23:59:59']"
  38. />
  39. </el-form-item>
  40. </el-col>
  41. <el-col v-bind="styleResponsive ? { lg: 4, md: 24 } : { span: 4 }">
  42. <div class="ele-form-actions">
  43. <el-button
  44. type="primary"
  45. icon="el-icon-search"
  46. class="ele-btn-icon"
  47. @click="reload('search')"
  48. >
  49. 查询
  50. </el-button>
  51. <el-button @click="reload('reset')">重置</el-button>
  52. </div>
  53. </el-col>
  54. </el-row>
  55. </el-form>
  56. </div>
  57. </el-card>
  58. <div class="ele-table-container" style="height: 100%">
  59. <ele-pro-table
  60. ref="table"
  61. :columns="columns"
  62. :datasource="datasource"
  63. :pageSizes="[10, 20, 50, 100]"
  64. :pageSize="20"
  65. height="calc(100% - 80px)"
  66. @columns-change="handleColumnChange"
  67. :cache-key="cacheKeyUrl"
  68. >
  69. <template v-slot:firstProcessDeliveryTime="{ row, $index }">
  70. <el-date-picker
  71. style="width: 100%"
  72. v-if="row.isEdit"
  73. v-model="row.firstProcessDeliveryTime"
  74. type="date"
  75. value-format="yyyy-MM-dd"
  76. placeholder="选择日期"
  77. @change="handleDateChange($event, row, $index)"
  78. :ref="`date${$index}`"
  79. >
  80. </el-date-picker>
  81. <span v-else> {{ row.firstProcessDeliveryTime }}</span>
  82. <!-- <i
  83. v-if="!row.firstProcessDeliveryTime"
  84. class="xiada el-icon-edit"
  85. @click="editFirstTime(row)"
  86. ></i> -->
  87. </template>
  88. <template v-slot:produceRoutingName="{ row }">
  89. <el-link
  90. type="primary"
  91. :underline="false"
  92. @click="produceRouting(row)"
  93. >
  94. {{ row.produceRoutingName }}</el-link
  95. >
  96. </template>
  97. <!-- 材料完成 -->
  98. <!-- 出库 -->
  99. <template v-slot:deliveryRecords="{ row }">
  100. <div v-if="row.deliveryStatus === 0" class="delivery-status">
  101. <span> 未发货 </span>
  102. <span> 数量:{{ row.productQuantity }} </span>
  103. </div>
  104. <div v-if="row.deliveryStatus === 1" class="delivery-status">
  105. <span> 已发:{{ row.deliveryQuantity }} </span>
  106. <span>
  107. 未发:{{ row.productQuantity - row.deliveryQuantity }}
  108. </span>
  109. </div>
  110. <div v-if="row.deliveryStatus === 2" class="delivery-status">
  111. <span> 全部发货 </span>
  112. <span> 数量:{{ row.deliveryQuantity }} </span>
  113. </div>
  114. </template>
  115. </ele-pro-table>
  116. </div>
  117. <produceRouting ref="produceRouting"></produceRouting>
  118. </div>
  119. </template>
  120. <script>
  121. import tabMixins from '@/mixins/tableColumnsMixin';
  122. import produceRouting from './components/produceRouting.vue';
  123. import {
  124. getList,
  125. getListPage,
  126. updateFirstProcessDeliveryTime,
  127. getProduceRoutingDetail
  128. } from '@/api/boss/index.js';
  129. import { mapGetters } from 'vuex';
  130. import { getColumns } from './columns.js';
  131. import { getRecords } from '@/utils/util';
  132. import { getByCode } from '@/api/system/dictionary-data';
  133. export default {
  134. mixins: [tabMixins],
  135. components: {
  136. produceRouting
  137. },
  138. data() {
  139. return {
  140. columnsVersion: 1,
  141. cacheKeyUrl: 'wt-views-boss-orderTracking',
  142. timeSearch: null,
  143. params: {
  144. startDate: '',
  145. endDate: '',
  146. customerId: '',
  147. projectId: '',
  148. orderNo: '',
  149. customerName: '',
  150. projectName: ''
  151. },
  152. // columns: [],
  153. orderObj: {
  154. 0: '未提交',
  155. 1: '审核中',
  156. 2: '已审核',
  157. 3: '审核未通过',
  158. 7: '作废'
  159. },
  160. statusObj: {
  161. 0: '未发货',
  162. 1: '部分发货',
  163. 2: '全部发货'
  164. },
  165. firstTime: '',
  166. records: []
  167. };
  168. },
  169. computed: {
  170. ...mapGetters(['user']),
  171. // 是否开启响应式布局
  172. styleResponsive() {
  173. return this.$store.state.theme.styleResponsive;
  174. },
  175. columns() {
  176. let columnsVersion = this.columnsVersion;
  177. return getColumns(this);
  178. }
  179. },
  180. methods: {
  181. reload(type) {
  182. if (this.timeSearch) {
  183. this.params.startDate = this.timeSearch[0];
  184. this.params.endDate = this.timeSearch[1];
  185. }
  186. if (type == 'reset') {
  187. this.params = {
  188. startDate: '',
  189. endDate: '',
  190. customerId: '',
  191. projectId: '',
  192. orderNo: ''
  193. };
  194. }
  195. this.$refs.table.reload({ page: 1, where: this.params });
  196. },
  197. datasource({ page, where, limit, ...row }) {
  198. return getListPage({
  199. ...where,
  200. pageNum: page,
  201. size: limit
  202. });
  203. },
  204. editFirstTime(row) {
  205. row.isEdit = !row.isEdit;
  206. },
  207. // 选择首工序的时间
  208. async handleDateChange(e, item, index) {
  209. item.firstProcessDeliveryTime = e;
  210. await updateFirstProcessDeliveryTime({
  211. id: item.saleOrderMaterialId,
  212. processDeliveryTime: e
  213. });
  214. this.$refs.table.reload({ where: this.params });
  215. },
  216. //打开工艺路线详情
  217. async produceRouting(row) {
  218. const res = await getProduceRoutingDetail({
  219. isDetail: false,
  220. pageNum: 1,
  221. size: -1,
  222. routingId: row.produceRoutingId
  223. });
  224. this.$refs.produceRouting.open({
  225. row: row,
  226. process: res
  227. });
  228. }
  229. },
  230. mounted() {
  231. this.$store.dispatch('theme/setBodyFullscreen', true);
  232. },
  233. beforeDestroy() {
  234. this.$store.dispatch('theme/setBodyFullscreen', false);
  235. },
  236. async created() {
  237. console.log(this, window);
  238. const res1 = await getByCode('production_status');
  239. this.productionStatus = res1.data;
  240. },
  241. beforeUpdate() {
  242. console.log('更新');
  243. }
  244. };
  245. </script>
  246. <style lang="scss" scoped>
  247. .app-container {
  248. background: #f0f3f3;
  249. min-height: calc(100vh - 84px);
  250. }
  251. .zw-page-table {
  252. background: #ffffff;
  253. padding-top: 20px;
  254. }
  255. .pagination-wrap {
  256. display: flex;
  257. justify-content: flex-end;
  258. padding: 10px 0;
  259. }
  260. .table {
  261. width: 100%;
  262. margin-top: 10px;
  263. }
  264. .outline {
  265. width: 100%;
  266. // min-width: 1px;
  267. position: relative;
  268. border-bottom: 1px solid #e5e5e5;
  269. // display: flex;
  270. // align-items: center;
  271. }
  272. .xiada {
  273. position: absolute;
  274. top: 50%;
  275. right: 0;
  276. transform: translateY(-50%);
  277. }
  278. //
  279. :deep(.spanbox) {
  280. display: flex;
  281. flex-wrap: wrap;
  282. }
  283. :deep(.span) {
  284. flex: 1;
  285. }
  286. .flex-col {
  287. display: flex;
  288. flex-direction: column;
  289. .col {
  290. flex: 1;
  291. align-content: center;
  292. white-space: nowrap;
  293. text-overflow: ellipsis;
  294. overflow: hidden;
  295. }
  296. }
  297. :deep(.el-card__body) {
  298. padding: 15px 15px 0 15px;
  299. }
  300. .ele-body {
  301. height: calc(100vh - 95px);
  302. .ele-table-container {
  303. height: 100%;
  304. :deep(.el-card__body) {
  305. padding: 0.3vw;
  306. }
  307. :deep(.ele-table-tool-default) {
  308. padding: 0 15px;
  309. }
  310. :deep(.has-gutter) {
  311. height: 50px;
  312. }
  313. :deep(.el-table__header) {
  314. height: 50px;
  315. // background-color: #615fe7;
  316. }
  317. :deep(.ele-pro-table) {
  318. height: 99%;
  319. }
  320. :deep(.el-table) {
  321. // font-size: 0.62vw;
  322. }
  323. }
  324. }
  325. .delivery-status {
  326. display: flex;
  327. justify-content: space-around;
  328. }
  329. :deep(.ele-pro-table-header-ellipsis > .el-table th.el-table__cell > .cell) {
  330. white-space: pre;
  331. }
  332. :deep(
  333. .el-date-editor
  334. el-input
  335. el-input--medium
  336. el-input--prefix
  337. el-input--suffix
  338. el-date-editor--date
  339. ) {
  340. width: 100%;
  341. }
  342. </style>