deliver_list.vue 11 KB

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