reserve_list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="90px" size="small" label-position="left">
  7. <el-row :gutter="20">
  8. <el-col :xs="24" :sm="12" :lg="6">
  9. <el-form-item label="产品名称" prop="goodsName">
  10. <el-input v-model="screenForm.goodsName" placeholder="请输入产品名称"></el-input>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="产品编码" prop="goodsNum">
  15. <el-input v-model="screenForm.goodsNum" placeholder="请输入产品编码"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="经销商名称" prop="jxsName">
  20. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="经销商编号" prop="jxsNum">
  25. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编号"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :xs="24" :sm="12" :lg="6">
  29. <el-form-item label="预留日期" prop="date">
  30. <el-date-picker
  31. v-model="screenForm.date"
  32. type="datetimerange"
  33. range-separator="至"
  34. style="width: 100%;"
  35. value-format="yyyy-MM-dd HH:mm:ss"
  36. start-placeholder="开始日期"
  37. end-placeholder="结束日期">
  38. </el-date-picker>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="6">
  42. <el-form-item label="制表人" prop="createMan">
  43. <el-input v-model="screenForm.createMan" placeholder="请输入制表人"></el-input>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="12" :lg="6">
  47. <el-form-item label="修改人" prop="updateMan">
  48. <el-input v-model="screenForm.updateMan" placeholder="请输入修改人"></el-input>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :lg="6">
  52. <el-form-item label="预留单号" prop="orderNum">
  53. <el-input v-model="screenForm.orderNum" placeholder="请输入预留单号"></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :xs="24" :sm="12" :lg="6">
  57. <el-form-item label="销售订单号" prop="saleNum">
  58. <el-input v-model="screenForm.saleNum" placeholder="请输入销售订单号"></el-input>
  59. </el-form-item>
  60. </el-col>
  61. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  62. <el-form-item label="">
  63. <el-button size="small" @click="resetScreenForm">清空</el-button>
  64. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  65. </el-form-item>
  66. </el-col>
  67. </el-row>
  68. </el-form>
  69. </div>
  70. <div class="mymain-container">
  71. <div class="btn-group clearfix">
  72. <div class="fl">
  73. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
  74. </div>
  75. <div class="fr">
  76. <ExportButton :exUrl="'reserve/export'" :exParams="exParams" />
  77. </div>
  78. </div>
  79. <div class="table">
  80. <el-table
  81. v-loading="listLoading"
  82. :data="dataList"
  83. element-loading-text="Loading"
  84. border
  85. fit
  86. highlight-current-row
  87. stripe
  88. show-summary
  89. :summary-method="$getSummaries">
  90. <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
  91. <template slot-scope="scope">
  92. {{scope.row.status | statusFilter}}
  93. </template>
  94. </el-table-column>
  95. <el-table-column align="center" label="预留单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
  96. <el-table-column align="center" label="预留日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  97. <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
  98. <el-table-column align="center" label="订单日期" prop="orderTime" min-width="120" show-overflow-tooltip>
  99. <template slot-scope="scope">
  100. {{scope.row.orderTime | dateToDayFilter}}
  101. </template>
  102. </el-table-column>
  103. <!-- <el-table-column align="center" label="产品大类" prop="mainName" min-width="160" show-overflow-tooltip></el-table-column> -->
  104. <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
  105. <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
  106. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  107. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  108. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  109. <el-table-column align="right" label="预留数量" prop="reservedNum" min-width="100" show-overflow-tooltip></el-table-column>
  110. <el-table-column align="right" label="开单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  111. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  112. <el-table-column align="center" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip></el-table-column>
  113. <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  114. <el-table-column align="center" label="制表人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  115. <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  116. <el-table-column align="center" label="修改人" prop="updateBy" min-width="100" show-overflow-tooltip></el-table-column>
  117. <el-table-column align="center" label="修改日期" prop="updateTime" min-width="160" show-overflow-tooltip></el-table-column>
  118. <el-table-column align="center" label="关闭人" prop="closureBy" min-width="100" show-overflow-tooltip></el-table-column>
  119. <el-table-column align="center" label="关闭日期" prop="closureTime" min-width="160" show-overflow-tooltip></el-table-column>
  120. <el-table-column align="center" label="操作" width="160" fixed="right">
  121. <template slot-scope="scope">
  122. <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles)">编辑</el-button>
  123. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  124. <el-popconfirm
  125. style="margin-left: 10px;"
  126. title="确定关闭吗?"
  127. @onConfirm="handleClose(scope.row.itemId)"
  128. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.status === 1">
  129. <el-button slot="reference" type="text">关闭</el-button>
  130. </el-popconfirm>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. </div>
  135. </div>
  136. <div class="pagination clearfix">
  137. <div class="fr">
  138. <el-pagination
  139. @size-change="handleSizeChange"
  140. @current-change="handleCurrentChange"
  141. :current-page="currentPage"
  142. :page-sizes="[10, 20, 30, 50]"
  143. :page-size="10"
  144. layout="total, sizes, prev, pager, next, jumper"
  145. :total="listTotal">
  146. </el-pagination>
  147. </div>
  148. </div>
  149. </div>
  150. <ReserveDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  151. <ReserveForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  152. </div>
  153. </template>
  154. <script>
  155. import { getList, closeData } from "@/api/supply/reserve";
  156. import ReserveDetail from "@/views/supply/reserve/components/reserve_detail";
  157. import ReserveForm from "@/views/supply/reserve/components/reserve_form";
  158. export default {
  159. components: {
  160. ReserveDetail,
  161. ReserveForm,
  162. },
  163. filters: {
  164. statusFilter(val) {
  165. const MAP = {
  166. 0: '已关闭',
  167. 1: '执行中',
  168. }
  169. return MAP[val];
  170. }
  171. },
  172. data() {
  173. return {
  174. currentPage: 1, // 当前页码
  175. pageSize: 10, // 每页数量
  176. listTotal: 0, // 列表总数
  177. dataList: null, // 列表数据
  178. listLoading: false, // 列表加载loading
  179. screenForm: { // 筛选表单数据
  180. goodsName: '',
  181. goodsNum: '',
  182. orderNum: '',
  183. jxsName: '',
  184. jxsNum: '',
  185. date: '',
  186. createMan: '',
  187. updateMan: '',
  188. orderNum: '',
  189. saleNum: '',
  190. },
  191. queryItem: {},
  192. isShowDetail: false,
  193. isShowForm: false,
  194. }
  195. },
  196. computed: {
  197. exParams() {
  198. return {
  199. retreatOrderNo: this.screenForm.orderNum,
  200. customerNumber: this.screenForm.jxsNum,
  201. customerName: this.screenForm.jxsName,
  202. productName: this.screenForm.chName,
  203. specification: this.screenForm.model,
  204. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  205. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  206. status: 2, // 1:发货单,2:工程发货单
  207. }
  208. },
  209. },
  210. created() {
  211. this.getList();
  212. },
  213. methods: {
  214. // 查询列表
  215. getList() {
  216. this.listLoading = true;
  217. let params = {
  218. pageNum: this.currentPage,
  219. pageSize: this.pageSize,
  220. materialName: this.screenForm.goodsName,
  221. materialCode: this.screenForm.goodsNum,
  222. customerNumber: this.screenForm.jxsNum,
  223. customerName: this.screenForm.jxsName,
  224. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  225. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  226. createBy: this.screenForm.createMan,
  227. updateBy: this.screenForm.updateMan,
  228. id: this.screenForm.orderNum,
  229. orderId: this.screenForm.saleNum,
  230. };
  231. getList(params).then((res) => {
  232. res.data.records.forEach(item => {
  233. item.sums1 = ['reservedNum', 'qty'];
  234. item.sums2 = [];
  235. })
  236. this.dataList = res.data.records;
  237. this.listTotal = res.data.total;
  238. this.listLoading = false;
  239. })
  240. },
  241. // 提交筛选表单
  242. submitScreenForm() {
  243. this.currentPage = 1;
  244. this.getList();
  245. },
  246. // 重置筛选表单
  247. resetScreenForm() {
  248. this.$refs.screenForm.resetFields();
  249. this.currentPage = 1;
  250. this.getList();
  251. },
  252. // 更改每页数量
  253. handleSizeChange(val) {
  254. this.pageSize = val;
  255. this.currentPage = 1;
  256. this.getList();
  257. },
  258. // 更改当前页
  259. handleCurrentChange(val) {
  260. this.currentPage = val;
  261. this.getList();
  262. },
  263. // 进入表单
  264. toForm(item) {
  265. this.queryItem = item;
  266. this.isShowForm = true;
  267. },
  268. // 进入详情
  269. toDetail(item) {
  270. this.queryItem = item;
  271. this.isShowDetail = true;
  272. },
  273. backList() {
  274. this.queryItem = {};
  275. this.isShowDetail = false;
  276. this.isShowForm = false;
  277. },
  278. // 关闭
  279. handleClose(id) {
  280. closeData({itemId: id}).then(res => {
  281. this.$successMsg();
  282. this.getList();
  283. })
  284. }
  285. }
  286. }
  287. </script>
  288. <style lang="scss" scoped>
  289. </style>