home_list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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="24" :lg="24">
  9. <el-form-item prop="orderNum" label-width="0">
  10. <el-radio-group v-model="screenForm.status" size="medium">
  11. <el-radio-button label="1">全部</el-radio-button>
  12. <el-radio-button label="2">已发货</el-radio-button>
  13. <el-radio-button label="3">已取消</el-radio-button>
  14. </el-radio-group>
  15. </el-form-item>
  16. </el-col> -->
  17. <el-col :xs="24" :sm="12" :lg="6">
  18. <el-form-item label="发货单号" prop="orderNum">
  19. <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="经销商编号" prop="jxsNum">
  24. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编号"></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="经销商名称" prop="jxsName">
  29. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :sm="12" :lg="6">
  33. <el-form-item label="发货日期" prop="date">
  34. <el-date-picker
  35. v-model="screenForm.date"
  36. type="datetimerange"
  37. range-separator="至"
  38. style="width: 100%;"
  39. value-format="yyyy-MM-dd HH:mm:ss"
  40. start-placeholder="开始日期"
  41. end-placeholder="结束日期">
  42. </el-date-picker>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :xs="24" :sm="12" :lg="6">
  46. <el-form-item label="产品名称" prop="chName">
  47. <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :xs="24" :sm="12" :lg="6">
  51. <el-form-item label="规格型号" prop="model">
  52. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :xs="24" :sm="12" :lg="6" class="tr">
  56. <el-form-item label="">
  57. <el-button size="small" @click="resetScreenForm">清空</el-button>
  58. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  59. </el-form-item>
  60. </el-col>
  61. </el-row>
  62. </el-form>
  63. </div>
  64. <div class="mymain-container">
  65. <div class="btn-group clearfix">
  66. <div class="fl">
  67. <!-- <el-button size="small" type="warning" icon="el-icon-close">退货</el-button> -->
  68. </div>
  69. <div class="fr">
  70. <ExportButton :exUrl="'ship/pExport'" :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="customerNumber" min-width="100" 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="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  83. <el-table-column align="center" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
  84. <el-table-column align="center" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  85. <el-table-column align="center" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="center" label="审单人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="center" label="审单日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
  92. <el-table-column align="center" label="状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  93. <template slot-scope="scope">
  94. {{scope.row.examineStatus | statusFilter}}
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="center" label="操作" width="200" fixed="right">
  98. <template slot-scope="scope">
  99. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  100. <el-button type="text" @click="getPassword(scope.row.id)">获取密码</el-button>
  101. <el-button type="text" @click="openShareDetail(scope.row.id)">密码记录</el-button>
  102. </template>
  103. </el-table-column>
  104. </el-table>
  105. </div>
  106. </div>
  107. <div class="pagination clearfix">
  108. <div class="fr">
  109. <el-pagination
  110. @size-change="handleSizeChange"
  111. @current-change="handleCurrentChange"
  112. :current-page="currentPage"
  113. :page-sizes="[10, 20, 30, 50]"
  114. :page-size="10"
  115. layout="total, sizes, prev, pager, next, jumper"
  116. :total="listTotal">
  117. </el-pagination>
  118. </div>
  119. </div>
  120. </div>
  121. <!-- 密码记录 -->
  122. <el-dialog title="密码记录" :visible.sync="isShowDialog" :show-close="false" width="50%" :close-on-click-modal="false">
  123. <div class="table" style="margin: 10px 0 20px;">
  124. <el-table
  125. v-loading="dialogTable_listLoading"
  126. :data="dialogTable_dataList"
  127. element-loading-text="Loading"
  128. tooltip-effect="dark"
  129. style="width: 100%"
  130. max-height="270">
  131. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  132. <el-table-column align="center" prop="printPassword" label="密码"></el-table-column>
  133. <el-table-column align="center" prop="createTime" label="打印时间"></el-table-column>
  134. </el-table>
  135. </div>
  136. <div class="pagination clearfix">
  137. <div class="fr">
  138. <el-pagination
  139. @current-change="dialogTableCurrentChange"
  140. :current-page="dialogTable_currentPage"
  141. :page-size="dialogTable_pageSize"
  142. background
  143. layout="prev, pager, next"
  144. :total="dialogTable_listTotal">
  145. </el-pagination>
  146. </div>
  147. </div>
  148. <div slot="footer" class="dialog-footer">
  149. <el-button @click="isShowDialog = false">关 闭</el-button>
  150. </div>
  151. </el-dialog>
  152. <HomeDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  153. </div>
  154. </template>
  155. <script>
  156. import { getEnginList, getPassword, getPasswordRecord } from "@/api/supply/deliver";
  157. import HomeDetail from "@/views/supply/deliver/components/home_detail";
  158. let that
  159. export default {
  160. components: {
  161. HomeDetail,
  162. },
  163. filters: {
  164. statusFilter(val) {
  165. let obj = that.statusList.find(o => o.value == val);
  166. return obj ? obj.label : ''
  167. },
  168. },
  169. data() {
  170. return {
  171. currentPage: 1, // 当前页码
  172. pageSize: 10, // 每页数量
  173. listTotal: 0, // 列表总数
  174. dataList: null, // 列表数据
  175. listLoading: false, // 列表加载loading
  176. screenForm: { // 筛选表单数据
  177. orderNum: '',
  178. jxsName: '',
  179. chName: '',
  180. model: '',
  181. date: '',
  182. jxsNum: '',
  183. status: '',
  184. },
  185. statusList: [
  186. { label: '已保存', value: 'SAVE' },
  187. { label: '待审核', value: 'WAIT' },
  188. { label: '审核通过', value: 'OK' },
  189. { label: '审核驳回', value: 'FAIL' },
  190. { label: '已关闭', value: 'CLOSE' },
  191. ],
  192. isShowDialog: false, // 密码记录 - 弹窗
  193. dialogTable_dataList: null, // 密码记录 - 列表数据
  194. dialogTable_listLoading: true, // 密码记录 - 列表加载loading
  195. dialogTable_currentPage: 1, // 密码记录 - 当前页码
  196. dialogTable_pageSize: 10, // 密码记录 - 每页数量
  197. dialogTable_listTotal: 0, // 密码记录 - 列表总数
  198. queryItem: {},
  199. }
  200. },
  201. computed: {
  202. exParams() {
  203. return {
  204. id: this.screenForm.orderNum,
  205. customerNumber: this.screenForm.jxsNum,
  206. customerName: this.screenForm.jxsName,
  207. materialName: this.screenForm.chName,
  208. specification: this.screenForm.model,
  209. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  210. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  211. orderType: 2, // 2家用工程 3商用工程
  212. }
  213. },
  214. isShowDetail() {
  215. return this.queryItem.hasOwnProperty('id');
  216. },
  217. },
  218. beforeCreate() {
  219. that = this;
  220. },
  221. created() {
  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. getList() {
  235. this.listLoading = true;
  236. let params = {
  237. pageNum: this.currentPage,
  238. pageSize: this.pageSize,
  239. id: this.screenForm.orderNum,
  240. customerNumber: this.screenForm.jxsNum,
  241. customerName: this.screenForm.jxsName,
  242. materialName: this.screenForm.chName,
  243. specification: this.screenForm.model,
  244. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  245. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  246. orderType: 2, // 2家用工程 3商用工程
  247. };
  248. getEnginList(params).then((res) => {
  249. this.dataList = res.data.records;
  250. this.listTotal = res.data.total;
  251. this.listLoading = false;
  252. })
  253. },
  254. // 提交筛选表单
  255. submitScreenForm() {
  256. this.currentPage = 1;
  257. this.getList();
  258. },
  259. // 重置筛选表单
  260. resetScreenForm() {
  261. this.$refs.screenForm.resetFields();
  262. this.currentPage = 1;
  263. this.getList();
  264. },
  265. // 更改每页数量
  266. handleSizeChange(val) {
  267. this.pageSize = val;
  268. this.currentPage = 1;
  269. this.getList();
  270. },
  271. // 更改当前页
  272. handleCurrentChange(val) {
  273. this.currentPage = val;
  274. this.getList();
  275. },
  276. // 进入详情
  277. toDetail(item) {
  278. this.queryItem = item;
  279. },
  280. backList() {
  281. this.queryItem = {};
  282. },
  283. // 获取密码
  284. getPassword(id) {
  285. getPassword({id}).then(res => {
  286. this.$alert(res.data, '新密码', {
  287. confirmButtonText: '确定',
  288. callback: action => {}
  289. });
  290. })
  291. },
  292. // 密码记录 - 获取列表
  293. getPasswordRecord(id) {
  294. getPasswordRecord({
  295. pageNum: this.dialogTable_currentPage,
  296. pageSize: this.dialogTable_pageSize,
  297. id
  298. }).then(res => {
  299. this.dialogTable_dataList = res.data.records;
  300. this.dialogTable_listTotal = res.data.total;
  301. this.dialogTable_listLoading = false;
  302. })
  303. },
  304. // 密码记录 - 打开弹窗
  305. openShareDetail(id) {
  306. this.isShowDialog = true;
  307. this.dialogTable_currentPage = 1;
  308. this.getPasswordRecord(id);
  309. },
  310. // 密码记录 - 更改列表当前页
  311. dialogTableCurrentChange(val) {
  312. this.dialogTable_currentPage = val;
  313. this.getPasswordRecord();
  314. },
  315. }
  316. }
  317. </script>
  318. <style lang="scss" scoped>
  319. </style>