check.vue 19 KB

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