deliver_list.vue 13 KB

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