check.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowPrint">
  4. <div class="main-title" style="margin-top: 0;">
  5. <div class="title">仓库提货确认</div>
  6. </div>
  7. <div>
  8. <el-form ref="screenForm" :model="screenForm" label-width="96px" size="mini" label-position="right">
  9. <el-row :gutter="20">
  10. <el-col :xs="24" :sm="8" :lg="6">
  11. <el-form-item label="提货人手机号" prop="phone">
  12. <el-input v-model="screenForm.phone" placeholder="请输入提货人手机号"></el-input>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :xs="24" :sm="3" :lg="3">
  16. <el-button size="mini" type="primary" @click="getCode" :disabled="!screenForm.phone || countDown != 60">{{countDown == 60 ? getCodeText : '重新获取('+countDown+'s)'}}</el-button>
  17. </el-col>
  18. <el-col :xs="24" :sm="8" :lg="8">
  19. <el-form-item label="验证码" prop="code">
  20. <el-input v-model="screenForm.code" placeholder="请输入验证码"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="3" :lg="3">
  24. <el-button size="mini" type="primary" :disabled="!screenForm.phone || !screenForm.code" @click="getPickupManInfo">确 认</el-button>
  25. </el-col>
  26. </el-row>
  27. <el-row :gutter="20">
  28. <el-col :xs="24" :sm="11" :lg="9">
  29. <el-form-item label="提货人姓名" prop="name">
  30. <el-input v-model="screenForm.name" placeholder="请通过手机验证获取" readonly></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="8" :lg="8">
  34. <el-form-item label="提货人身份证" prop="idCard">
  35. <el-input v-model="screenForm.idCard" placeholder="请通过手机验证获取" readonly></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="8" :lg="8">
  39. <el-form-item label="经销商" prop="customerNumber">
  40. <el-select style="width:100%" v-model="screenForm.customerNumber" placeholder="请选择经销商" clearable filterable >
  41. <el-option v-for="item in dealerList"
  42. :key="item.number"
  43. :label="item.name"
  44. :value="item.number">
  45. </el-option>
  46. </el-select>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :xs="24" :sm="5" :lg="5">
  50. <el-button size="mini" type="primary" @click="getList">查 询</el-button>
  51. </el-col>
  52. </el-row>
  53. <el-row :gutter="20">
  54. <el-col :xs="24" :sm="24" :lg="24">
  55. <el-form-item prop="status" label-width="0">
  56. <el-radio-group v-model="screenForm.status" size="mini" @change="getList()">
  57. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
  58. </el-radio-group>
  59. </el-form-item>
  60. </el-col>
  61. </el-row>
  62. </el-form>
  63. </div>
  64. <div class="main-title">
  65. <div class="title">提货单</div>
  66. <div class="fr">
  67. <ExportButton :exUrl="'pick/storeExport'" :exParams="exParams" />
  68. </div>
  69. </div>
  70. <div class="mymain-container">
  71. <div class="table">
  72. <el-table ref="table" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @select="handleSelect" @select-all="handleSelectAll">
  73. <el-table-column align="left" type="selection" width="55"></el-table-column>
  74. <!-- <el-table-column align="left" label="操作" width="100" fixed="left">
  75. <template slot-scope="scope">
  76. <el-button type="text" @click="toPrint(scope.row)">打印</el-button>
  77. </template>
  78. </el-table-column> -->
  79. <el-table-column align="left" label="状态" min-width="100" show-overflow-tooltip>
  80. <template slot-scope="scope">
  81. {{ scope.row.printNum ? '已打单(' + scope.row.printNum + ')' : '未打单' }}
  82. </template>
  83. </el-table-column>
  84. <el-table-column align="left" label="信息密钥" prop="informationKey" min-width="120" show-overflow-tooltip>
  85. <template slot-scope="scope">
  86. <CopyButton :copyText="scope.row.informationKey" />
  87. <span>{{scope.row.informationKey}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  91. <template slot-scope="scope">
  92. <CopyButton :copyText="scope.row.customerNumber" />
  93. <span>{{scope.row.customerNumber}}</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  97. <template slot-scope="scope">
  98. <CopyButton :copyText="scope.row.customerName" />
  99. <span>{{scope.row.customerName}}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="left" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
  103. <template slot-scope="scope">
  104. {{ scope.row.pickTime | dateToDayFilter }}
  105. </template>
  106. </el-table-column>
  107. <el-table-column align="left" label="提货时段" min-width="100" show-overflow-tooltip>
  108. <template slot-scope="scope">
  109. {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
  110. </template>
  111. </el-table-column>
  112. <el-table-column align="left" label="销售订单号" prop="mainOrderId" min-width="160" show-overflow-tooltip>
  113. <template slot-scope="scope">
  114. <CopyButton :copyText="(scope.row.orderType == 'HOME' || scope.row.orderType == 'TRADE') ? scope.row.enginOrderNo: scope.row.mainOrderId" />
  115. <span>{{ (scope.row.orderType == 'HOME' || scope.row.orderType == 'TRADE') ? scope.row.enginOrderNo: scope.row.mainOrderId }}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column align="left" label="发货申请单号" prop="invoiceId" min-width="130" show-overflow-tooltip>
  119. <template slot-scope="scope">
  120. <CopyButton :copyText="scope.row.invoiceId" />
  121. <span>{{scope.row.invoiceId}}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  125. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  126. <template slot-scope="scope">
  127. <CopyButton :copyText="scope.row.materialCode" />
  128. <span>{{scope.row.materialCode}}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  132. <template slot-scope="scope">
  133. <CopyButton :copyText="scope.row.materialOldNumber" />
  134. <span>{{scope.row.materialOldNumber}}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  138. <template slot-scope="scope">
  139. <CopyButton :copyText="scope.row.materialName" />
  140. <span>{{scope.row.materialName}}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  144. <template slot-scope="scope">
  145. <CopyButton :copyText="scope.row.specification" />
  146. <span>{{scope.row.specification}}</span>
  147. </template>
  148. </el-table-column>
  149. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  150. <el-table-column align="left" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  151. <!-- <el-table-column align="left" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  152. <el-table-column align="left" label="金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
  153. <el-table-column align="left" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
  154. <el-table-column align="left" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column> -->
  155. <el-table-column align="left" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
  156. <el-table-column align="left" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
  157. <template slot-scope="scope">
  158. {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
  159. </template>
  160. </el-table-column>
  161. <el-table-column align="left" label="提货人/物流公司" prop="takerName" min-width="160" show-overflow-tooltip>
  162. <template slot-scope="scope">
  163. {{ scope.row.pickType == '1' ? scope.row.takerName:scope.row.pickLogistics }}
  164. </template>
  165. </el-table-column>
  166. </el-table>
  167. </div>
  168. </div>
  169. <!-- <div class="pagination clearfix">
  170. <div class="fr">
  171. <el-pagination
  172. @size-change="handleSizeChange"
  173. @current-change="handleCurrentChange"
  174. :current-page="currentPage"
  175. :page-sizes="[10, 20, 30, 50]"
  176. :page-size="10"
  177. layout="total, sizes, prev, pager, next, jumper"
  178. :total="listTotal">
  179. </el-pagination>
  180. </div>
  181. </div> -->
  182. <div class="page-footer">
  183. <div class="footer">
  184. <el-button type="primary" @click="toPrint" :disabled="tableSelection.length < 1">打印发货单</el-button>
  185. </div>
  186. </div>
  187. </div>
  188. <el-dialog title="密码确认" :visible.sync="isShowDialog" :show-close="false" width="40%" :close-on-click-modal="false">
  189. <el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="right" label-width="70px">
  190. <el-row :gutter="20">
  191. <el-col :xs="24" :sm="24" :lg="24">
  192. <el-form-item label="密码" prop="password">
  193. <el-input v-model="dialogForm.password" autocomplete="off" placeholder="请输入密码"></el-input>
  194. </el-form-item>
  195. </el-col>
  196. <el-col :xs="24" :sm="12" :lg="12">
  197. <el-form-item label="操作人" prop="createMan">
  198. <el-input v-model="dialogForm.createMan" readonly></el-input>
  199. </el-form-item>
  200. </el-col>
  201. <el-col :xs="24" :sm="12" :lg="12" style="height: 51px;">
  202. <el-form-item label="操作日期" prop="createDate">
  203. <el-date-picker v-model="dialogForm.createDate" readonly type="date" value-format="yyyy-MM-dd" style="width: 100%;" placeholder="选择日期">
  204. </el-date-picker>
  205. </el-form-item>
  206. </el-col>
  207. </el-row>
  208. </el-form>
  209. <div slot="footer" class="dialog-footer">
  210. <el-button @click="cancelDialogForm">取 消</el-button>
  211. <el-button type="primary" @click="submitDialogForm">确 定</el-button>
  212. </div>
  213. </el-dialog>
  214. <PickupPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />
  215. </div>
  216. </template>
  217. <script>
  218. import {
  219. getPickupList,
  220. getCode,
  221. getPickupManInfo,
  222. checkPassword,
  223. } from "@/api/supply/pickup";
  224. import { getDealerList, getListCustomer } from "@/api/basic_data/dealer";
  225. import PickupPrint from "@/views/supply/pickup/components/pickup_print";
  226. export default {
  227. components: {
  228. PickupPrint,
  229. },
  230. data() {
  231. return {
  232. currentPage: 1, // 当前页码
  233. pageSize: 10, // 每页数量
  234. listTotal: 0, // 列表总数
  235. dataList: null, // 列表数据
  236. listLoading: false, // 列表加载loading
  237. screenForm: {
  238. // 筛选表单数据
  239. phone: "",
  240. code: "",
  241. name: "",
  242. idCard: "",
  243. manId: "",
  244. status: 0,
  245. customerNumber:''
  246. },
  247. statusList: [
  248. { label: "未打单", value: 0 },
  249. { label: "已打单", value: 1 },
  250. ],
  251. getCodeText: "获取验证码",
  252. countDown: 60,
  253. timer: null,
  254. tableSelection: [],
  255. queryItem: {},
  256. isShowPrint: false,
  257. dealerList:[],
  258. isShowDialog: false,
  259. dialogForm: {
  260. password: "",
  261. createMan: "",
  262. createDate: "",
  263. },
  264. dialogFormRules: {
  265. password: [{ required: true, message: "请输入密码", trigger: "blur" }],
  266. },
  267. };
  268. },
  269. computed: {
  270. exParams() {
  271. return {
  272. takerId: this.screenForm.manId,
  273. status: this.screenForm.status,
  274. };
  275. },
  276. },
  277. created() {
  278. // this.getDealerList()
  279. },
  280. methods: {
  281. getDate() {
  282. var date = new Date();
  283. var seperator1 = "-";
  284. var year = date.getFullYear();
  285. var month = date.getMonth() + 1;
  286. var strDate = date.getDate();
  287. if (month >= 1 && month <= 9) {
  288. month = "0" + month;
  289. }
  290. if (strDate >= 0 && strDate <= 9) {
  291. strDate = "0" + strDate;
  292. }
  293. var currentdate = year + seperator1 + month + seperator1 + strDate;
  294. return currentdate;
  295. },
  296. async getDealerList() {
  297. const res = await getDealerList({ pageNum: 1, pageSize: -1 });
  298. this.dealerList = res.data.records;
  299. },
  300. // 获取短信验证码
  301. getCode() {
  302. getCode({ mobile: this.screenForm.phone }).then((res) => {
  303. this.$successMsg("短信已发送");
  304. this.countDown--;
  305. this.timer = setInterval(() => {
  306. this.countDown--;
  307. if (this.countDown == 0) {
  308. this.countDown = 60;
  309. this.getCodeText = "重新获取";
  310. clearInterval(this.timer);
  311. }
  312. }, 1000);
  313. });
  314. },
  315. // 获取提货人信息
  316. getPickupManInfo() {
  317. getPickupManInfo({
  318. mobile: this.screenForm.phone,
  319. code: this.screenForm.code,
  320. }).then((res) => {
  321. this.$successMsg("验证成功");
  322. this.screenForm.name = res.data.takerName;
  323. this.screenForm.idCard = res.data.identity;
  324. this.screenForm.manId = res.data.id;
  325. this.getListCustomer()
  326. });
  327. },
  328. getListCustomer(){
  329. getListCustomer({
  330. keyword:'',
  331. phone: this.screenForm.phone,
  332. pageNum:1,
  333. pageSize:-1
  334. }).then(res=>{
  335. this.dealerList = res.data.records
  336. this.screenForm.customerNumber = this.dataList[0].number
  337. })
  338. },
  339. // 查询列表
  340. getList() {
  341. if (!this.screenForm.manId) {
  342. return this.$errorMsg("请先查询提货人信息");
  343. }
  344. if (!this.screenForm.customerNumber) {
  345. return this.$errorMsg("请选择经销商");
  346. }
  347. this.listLoading = true;
  348. let params = {
  349. pageNum: 1,
  350. pageSize: -1,
  351. // takerId: this.screenForm.manId,
  352. status: this.screenForm.status,
  353. takerPhone: this.screenForm.phone,
  354. customerNumber:this.screenForm.customerNumber
  355. };
  356. getPickupList(params).then((res) => {
  357. this.dataList = res.data.records;
  358. this.listTotal = res.data.total;
  359. this.listLoading = false;
  360. });
  361. },
  362. // 更改每页数量
  363. handleSizeChange(val) {
  364. this.pageSize = val;
  365. this.currentPage = 1;
  366. this.getList();
  367. },
  368. // 更改当前页
  369. handleCurrentChange(val) {
  370. this.currentPage = val;
  371. this.getList();
  372. },
  373. backList() {
  374. this.queryItem = {};
  375. this.isShowPrint = false;
  376. },
  377. handleSelect(selection, row) {
  378. this.$refs.table.toggleRowSelection(row);
  379. this.dataList.forEach((item) => {
  380. if (item.informationKey === row.informationKey) {
  381. this.$refs.table.toggleRowSelection(item);
  382. }
  383. });
  384. this.tableSelection = this.$refs.table.selection;
  385. },
  386. handleSelectAll(selection) {
  387. this.tableSelection = this.$refs.table.selection;
  388. },
  389. // 检查是否一致
  390. isAllEqual(array) {
  391. if (array.length > 0) {
  392. return !array.some(function (item, index) {
  393. return item.informationKey !== array[0].informationKey;
  394. });
  395. } else {
  396. return true;
  397. }
  398. },
  399. // 点击打印
  400. toPrint() {
  401. if (!this.isAllEqual(this.tableSelection)) {
  402. return this.$errorMsg("只能选择同一个提货订单");
  403. }
  404. if (!this.tableSelection[0].printNum) {
  405. this.queryItem = this.tableSelection;
  406. this.isShowPrint = true;
  407. } else {
  408. this.queryItem = this.tableSelection;
  409. this.dialogForm.createMan = JSON.parse(
  410. localStorage.getItem("supply_user")
  411. ).nickName;
  412. this.dialogForm.createDate = this.getDate();
  413. this.isShowDialog = true;
  414. }
  415. },
  416. // 点击打印
  417. // toPrint(item) {
  418. // if(!item.printNum) {
  419. // this.queryItem = item;
  420. // this.isShowPrint = true;
  421. // }else {
  422. // this.queryItem = item;
  423. // this.dialogForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
  424. // this.dialogForm.createDate = this.getDate();
  425. // this.isShowDialog = true;
  426. // }
  427. // },
  428. // 关闭弹窗
  429. cancelDialogForm() {
  430. this.isShowDialog = false;
  431. this.$refs.dialogForm.resetFields();
  432. },
  433. // 提交 弹窗
  434. submitDialogForm() {
  435. this.$refs.dialogForm.validate((valid) => {
  436. if (valid) {
  437. let params = {
  438. shipId: this.queryItem[0].invoiceId,
  439. password: this.dialogForm.password,
  440. };
  441. checkPassword(params).then((res) => {
  442. this.cancelDialogForm();
  443. this.isShowPrint = true;
  444. });
  445. }
  446. });
  447. },
  448. },
  449. };
  450. </script>
  451. <style lang="scss" scoped>
  452. .main-title {
  453. display: flex;
  454. justify-content: space-between;
  455. align-items: center;
  456. height: 60px;
  457. border-bottom: 1px solid #dcdfe6;
  458. margin-bottom: 20px;
  459. .title {
  460. font-size: 16px;
  461. font-weight: 600;
  462. padding-left: 10px;
  463. }
  464. }
  465. </style>