reserve_list.vue 14 KB

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