shippingPage.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. <template>
  2. <div class="p-4 bg-white dark:bg-[#0e1726]">
  3. <el-button type="text" @click="goBack">返回</el-button>
  4. <!-- <h2 class="text-center my-4">发货管理</h2> -->
  5. <div class="text-center my-4">
  6. <Vue3Barcode v-if="barcodeValue" :value='barcodeValue' width="1" height='30'></Vue3Barcode>
  7. <!-- <p>RYKS_DDD-20240527-00201</p> -->
  8. </div>
  9. <el-tabs v-model="activeTab" class="dark:bg-[#0e1726]">
  10. <el-tab-pane label="基本信息" name="basic-info">
  11. <div class="p-4">
  12. <span>预约类型:</span>
  13. <el-select v-model="shippingForm.appointment_type" clearable placeholder="Select" size="small"
  14. style="width: 100px">
  15. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  16. </el-select>
  17. <p class="mt-1 mb-1" v-if="shippingForm.appointment_type !== 0"><span>上门时间:</span>
  18. <el-date-picker v-model="shippingForm.appointment_time" style="width: 170px" size="small"
  19. type="datetime" placeholder="Select date and time" :default-time="defaultTime" />
  20. </p>
  21. <p>订单状态:{{ orderTypeName(shippingForm.order_vo.status) }}</p>
  22. <p>订单类型:{{ shippingForm.order_vo.type == 'TO_B' ? '销售订单' : '租赁订单' }}</p>
  23. <p>下单客户:{{ customerName(shippingForm.order_vo.member_id) }}</p>
  24. <p>付款方式:{{ collectingAccountName(shippingForm.order_vo.pay_type) }}</p>
  25. <p>实付金额:{{ shippingForm.order_vo.pay_price }}</p>
  26. <p>仓库:{{ warehouseName(shippingForm.warehouse_id) }}</p>
  27. <p>收货人:{{ shippingForm.order_vo.customer_name }}</p>
  28. <p>联系电话:{{ shippingForm.order_vo.customer_phone }}</p>
  29. <p>地址:{{ shippingForm.order_vo.province_city_area_address }}</p>
  30. <p>客户备注:{{ shippingForm.order_vo.remark }}</p>
  31. <p v-if="send_type.value !== 'EXPRESS_DELIVERY'">
  32. <span v-if="shippingForm.order_vo.send_type !== 'SELF_PICKUP'">运单号:{{
  33. shippingForm.kdn_order_code }}</span>
  34. <span v-else>自提单号:{{ shippingForm.self_pickup_num }}</span>
  35. </p>
  36. <div v-else>
  37. <p>
  38. 快递公司: <el-select v-model="params.logistics_type" clearable>
  39. <el-option v-for="(item, index) in deliveryTypeList" :key="index" :label="item.name"
  40. :value="item.code"></el-option>
  41. </el-select>
  42. </p>
  43. <p>
  44. 物流单号: <el-input v-model="params.logistics_code" :minlength="1" :maxlength="20"
  45. placeholder="请输入物流单号"></el-input>
  46. </p>
  47. <p>
  48. 寄件人手机号: <el-input v-model="params.logistics_phone" :minlength="1" :maxlength="20"
  49. placeholder="请输入寄件人手机号后四位"></el-input>
  50. </p>
  51. </div>
  52. <p class="mt-1 mb-1">物品总重量:<el-input v-model.number="params.total_weight" size="small"
  53. :minlength="1" style="width: 170px" :maxlength="20" type="number" max="50" clearable
  54. placeholder="请输入物品总重量"><template #append>KG</template></el-input>
  55. </p>
  56. <p class="mt-1 mb-1">物品总体积: <el-input v-model="params.total_volume" ref="totalInput" size="small"
  57. :minlength="1" style="width: 170px" :maxlength="20" clearable
  58. placeholder="请输入物品总体积"><template #append>m³</template></el-input>
  59. </p>
  60. <p>物品价格: <el-input v-model="params.declared_value" size="small" :minlength="1" style="width: 170px"
  61. :maxlength="20" clearable placeholder="请输入物品价格"><template #append>元</template></el-input>
  62. </p>
  63. </div>
  64. <!-- <div class="p-4">
  65. <p>3.12 快递已收货</p>
  66. <p>3.13 快递已到达中转站</p>
  67. </div> -->
  68. </el-tab-pane>
  69. <el-tab-pane label="商品信息" name="product-info">
  70. <el-table :data="shippingForm.order_item_vos" style="width: 100%">
  71. <el-table-column prop="goods_vo.name" label="商品名称" />
  72. <el-table-column prop="product_vo.sku" label="SKU" />
  73. <el-table-column prop="orderNum" label="订单数量" />
  74. <el-table-column prop="num" label="出库数量">
  75. <template #default="scope">
  76. <span :style="{ color: scope.row.num > 0 ? 'red' : 'black' }">
  77. {{ scope.row.num }}
  78. </span>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. </el-tab-pane>
  83. </el-tabs>
  84. <el-dialog v-model="dialogVisible" :modal=false title="扫码出库" :close-on-click-modal="false" top="80px"
  85. width="90%" style="height: 190px" :before-close="handleClose">
  86. <el-form :model="snCodeForm" label-width="auto" style="max-width: 600px">
  87. <el-form-item label="SKU">
  88. <el-input class="hidden-input" v-model="snCodeForm.bar_code" @keyup.enter="toSearch()" clearable
  89. :inputmode="inputmode" ref="inputRef">
  90. <template #append> <img src="../../assets/images/JP.png" @click="getInfo" class="w-8 h-8" />
  91. </template>
  92. </el-input>
  93. </el-form-item>
  94. <el-form-item label="序列号">
  95. <el-input v-model="snCodeForm.sn_code" clearable :inputmode="inputmode" ref="snInputRef"
  96. @keyup.enter="toSnCode()" />
  97. </el-form-item>
  98. </el-form>
  99. <!-- <template #footer>
  100. <div class="dialog-footer">
  101. <el-button @click="dialogVisible = false"></el-button>
  102. <el-button type="primary" @click="dialogVisible = false">
  103. Confirm
  104. </el-button>
  105. </div>
  106. </template> -->
  107. </el-dialog>
  108. <div class="flex justify-center pt-2 pb-2 mt-4 w-full fixed bottom-0 bg-white left-0 z-50 dark:bg-[#0e1726]"
  109. v-if="send_type.value !== 'EXPRESS_DELIVERY'">
  110. <el-button type="primary" size="large" @click="scanCode">扫码出库</el-button>
  111. <el-button type="primary" size="large"
  112. v-if="shippingForm.kdn_order_code == '' || shippingForm.kdn_order_code == undefined"
  113. @click="getOrderNumber">获取运单号</el-button>
  114. <el-button type="primary" size="large" v-else @click="ship">发货</el-button>
  115. </div>
  116. <div class="flex justify-center pt-2 pb-2 mt-4 w-full fixed bottom-0 bg-white left-0 z-50" v-else>
  117. <el-button type="primary" size="large" @click="scanCode">扫码出库</el-button>
  118. <el-button type="primary" size="large" @click="ship">发货</el-button>
  119. </div>
  120. </div>
  121. </template>
  122. <script lang="ts" setup>
  123. import { ref, onMounted, watch, reactive, nextTick, onBeforeUnmount } from 'vue';
  124. import { useRouter, useRoute } from 'vue-router';
  125. import { orderApi, infoApi, dictionaryAPI } from '@/api/api'
  126. import { regionData, codeToText } from 'element-china-area-data'
  127. //引入
  128. import Vue3Barcode from 'vue3-barcode'
  129. //定义要生成条形码的值
  130. import { ElMessage } from 'element-plus'
  131. const appointment_time = ref('')
  132. const defaultTime = new Date(2000, 1, 1, 12, 0, 0)
  133. let dialogVisible = ref(false)
  134. const tableData = ref([])
  135. let barcodeValue = ref('')
  136. let inputmode = ref('text')
  137. const router = useRouter();
  138. const route = useRoute()
  139. const activeTab = ref('product-info');
  140. const id = ref(route.params.id);
  141. const send_type = ref(route.params.send_type);
  142. let shippingForm: any = ref({
  143. order_vo: {
  144. status: '',
  145. type: '',
  146. member_id: '',
  147. pay_type: '',
  148. pay_price: '',
  149. customer_name: '',
  150. customer_phone: '',
  151. province_city_area_address: '',
  152. remark: ''
  153. },
  154. warehouse_id: '',
  155. appointment_type: 0,
  156. order_item_vos: []
  157. });
  158. const options = [
  159. {
  160. label: "立即单",
  161. value: 0,
  162. },
  163. {
  164. label: "预约上门",
  165. value: 1,
  166. },
  167. ]
  168. //表单
  169. const snCodeForm = reactive({
  170. bar_code: "",
  171. sn_code: '',
  172. })
  173. const inputRef = ref();
  174. const snInputRef = ref<any>(null)
  175. const customerList: any = ref([])//初始化客户列表
  176. const warehouseList: any = ref([])//初始化客户列表
  177. const collectingAccountList: any = ref([])//初始化客户列表
  178. const deliveryList: any = ref([])//初始化客户列表
  179. const orderTypeList: any = ref([])//初始化客户列表
  180. const index = ref(-1);
  181. const deliveryTypeList: any = ref([])
  182. const params: any = ref({
  183. logistics_type: "",
  184. logistics_code: "",
  185. logistics_phone: "",
  186. send_type: '',
  187. selfPickupNum: '',
  188. remark: "",//备注
  189. declared_value: "",//物品价格
  190. appointment_type: 0,
  191. total_weight: "",//物品总重量
  192. total_volume: "",//物品总体积
  193. //发货人
  194. sender: {
  195. name: "",
  196. phone: "",
  197. address: "",
  198. province_city_area_address: ""
  199. },
  200. //收货人
  201. receiver: {
  202. name: "",
  203. phone: "",
  204. address: "",
  205. province_city_area_address: ""
  206. },
  207. //商品信息列表
  208. order_item_vos: [],
  209. goods_list: [],
  210. warehouse_id: '',
  211. goods_num: '',
  212. })
  213. let isReadOnly: any = ref(false)
  214. let sku = ref('');
  215. watch(activeTab, (newValue, oldValue) => {
  216. console.log(`Tab changed from ${oldValue} to ${newValue}`);
  217. // 这里可以添加一些逻辑,但要确保不会再次修改 activeTab
  218. });
  219. const toggleReadOnly = () => {
  220. isReadOnly = !isReadOnly;
  221. };
  222. const enableVirtualKeyboard = (event) => {
  223. event.target.readOnly = false;
  224. };
  225. const getInfo = () => {
  226. if (inputmode.value == 'none') {
  227. inputmode.value = 'text'
  228. inputRef.value.focus();
  229. } else {
  230. inputmode.value = 'none'
  231. inputRef.value.focus();
  232. }
  233. }
  234. /* 扫sku */
  235. const toSearch = async () => {
  236. activeTab.value = 'product-info'
  237. try {
  238. if (!snCodeForm.bar_code) {
  239. console.log('扫码枪输入为空,忽略此次事件');
  240. return;
  241. }
  242. const res: any = await orderApi.getProduct(
  243. shippingForm.value.warehouse_id,
  244. snCodeForm.bar_code.replace(/\s+/g, '')
  245. );
  246. res.data.sn_code_list = [];
  247. sku.value = res.data.product_vo.sku;
  248. let indexs = shippingForm.value.order_item_vos.findIndex(el => (
  249. el.goods_vo.id === res.data.goods_id &&
  250. el.product_id === res.data.product_id &&
  251. el.product_vo.sku === res.data.product_vo.sku
  252. ));
  253. if (indexs === -1) {
  254. let existingProduct = shippingForm.value.order_item_vos.find(el => (
  255. el.goods_vo.id === res.data.goods_id &&
  256. el.product_id === res.data.product_id &&
  257. el.product_vo.sku === res.data.product_vo.sku
  258. ));
  259. if (!existingProduct) {
  260. //ElMessageBox.error('订单内没有该商品,请重新录入');
  261. nextTick(() => {
  262. inputRef.value.focus();
  263. });
  264. return;
  265. }
  266. index.value = shippingForm.value.order_item_vos.length;
  267. shippingForm.value.order_item_vos.push(res.data);
  268. } else {
  269. index.value = indexs;
  270. }
  271. if (res.data.product_vo.have_sn) {
  272. nextTick(() => {
  273. // Assuming there's a ref named snInputRef
  274. snInputRef.value.focus();
  275. });
  276. } else {
  277. if (shippingForm.value.order_item_vos[index.value].num >= shippingForm.value.order_item_vos[index.value].orderNum) return ElMessage.warning('出库数量不能大于订单数量!')
  278. shippingForm.value.order_item_vos[index.value].num += 1
  279. snCodeForm.bar_code = ''
  280. //dialogVisible.value = false;
  281. }
  282. } catch (error) {
  283. console.error('Error fetching product:', error);
  284. snCodeForm.bar_code = ''
  285. }
  286. };
  287. //扫描序列号
  288. const toSnCode = async () => {
  289. if (!sku.value) return ElMessage.error('请先扫描sku!')
  290. try {
  291. const res: any = await orderApi.getsnCode(
  292. "out",
  293. sku.value,
  294. snCodeForm.sn_code.replace(/\s+/g, '')
  295. );
  296. snCodeForm.sn_code = "";
  297. const exists = shippingForm.value.order_item_vos[index.value].sn_code_list.find(
  298. item => item.sn_code === res.sn_code && item.sku === res.sku
  299. );
  300. if (!exists) {
  301. /* 请求保存 */
  302. await infoApi.skuRedis({ send_order_id: id.value, item_id: shippingForm.value.order_item_vos[index.value].id, sku: res.data }).then((respons: any) => {
  303. shippingForm.value.order_item_vos[index.value].sn_code_list.push(res.data);
  304. })
  305. }
  306. shippingForm.value.order_item_vos[index.value].num = shippingForm.value.order_item_vos[index.value].sn_code_list.length;
  307. const indexs = shippingForm.value.order_item_vos.findIndex(el => (
  308. el.goods_id === res.goods_id &&
  309. el.product_id === res.product_id &&
  310. el.product_vo.sku === res.sku
  311. ));
  312. //shippingForm.value.order_item_vos[index.value].id = shippingForm.value.order_item_vos[indexs].id;
  313. if (shippingForm.value.order_item_vos[index.value].num === shippingForm.value.order_item_vos[index.value].orderNum) {
  314. snCodeForm.bar_code = "";
  315. return ElMessage.warning('录入完成,请录入下一条!')
  316. /* dialogVisible.value = false; */
  317. } else {
  318. snCodeForm.bar_code = "";
  319. nextTick(() => {
  320. inputRef.value.focus();
  321. });
  322. }
  323. } catch (error) {
  324. console.error('Error fetching SN code:', error);
  325. }
  326. }
  327. //关闭弹窗
  328. const handleClose = (done: () => void) => {
  329. done()
  330. }
  331. onMounted(() => {
  332. init()
  333. getInforList()
  334. });
  335. const goBack = () => {
  336. router.push({ name: 'order' });
  337. };
  338. const scanCode = () => {
  339. dialogVisible.value = true
  340. nextTick(() => {
  341. if (inputRef.value) {
  342. try {
  343. inputRef.value.focus(); // 先尝试聚焦 input 元素
  344. setTimeout(() => {
  345. if (inputRef.value) {
  346. // 首先,让输入框失去焦点,这会阻止键盘的唤起
  347. //inputRef.value.removeAttribute('readonly');
  348. inputRef.value.focus();
  349. inputmode.value = 'none'
  350. }
  351. }, 100);
  352. } catch (error) {
  353. console.error('Failed to select input:', error);
  354. }
  355. }
  356. });
  357. };
  358. const getOrderNumber = () => {
  359. if (params.value.total_weigh == 0) return ElMessage.error('请输入物品总重量!')
  360. if (params.value.total_volume == 0) return ElMessage.error('请输入物品总体积!')
  361. //发货详细地址
  362. if (params.value.receiver.city_name === '市辖区') {
  363. params.value.receiver.city_name = params.value.receiver.province_name;
  364. }
  365. if (params.value.sender.city_name === '市辖区') {
  366. params.value.sender.city_name = params.value.sender.province_name;
  367. }
  368. params.value.receiver.province_city_area_address =
  369. params.value.receiver.province_name +
  370. params.value.receiver.city_name +
  371. params.value.receiver.area_name +
  372. params.value.receiver.address;
  373. //收货详细地址
  374. params.value.sender.province_city_area_address =
  375. params.value.sender.province_name +
  376. params.value.sender.city_name +
  377. params.value.sender.area_name +
  378. params.value.sender.address;
  379. /* params.value.order_item_vos = shippingForm.value.order_item_vos */
  380. //商品信息
  381. const item = {
  382. goods_name: '',
  383. quantity: '',
  384. unit: ''
  385. };
  386. shippingForm.value.order_item_vos.map((el) => {
  387. item.goods_name = el.goods_vo.name;
  388. /* item.goods_price = el.product_vo.price; */
  389. item.quantity = el.orderNum;
  390. item.unit = el.product_vo.unit;
  391. return params.value.goods_list.push(item);
  392. });
  393. params.value.goods_num = shippingForm.value.order_item_vos.reduce(
  394. (sum, e) => sum + Number(e.orderNum || 0),
  395. 0
  396. );
  397. if (shippingForm.appointment_type !== 0) {
  398. params.value.appointment_time = shippingForm.appointment_time
  399. }
  400. params.value.warehouse_id = shippingForm.value.warehouse_id
  401. params.value.send_type = send_type.value
  402. params.value.order_code = id.value
  403. /*console.log(shippingForm);
  404. //商品信息
  405. const item = {};
  406. shippingForm.order_item_vos.map((el) => {
  407. item.goods_name = el.goods_vo.name;
  408. item.quantity = el.orderNum;
  409. item.unit = el.product_vo.unit;
  410. return params.goods_list.push(item);
  411. });
  412. params.goods_num = this.product_list.reduce(
  413. (sum, e) => sum + Number(e.orderNum || 0),
  414. 0
  415. );
  416. params.total_weight = Number(params.total_weight);
  417. params.total_volume = Number(params.total_volume);
  418. params.declared_value = Number(params.declared_value);
  419. //地址
  420. params.send_address = this.send_address;
  421. params.receive_address = this.receive_address;
  422. params.order_code = this.id; */
  423. orderApi.getkdShip(id.value, params.value).then(res => {
  424. init()
  425. location.reload();
  426. })
  427. };
  428. const ship = () => {
  429. //发货详细地址
  430. params.value.receiver.province_city_area_address =
  431. params.value.receiver.province_name +
  432. params.value.receiver.city_name +
  433. params.value.receiver.area_name +
  434. params.value.receiver.address;
  435. //收货详细地址
  436. params.value.sender.province_city_area_address =
  437. params.value.sender.province_name +
  438. params.value.sender.city_name +
  439. params.value.sender.area_name +
  440. params.value.sender.address;
  441. params.value.order_item_vos = shippingForm.value.order_item_vos
  442. if (shippingForm.appointment_type !== 0) {
  443. params.value.appointment_time = shippingForm.appointment_time
  444. }
  445. const item = {
  446. goods_name: "",
  447. quantity: '',
  448. unit: "",
  449. };
  450. params.value.goods_list.map((el) => {
  451. item.goods_name = el.goods_vo.name;
  452. item.quantity = el.num;
  453. item.unit = el.product_vo.unit;
  454. return params.value.goods_list.push(item);
  455. });
  456. orderApi.orderSend(id.value, params.value).then(res => {
  457. ElMessage.success("发货成功!");
  458. router.push({ name: 'order' });
  459. })
  460. orderApi.queryLogistics({ shipper_code: params.value.logistics_type, logistic_code: params.value.logistics_code, customer_name: params.value.logistics_phone }).then(res => {
  461. console.log(res);
  462. })
  463. };
  464. const kdsShip = () => {
  465. }
  466. const init = async () => {
  467. try {
  468. const res: any = await orderApi.getSendOrderDetail(id.value);
  469. if (res && res.data && res.data.order_vo && res.data.order_vo.sn) {
  470. await infoApi.skuRedis({ send_order_id: id.value, type: 'enter' }).then((response: any) => {
  471. res.data.order_item_vos.map((el: any) => {
  472. params.value.total_weight = Number(
  473. el.product_vo.weight * el.num
  474. );
  475. el.orderNum = el.num
  476. if (res.data.kdn_order_code == undefined || res.data.kdn_order_code == '') {
  477. el.num = 0
  478. }
  479. Object.keys(response.data).map(item => {
  480. if (el.id == item) {
  481. el.sn_code_list = response.data[item]
  482. el.num = el.sn_code_list.length
  483. }
  484. })
  485. if (!el.sn_code_list) {
  486. el.sn_code_list = []
  487. } else {
  488. /* el.num = el.sn_code_list.length */
  489. }
  490. })
  491. })
  492. barcodeValue.value = res.data.order_vo.sn;
  493. //物品价格
  494. if (res.data.total_volume !== undefined) {
  495. params.value.total_volume = Number(res.data.total_volume)
  496. }
  497. params.value.declared_value = Number(res.data.order_vo.real_price)
  498. res.data.appointment_type = 0
  499. /* 发货人地址 */
  500. const addressLiat = res.data.warehouse_vo.ware_pro_city_area.split(",")
  501. params.value.sender.name = res.data.warehouse_vo.user_name;
  502. params.value.sender.phone = res.data.warehouse_vo.phone;
  503. params.value.sender.province_name = codeToText[addressLiat[0]]
  504. params.value.sender.city_name = codeToText[addressLiat[1]]
  505. params.value.sender.area_name = codeToText[addressLiat[2]]
  506. params.value.sender.address = res.data.warehouse_vo.warehouse_address;
  507. /* 收货地址 */
  508. const receiverList = res.data.order_vo.province_city_area.split(",")
  509. params.value.receiver.name = res.data.order_vo.customer_name;
  510. params.value.receiver.phone = res.data.order_vo.customer_phone;
  511. params.value.receiver.province_name = codeToText[receiverList[0]];
  512. params.value.receiver.city_name = codeToText[receiverList[1]];
  513. params.value.receiver.area_name = codeToText[receiverList[2]];
  514. params.value.receiver.address = res.data.order_vo.address;
  515. shippingForm.value = res.data;
  516. console.log("Barcode value set to:", shippingForm);
  517. } else {
  518. console.error("Invalid response structure:", res);
  519. }
  520. } catch (error) {
  521. console.error("Failed to fetch order details:", error);
  522. }
  523. }
  524. /* 处理客户名称 */
  525. const customerName = (value) => {
  526. if (value && customerList.value && customerList.value.data && customerList.value.data.data) {
  527. const type = customerList.value.data.data.find(type => type.id === value);
  528. return type ? type.name : '';
  529. }
  530. }
  531. /* 仓库名称 */
  532. const warehouseName = (value) => {
  533. if (value && warehouseList.value && warehouseList.value.data) {
  534. const type = warehouseList.value.data.find(type => type.id === value);
  535. return type ? type.name : '';
  536. }
  537. }
  538. /* 支付列表*/
  539. const collectingAccountName = (value) => {
  540. if (value && collectingAccountList.value && collectingAccountList.value.data && collectingAccountList.value.data.data) {
  541. const type = collectingAccountList.value.data.data.find(type => type.id === value);
  542. return type ? type.name : '';
  543. }
  544. }
  545. /* 配送方式*/
  546. const deliveryName = (value) => {
  547. if (value && deliveryList.value && deliveryList.value.data && deliveryList.value.data.data) {
  548. const type = deliveryList.value.data.data.find(type => type.value === value);
  549. return type ? type.label : '';
  550. }
  551. }
  552. /* 订单状态*/
  553. const orderTypeName = (value) => {
  554. if (value && orderTypeList.value && orderTypeList.value.data && orderTypeList.value.data.data) {
  555. const type = orderTypeList.value.data.data.find(type => type.value === value);
  556. return type ? type.label : '';
  557. }
  558. }
  559. /* 获取仓库,字典,客户信息 */
  560. const getInforList = async () => {
  561. warehouseList.value = await infoApi.warehouseList({})//获取仓库列表
  562. customerList.value = await infoApi.customer({})//获取客户列表
  563. collectingAccountList.value = await infoApi.collectingAccount({})//获取支付方式列表
  564. deliveryList.value = await dictionaryAPI.getPage({ dictType: "order_send_type" })//获取配送方式
  565. orderTypeList.value = await dictionaryAPI.getPage({ dictType: "Sale_order_send_status" })//获取订单状态
  566. const expressList: any = await infoApi.getExpressList({//获取物流公司
  567. page_no: 1,
  568. page_size: 9999,
  569. })
  570. deliveryTypeList.value = expressList.data.data
  571. }
  572. </script>
  573. <style scoped>
  574. .text-center {
  575. text-align: center;
  576. }
  577. .my-4 {
  578. margin-top: 1rem;
  579. margin-bottom: 1rem;
  580. }
  581. .mx-auto {
  582. margin-left: auto;
  583. margin-right: auto;
  584. }
  585. .p-4 {
  586. padding: 1rem;
  587. }
  588. .hidden-input .el-input__inner {
  589. width: 0;
  590. padding: 0;
  591. }
  592. </style>