deliver_list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail">
  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="orderNum">
  10. <el-input v-model="screenForm.orderNum" 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="orderNo">
  15. <el-input v-model="screenForm.orderNo" 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="jxsNum">
  20. <el-input v-model="screenForm.jxsNum" 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="jxsName">
  25. <el-input v-model="screenForm.jxsName" 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="chName">
  30. <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="12" :lg="6">
  34. <el-form-item label="规格型号" prop="model">
  35. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="12" :lg="6">
  39. <el-form-item prop="type" label="存货类别">
  40. <el-select v-model="screenForm.type" placeholder="选择存货类别" style="width: 100%" clearable>
  41. <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.name"></el-option>
  42. </el-select>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :xs="24" :sm="12" :lg="6">
  46. <el-form-item label="发货日期" prop="date">
  47. <el-date-picker
  48. v-model="screenForm.date"
  49. type="datetimerange"
  50. range-separator="至"
  51. style="width: 100%;"
  52. value-format="yyyy-MM-dd HH:mm:ss"
  53. start-placeholder="开始日期"
  54. end-placeholder="结束日期">
  55. </el-date-picker>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  59. <el-form-item label="">
  60. <el-button size="small" @click="resetScreenForm">清空</el-button>
  61. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  62. </el-form-item>
  63. </el-col>
  64. </el-row>
  65. </el-form>
  66. </div>
  67. <div class="mymain-container">
  68. <div class="btn-group clearfix">
  69. <div class="fr">
  70. <ExportButton :exUrl="'ship/eExport'" :exParams="exParams" />
  71. </div>
  72. </div>
  73. <div class="table">
  74. <el-table
  75. v-loading="listLoading"
  76. :data="dataList"
  77. element-loading-text="Loading"
  78. border
  79. fit
  80. highlight-current-row
  81. stripe
  82. show-summary
  83. :summary-method="$getSummaries">
  84. <el-table-column align="center" label="发货单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
  85. <el-table-column align="center" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="经销商" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  92. <template slot-scope="scope">
  93. {{scope.row.payAmount | numToFixed}}
  94. </template>
  95. </el-table-column>
  96. <el-table-column align="right" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip>
  97. <template slot-scope="scope">
  98. {{scope.row.noTotalAmount | numToFixed}}
  99. </template>
  100. </el-table-column>
  101. <el-table-column align="right" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip>
  102. <template slot-scope="scope">
  103. {{scope.row.afterTaxPrice | numToFixed}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  107. <el-table-column align="right" label="未出库数量" prop="notOutNumber" min-width="100" show-overflow-tooltip></el-table-column>
  108. <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip></el-table-column>
  109. <el-table-column align="center" label="操作" width="200" fixed="right">
  110. <template slot-scope="scope">
  111. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  112. <el-button type="text" @click="getPassword(scope.row.id)">获取密码</el-button>
  113. <el-button type="text" @click="openShareDetail(scope.row.id)">密码记录</el-button>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. </div>
  118. </div>
  119. <div class="pagination clearfix">
  120. <div class="fr">
  121. <el-pagination
  122. @size-change="handleSizeChange"
  123. @current-change="handleCurrentChange"
  124. :current-page="currentPage"
  125. :page-sizes="[10, 20, 30, 50]"
  126. :page-size="10"
  127. layout="total, sizes, prev, pager, next, jumper"
  128. :total="listTotal">
  129. </el-pagination>
  130. </div>
  131. </div>
  132. </div>
  133. <!-- 密码记录 -->
  134. <el-dialog title="密码记录" :visible.sync="isShowDialog" :show-close="false" width="50%" :close-on-click-modal="false">
  135. <div class="table" style="margin: 10px 0 20px;">
  136. <el-table
  137. v-loading="dialogTable_listLoading"
  138. :data="dialogTable_dataList"
  139. element-loading-text="Loading"
  140. tooltip-effect="dark"
  141. style="width: 100%"
  142. max-height="270">
  143. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  144. <el-table-column align="center" prop="printPassword" label="密码"></el-table-column>
  145. <el-table-column align="center" prop="createTime" label="打印时间"></el-table-column>
  146. </el-table>
  147. </div>
  148. <div class="pagination clearfix">
  149. <div class="fr">
  150. <el-pagination
  151. @current-change="dialogTableCurrentChange"
  152. :current-page="dialogTable_currentPage"
  153. :page-size="dialogTable_pageSize"
  154. background
  155. layout="prev, pager, next"
  156. :total="dialogTable_listTotal">
  157. </el-pagination>
  158. </div>
  159. </div>
  160. <div slot="footer" class="dialog-footer">
  161. <el-button @click="isShowDialog = false">关 闭</el-button>
  162. </div>
  163. </el-dialog>
  164. <DeliverDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  165. </div>
  166. </template>
  167. <script>
  168. import { getDeliverList, getPassword, getPasswordRecord } from "@/api/supply/deliver";
  169. import { getCategoryList } from '@/api/common'
  170. import DeliverDetail from "@/views/supply/deliver/components/deliver_detail";
  171. export default {
  172. components: {
  173. DeliverDetail,
  174. },
  175. data() {
  176. return {
  177. currentPage: 1, // 当前页码
  178. pageSize: 10, // 每页数量
  179. listTotal: 0, // 列表总数
  180. dataList: null, // 列表数据
  181. listLoading: false, // 列表加载loading
  182. screenForm: { // 筛选表单数据
  183. orderNum: '',
  184. orderNo: '',
  185. jxsNum: '',
  186. jxsName: '',
  187. chName: '',
  188. model: '',
  189. date: '',
  190. type: '',
  191. },
  192. categoryList: [],
  193. isShowDialog: false, // 密码记录 - 弹窗
  194. dialogTable_dataList: null, // 密码记录 - 列表数据
  195. dialogTable_listLoading: true, // 密码记录 - 列表加载loading
  196. dialogTable_currentPage: 1, // 密码记录 - 当前页码
  197. dialogTable_pageSize: 10, // 密码记录 - 每页数量
  198. dialogTable_listTotal: 0, // 密码记录 - 列表总数
  199. queryItem: {},
  200. }
  201. },
  202. computed: {
  203. exParams() {
  204. return {
  205. id: this.screenForm.orderNum,
  206. mainOrderId: this.screenForm.orderNo,
  207. customerNumber: this.screenForm.jxsNum,
  208. customerName: this.screenForm.jxsName,
  209. productName: this.screenForm.chName,
  210. specification: this.screenForm.model,
  211. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  212. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  213. categoryName: this.screenForm.type,
  214. }
  215. },
  216. isShowDetail() {
  217. return this.queryItem.hasOwnProperty('id');
  218. },
  219. },
  220. created() {
  221. this.getCategoryList();
  222. this.getList();
  223. },
  224. methods: {
  225. // 查询按钮权限
  226. checkBtnRole(value) {
  227. // let btnRole = this.$route.meta.roles;
  228. // if(!btnRole) {return true}
  229. // let index = btnRole.indexOf(value);
  230. // return index >= 0;
  231. return true
  232. },
  233. // 获取存货类别列表
  234. getCategoryList() {
  235. getCategoryList({
  236. pageNum: 1,
  237. pageSize: -1,
  238. }).then(res => {
  239. this.categoryList = res.data.records;
  240. })
  241. },
  242. // 查询列表
  243. getList() {
  244. this.listLoading = true;
  245. let params = {
  246. pageNum: this.currentPage,
  247. pageSize: this.pageSize,
  248. id: this.screenForm.orderNum,
  249. mainOrderId: this.screenForm.orderNo,
  250. customerNumber: this.screenForm.jxsNum,
  251. customerName: this.screenForm.jxsName,
  252. productName: this.screenForm.chName,
  253. specification: this.screenForm.model,
  254. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  255. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  256. categoryName: this.screenForm.type,
  257. };
  258. getDeliverList(params).then((res) => {
  259. res.data.records.forEach(item => {
  260. item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
  261. item.sums1 = ['refundableQty', 'notOutNumber'];
  262. item.sums2 = ['payAmount', 'afterTaxPrice', 'noTotalAmount'];
  263. })
  264. this.dataList = res.data.records;
  265. this.listTotal = res.data.total;
  266. this.listLoading = false;
  267. })
  268. },
  269. // 提交筛选表单
  270. submitScreenForm() {
  271. this.currentPage = 1;
  272. this.getList();
  273. },
  274. // 重置筛选表单
  275. resetScreenForm() {
  276. this.$refs.screenForm.resetFields();
  277. this.currentPage = 1;
  278. this.getList();
  279. },
  280. // 更改每页数量
  281. handleSizeChange(val) {
  282. this.pageSize = val;
  283. this.currentPage = 1;
  284. this.getList();
  285. },
  286. // 更改当前页
  287. handleCurrentChange(val) {
  288. this.currentPage = val;
  289. this.getList();
  290. },
  291. // 进入详情
  292. toDetail(item) {
  293. this.queryItem = item;
  294. },
  295. backList() {
  296. this.queryItem = {};
  297. },
  298. // 获取密码
  299. getPassword(id) {
  300. getPassword({id}).then(res => {
  301. this.$alert(res.data, '新密码', {
  302. confirmButtonText: '确定',
  303. callback: action => {}
  304. });
  305. })
  306. },
  307. // 密码记录 - 获取列表
  308. getPasswordRecord(id) {
  309. getPasswordRecord({
  310. pageNum: this.dialogTable_currentPage,
  311. pageSize: this.dialogTable_pageSize,
  312. id
  313. }).then(res => {
  314. this.dialogTable_dataList = res.data.records;
  315. this.dialogTable_listTotal = res.data.total;
  316. this.dialogTable_listLoading = false;
  317. })
  318. },
  319. // 密码记录 - 打开弹窗
  320. openShareDetail(id) {
  321. this.isShowDialog = true;
  322. this.dialogTable_currentPage = 1;
  323. this.getPasswordRecord(id);
  324. },
  325. // 密码记录 - 更改列表当前页
  326. dialogTableCurrentChange(val) {
  327. this.dialogTable_currentPage = val;
  328. this.getPasswordRecord();
  329. },
  330. }
  331. }
  332. </script>
  333. <style lang="scss" scoped>
  334. </style>