2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
import{d as e,o as t,r as a,j as o,v as n,b as c,c as l,w as r,k as s,m as i,h as u,q as v,A as p,i as m}from"./index-BbaSzr5l.js";import{_ as f}from"./cshaptx4869-scancode.QsVLrHTE.js";import{r as d}from"./uni-app.es.HvolUAn-.js";import{a as h}from"./index.CSYwHWV1.js";import{s as g}from"./function-call.B_SWdK6B.js";import"./_plugin-vue_export-helper.BCo6x5W8.js";const w=e({__name:"w-scanCode",setup(e){t((()=>{}));const w=()=>{window.history.back()},x=()=>{b()},T=a(!1);function b(){T.value=!0}const y=a(),C=a();function j(e){T.value=!1,C.value?(y.value=e,h("/rawFabric/sign",{barcode:y.value,location:C.value},{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then((e=>{if(7778===e.code){let t=JSON.parse(e.msg);console.log(t),g({title:`面料编号为${y.value}的${t.category}已放置在${t.location},是否将面料移动到${C.value}?`,confirmButtonText:"确认"}).then((()=>{h("/rawFabric/sign",{barcode:y.value,location:C.value,force:!0},{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then((e=>{200===e.code?v("入货架成功!"):v(e.msg)}))})).catch((()=>{C.value="",y.value=""}))}else if(7777===e.code){let t=JSON.parse(e.msg);g({title:`面料编号为${y.value}的${t.category}被暂存在检验室,是否确认移动到${C.value}?`,confirmButtonText:"确认"}).then((()=>{h("/rawFabric/sign",{barcode:y.value,location:C.value,force:!0},{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then((e=>{200===e.code?v("入货架成功!"):v(e.msg)}))})).catch((()=>{C.value="",y.value=""}))}else 200===e.code?g({title:"扫码成功,请扫描面料编号",confirmButtonText:"扫一扫"}).then((()=>{b()})).catch((()=>{C.value="",y.value=""})):v(e.msg)}))):(C.value=e,g({title:"扫码成功,请扫描面料编号",confirmButtonText:"扫一扫"}).then((()=>{b()})).catch((()=>{C.value="",y.value=""})))}function F(e){p({title:e.errName,content:e.errMsg,complete:()=>{T.value=!1}})}function $(){T.value=!1}return(e,t)=>{const a=o("van-nav-bar"),v=m,p=d(n("cshaptx4869-scancode"),f);return c(),l(v,null,{default:r((()=>[s(a,{title:"扫码入库","left-text":"返回","left-arrow":"","right-text":"扫一扫",onClickLeft:w,onClickRight:x}),s(v,{style:{"text-align":"center","margin-top":"20px"}},{default:r((()=>[i("请扫描库位码")])),_:1}),T.value?(c(),l(p,{key:0,onSuccess:j,onFail:F,onClose:$})):u("",!0)])),_:1})}}});export{w as default};
|