home_list.vue 13 KB

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