import{d as t,o as e,r as a,j as n,x as o,b as s,c as l,w as c,k as r,m as i,t as p,h as u,q as d,B as f,i as v}from"./index-D2NElrYl.js";import{_ as m}from"./cshaptx4869-scancode.C5bz-F02.js";import{r as x}from"./uni-app.es.CyjALRV_.js";import{a as h,g as w}from"./index.Cv2D9Hyi.js";import{s as g}from"./function-call.DSHj1ZhI.js";import{_ as y}from"./_plugin-vue_export-helper.BCo6x5W8.js";const b=y(t({__name:"w-scanCode",setup(t){e((()=>{}));const y=()=>{window.history.back()},b=()=>{T()},_=a(!1);function T(){_.value=!0}const $=a(),z=a();function C(t){_.value=!1,z.value?($.value=t,h("/rawFabric/sign",{barcode:$.value,location:z.value},{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then((t=>{if(7778===t.code){let e=JSON.parse(t.msg);if(e.location==z.value)g({message:"该面料已放置在"+e.location+",请勿重复扫码",allowHtml:!0,confirmButtonText:"扫一扫"}).then((()=>{T()})).catch((()=>{z.value="",$.value=""}));else{let t=`\n\t\t\t\t\t\t\t\t\t\t\t
面料编号:${$.value}
\n\t\t\t\t\t\t\t\t\t\t\t面料名称:${e.category}
\n\t\t\t\t\t\t\t\t\t\t\t面料位置:${e.location}
\n\t\t\t\t\t\t\t\t\t\t\t是否将面料移动到${z.value}?
\n\t\t\t\t\t\t\t\t\t\t\t面料编号为${$.value}的${e.category}被暂存在检验室,是否确认移动到${z.value}?
\n\t\t\t `;g({message:a,allowHtml:!0,confirmButtonText:"确认"}).then((()=>{h("/rawFabric/sign",{barcode:$.value,location:z.value,force:!0},{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}).then((t=>{200===t.code?d("入货架成功!"):d(t.msg)}))})).catch((()=>{z.value="",$.value=""}))}else if(200===t.code){let e=`\n\t\t\t\t\t面料编号:${$.value}
\n\t\t\t\t\t面料名称:${t.data}
\n\t\t\t\t\t`;g({title:"扫码成功!",message:e,allowHtml:!0,confirmButtonText:"扫一扫"}).then((()=>{T()})).catch((()=>{z.value="",$.value=""}))}else d(t.msg)}))):w("/shelves/isActive?code="+t).then((e=>{if(200===e.code)if(e.data.active){z.value=t;let a="";e.data.recommend.forEach((t=>{a+=`\n\t\t\t\t\t\t\t