hs-admin-ui 16.3.3 → 16.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index--u_RqMa4.cjs");const l=require("./index-CcsMo75C.cjs"),u=require("./bcVisual.vue_vue_type_style_index_0_scoped_cae31cec_lang-Kw1ikpRm.cjs");require("vue");const a=require("./index-Bc-mTZe8.cjs");function c(r,e){u.NEXT_NAME.value=e==null?void 0:e.NEXT_NAME,u.IS_DEV.value=e==null?void 0:e.IS_DEV,u.CurrentRoute.value=e==null?void 0:e.currentRoute,u.CurrentRouter.value=e==null?void 0:e.currentRouter,r.directive("loading",u.ElLoading.directive),r.use(l.install)}exports.ElMessage=u.HsMessage;exports.ElMessageBox=u.HsMessageBox;exports.ElNotification=u.HsNotification;exports.mathTool=u.mathTool;exports.Utils=a.index;exports.useHsAdminUi=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index--u_RqMa4.cjs");const l=require("./index-CcsMo75C.cjs"),u=require("./bcVisual.vue_vue_type_style_index_0_scoped_cae31cec_lang-Kw1ikpRm.cjs");require("vue");const a=require("./index-D-3jfV73.cjs");function c(r,e){u.NEXT_NAME.value=e==null?void 0:e.NEXT_NAME,u.IS_DEV.value=e==null?void 0:e.IS_DEV,u.CurrentRoute.value=e==null?void 0:e.currentRoute,u.CurrentRouter.value=e==null?void 0:e.currentRouter,r.directive("loading",u.ElLoading.directive),r.use(l.install)}exports.ElMessage=u.HsMessage;exports.ElMessageBox=u.HsMessageBox;exports.ElNotification=u.HsNotification;exports.mathTool=u.mathTool;exports.Utils=a.index;exports.useHsAdminUi=c;
@@ -3,7 +3,7 @@ import { q as a } from "./index-DRs4JAcv.js";
3
3
  import { aS as u, bp as l, bq as m, br as E, aQ as v } from "./bcVisual.vue_vue_type_style_index_0_scoped_cae31cec_lang-BaDAE2N7.js";
4
4
  import { W as x, bt as M, bu as R, bv as _ } from "./bcVisual.vue_vue_type_style_index_0_scoped_cae31cec_lang-BaDAE2N7.js";
5
5
  import "vue";
6
- import { i as S } from "./index-CxAl2e1Y.js";
6
+ import { i as S } from "./index-BIjdrLax.js";
7
7
  function t(r, e) {
8
8
  u.value = e == null ? void 0 : e.NEXT_NAME, l.value = e == null ? void 0 : e.IS_DEV, m.value = e == null ? void 0 : e.currentRoute, E.value = e == null ? void 0 : e.currentRouter, r.directive("loading", v.directive), r.use(a);
9
9
  }
@@ -555,7 +555,8 @@ function la(t) {
555
555
  data: {
556
556
  titles_json_data: n,
557
557
  data_json_data: o,
558
- template_name: t.template_name
558
+ template_name: t.template_name,
559
+ export_biz_type: t.export_biz_type
559
560
  },
560
561
  timeout: 1e3 * 60 * 20
561
562
  // 二十分钟
@@ -1,4 +1,4 @@
1
- "use strict";const n=require("./bcVisual.vue_vue_type_style_index_0_scoped_cae31cec_lang-Kw1ikpRm.cjs"),D=require("vue");function te(t,e){const a=T(t),l=T(e);let r=0;const s=a.length;for(let o in l)for(let i in a)l[o]===a[i]&&r++;return r===s}function R(t,e){if(!t||!e)return!1;let a=Object.getOwnPropertyNames(t),l=Object.getOwnPropertyNames(e);if(a.length!=l.length)return!1;for(let r=0;r<a.length;r++){let s=a[r],o=t[s],i=e[s];if(!e.hasOwnProperty(s))return!1;if(o instanceof Object){if(!R(o,i))return!1}else if(o!==i)return!1}return!0}function T(t,e){if(Object.keys(t).length)if(e){const a={};return t.reduce((l,r)=>(a[r[e]]||(a[r[e]]=r[e]&&l.push(r)),l),[])}else return[...new Set(t)];else return t}let j="127.0.0.1",O=54321,g;function ne(t,e,a="ws"){return g||(g=new ws(t,e,{automaticOpen:!1,reconnectDecay:1.5,output:"output",protocol:a}),g.onconnecting=function(l){g.log("正与服务器建立连接...",l)},g.onopen=function(l){g.log("与服务器连接成功。",l)},g.onclose=function(l){g.log("与打印服务器的连接已关闭",l)},g.onmessage=function(l){g.log('收到消息!"'+l.data+'"',l);let r=JSON&&JSON.parse(l.data);r.result===1||n.ElMessage.error("Print failed: "+r.message)},g.onerror=function(l){typeof l.detail=="object"?(typeof l.detail.message=="string"&&g.log("遇到一个错误: "+l.detail.message,l),typeof l.detail.data=="string"&&g.log("遇到一个错误: "+l.detail.message,l)):typeof l.data=="string"?g.log("遇到一个错误: "+l.data,l):g.log("遇到一个错误",l)},g)}const P=()=>ne(j,O);function U(){const t=P();return t.open(),new Promise((e,a)=>{t.addEventListener("open",e),t.addEventListener("close",a)})}function k(t){return U().then(()=>{const e=P(),a=function(r,s){e.protocol==="ws"&&(e.setHost(j),e.setPort(O)),e.protocol,e.open()},l=function(r){e.log("SENT: <br/>"+r),e.log("正在发送消息..."),e.send(r)};e.state()!==e.OPEN?(e.log("连接已断开,正在重新连接。"),e.onopen=function(r){e.log("与服务器连接成功。",r),l(t)},a()):l(t)}).catch(()=>{n.ElMessage.warning("请先启动康虎云打印服务器!")})}async function Y(t,e){var v,m,w,S;if(!t.config_info)return n.ElMessage.warning("请先添加模板!"),Promise.reject();const a=JSON.parse(t.config_info)||{};let l=[],r={},s=[],o=[],i=[],c=[];(v=a.formData)==null||v.map(u=>{l.push({type:"str",size:255,name:u.name,required:!1}),u.name==="销售日期"||u.name==="移库日期"||u.name==="申请单单据日期"||u.name==="交易日期"?r[u.name]=e[u.value]?n.hooks(e[u.value]).format("YYYY-MM-DD HH:mm"):"":n._.endsWith(u.name,"日期")||u.name==="有效期"?r[u.name]=e[u.value]?n.hooks(e[u.value]).format("YYYY-MM-DD"):"":n._.endsWith(u.name,"金额")?r[u.name]=n.fixedNumAccuracy(e[u.value]||""):r[u.name]=e[u.value]||""});const d=await n.systemStore.get("userInfo");r.所属公司=d.company_name;const h=((m=e==null?void 0:e.detail)==null?void 0:m.reduce((u,p)=>u+=p.commodity_num||0,0))||0;r.本单合计数量=h,["repayment_sum","arrears_sum","receipt_sum","refunds_sum","payment_sum","amount_sum","apply_sum","payment_app_sum","return_sum_total","return_sum","discount_after_sum","delivery_sum","commodity_sum","contract_sum","sum_of_reject","move_sum","real_amount"].forEach(u=>{if(!e[u])return;let p=n.convertCurrency(e[u]);r.本单合计金额大写=p,r.本单合计金额=e.commodity_sum||e.delivery_sum}),s=((w=a.tableData)==null?void 0:w.map(u=>({type:u.type,size:u.type==="Str"?255:0,name:u.name,required:!1})))||[],o=((S=e==null?void 0:e.detail)==null?void 0:S.map(u=>{var _;let p={};return(_=a.tableData)==null||_.forEach(b=>{n._.endsWith(b.name,"日期")||n._.endsWith(b.name,"时间")||b.name==="有效期至"?p[b.name]=u[b.value]?n.hooks(u[b.value]).format("YYYY-MM-DD"):"":n._.endsWith(b.name,"金额")?p[b.name]=n.fixedNumAccuracy(u[b.value]||""):p[b.name]=u[b.value]||""}),p}))||[],e.other_information&&(i=a.otherData.map(u=>({type:u.type,size:u.type==="Str"?255:0,name:u.name,required:!1})),c=e.other_information.map(u=>{let p={};return a.otherData.forEach(_=>{p[_.name]=u[_.value]||""}),p}));const y={template:`base64:${t.template_base64}`,ver:4,Copies:t.copies,Duplex:t.duplex||0,Printer:t.printer?JSON.parse(t.printer).default:"",Design:t.design||0,PageTop:t.page_top||10,PageLeft:t.page_left||10,Preview:t.preview,Tables:[{Name:"表单信息",Cols:l,Data:[r]},{Name:"销售配车单",Cols:s,Data:o.length?o:[{}]}]};return i.length&&y.Tables.push({Name:"其他信息",Cols:i,Data:c.length?c:[{}]}),y}function le(t){return new Promise((e,a)=>{try{let l=document.createElement("canvas"),r=l.getContext("2d"),s=new Image;s.setAttribute("crossOrigin","anonymous"),s.src=t,s.onload=function(){l.height=s.height,l.width=s.width,r.drawImage(s,0,0);let o=l.toDataURL("image/jpeg",1);l=null,e("base64/jpeg:"+o.split(",")[1])}}catch{a("")}})}async function re(t,e){const a=await n.systemStore.get("userInfo"),l=await n.request({url:`/${a.project_code}-web/pri/print_template/get_template_by_code`,method:"get",params:{template_code:t}}).then(s=>n._.get(s,"data",{}));e||(e={detail:[]});const r=await Y(l,e);return k(JSON.stringify(r))}const ae=t=>({toClipboard(e,a){return new Promise((l,r)=>{const s=document.createElement("button"),o=new n.Clipboard(s,{text:()=>e,action:()=>"copy",container:a!==void 0?a:document.body});o.on("success",i=>{o.destroy(),l(i)}),o.on("error",i=>{o.destroy(),r(i)}),document.body.appendChild(s),s.click(),document.body.removeChild(s)})}}),$=t=>new Promise((e,a)=>{try{ae().toClipboard(t),n.ElMessage.success("复制成功!"),e(t)}catch(l){n.ElMessage.error("复制失败!"),a(l)}});function F(t,e,a=["id"]){for(let l in e)Object.keys(t).includes(l)?typeof e[l]=="object"&&!Array.isArray(e[l])?F(t[l],e[l]):t[l]=e[l]:a.includes(l)&&(t[l]=e[l]);return t}function oe(t){const e=D.ref(!1),a=()=>{e.value=n.screenfull.isFullscreen};n.screenfull.on("change",a);function l(){if(!n.screenfull.isEnabled)return n.ElMessage.warning("暂不不支持全屏"),!1;n.screenfull.toggle(t)}return D.onBeforeUnmount(()=>{n.screenfull.off("change",a)}),{isFullPage:e,toggle:l}}function C(t,e){if(!t)return"";let a=t.getDay(),l=K(t),r=Math.floor((t.getMonth()+3)/3).toString();const s={"Y+":t.getFullYear().toString(),"m+":(t.getMonth()+1).toString(),"d+":t.getDate().toString(),"H+":t.getHours().toString(),"M+":t.getMinutes().toString(),"S+":t.getSeconds().toString(),"q+":r},o={0:"日",1:"一",2:"二",3:"三",4:"四",5:"五",6:"六"},i={1:"一",2:"二",3:"三",4:"四"};/(W+)/.test(e)&&(e=e.replace(RegExp.$1,RegExp.$1.length>1?RegExp.$1.length>2?"星期"+o[a]:"周"+o[a]:o[a])),/(Q+)/.test(e)&&(e=e.replace(RegExp.$1,RegExp.$1.length==4?"第"+i[r]+"季度":i[r])),/(Z+)/.test(e)&&(e=e.replace(RegExp.$1,RegExp.$1.length==3?"第"+l+"周":l+""));for(let c in s){let d=new RegExp("("+c+")").exec(e);d&&(e=e.replace(d[1],RegExp.$1.length==1?s[c]:s[c].padStart(RegExp.$1.length,"0")))}return e}function K(t){let e=new Date(t.getTime()),a=e.getDay()||7;e.setDate(e.getDate()-a+1+5);let l=new Date(e.getFullYear(),0,1),r=l.getDay(),s=1;r!=0&&(s=7-r+1),l=new Date(e.getFullYear(),0,1+s);let o=Math.ceil((e.valueOf()-l.valueOf())/864e5);return Math.ceil(o/7)}function se(t,e="YYYY-mm-dd"){let a,l,r=new Date().getTime();if(typeof t=="string"||typeof t=="object"?a=new Date(t).getTime():a=t,r=Number.parseInt(`${r-a}`),r<1e4)return"刚刚";if(r<6e4&&r>=1e4)return l=Math.floor(r/1e3),`${l}秒前`;if(r<36e5&&r>=6e4)return l=Math.floor(r/6e4),`${l}分钟前`;if(r<864e5&&r>=36e5)return l=Math.floor(r/36e5),`${l}小时前`;if(r<2592e5&&r>=864e5)return l=Math.floor(r/864e5),`${l}天前`;{let s=t;return(typeof t=="string"||typeof t=="object")&&(s=new Date(t)),C(s,e)}}function ie(t){let e=new Date(t).getHours();return e<6?"凌晨好":e<9?"早上好":e<12?"上午好":e<14?"中午好":e<17?"下午好":e<19?"傍晚好":e<22?"晚上好":"夜里好"}const ue=(t,e,a)=>a?`${a}%`:"-",ce=(t,e,a)=>a?C(new Date(a),"YYYY-mm-dd"):"-",de=(t,e,a)=>a?C(new Date(a),"YYYY-mm-dd HH:MM:SS"):"-",fe=(t,e,a)=>{if(!a)return"-";let l=0;return typeof t=="number"&&(l=t),typeof a=="number"&&(l=a),C(new Date(l*1e3),"HH:MM:SS")},ge=(t="0",e=4)=>Number.parseFloat(t).toFixed(e),me=(t="0")=>Number.parseFloat(t).toFixed(2),pe=t=>{let e=t&&t.toUpperCase();const a={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外 "};let l="",r=!0;if(!e||!/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(e))l="身份证号格式错误",r=!1;else if(!a[e.substr(0,2)])l="身份证地址编码错误",r=!1;else if(e.length==18){e=e.split("");for(var s=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],o=[1,0,"X",9,8,7,6,5,4,3,2],i=0,c=0,d=0,h=0;h<17;h++)c=e[h],d=s[h],i+=c*d;o[i%11],o[i%11]!=e[17]&&(l="身份证校验位错误",r=!1)}return{tip:l,pass:r}},ye=(t,e,a)=>{e=e||"hskj20180614java",a=a||"hskj20180614java";let l=n.CryptoJS.enc.Utf8.parse(e),r=n.CryptoJS.enc.Utf8.parse(a),s=n.CryptoJS.enc.Utf8.parse(t),o=n.CryptoJS.AES.encrypt(s,l,{iv:r,mode:n.CryptoJS.mode.CBC,padding:n.CryptoJS.pad.ZeroPadding});return n.CryptoJS.enc.Base64.stringify(o.ciphertext)},be=(t,e,a)=>{e=e||"hskj20180614java",a=a||"hskj20180614java";var l=n.CryptoJS.enc.Utf8.parse(e);let r=n.CryptoJS.enc.Utf8.parse(a);var s=n.CryptoJS.AES.decrypt(t,l,{iv:r,mode:n.CryptoJS.mode.CBC,padding:n.CryptoJS.pad.ZeroPadding});return n.CryptoJS.enc.Base64.stringify(s.ciphertext)};function H({uniqueId:t,projectCode:e,templateName:a,tableConfig:l,tableData:r}){const s=[];if(l.filter(d=>n.isShowItem({...d.data,uniqueId:t})).map(d=>d.data).filter(d=>d.fieldExport==!0).forEach(d=>{n.specialType.includes(d.type)||s.push(d)}),n._.isEmpty(s))return n.ElMessage.warning("未配置导出字段"),Promise.reject();const o=c({templateArr:s,tableData:r});return i({template_name:a,...o},e);async function i(d,h){return n.request({url:`/${h}-web/pub/excel/export_model_assign`,responseType:"blob",method:"post",data:d,timeout:1e3*60*20}).then(f=>{const y=new Blob([f],{type:"application/vnd.ms-excel"}),v=d.template_name?d.template_name:new Date().getTime().toString();let m=document.createElement("a");return m.href=URL.createObjectURL(y),m.download=v+".xlsx",document.body.appendChild(m),m.click(),document.body.removeChild(m),f})}function c({templateArr:d,tableData:h}){const f={序号:"A"},y=[],v=[],m=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AK","AL","AM","AN","AO","AP","AQ","AR","AS","AT","AU","AV","AW","AX","AY","AZ","BA","BB","BC","BD","BE","BF","BG","BH","BI","BJ","BK","BL","BM","BN","BO","BP","BQ","BR","BS","BT","BU","BV","BW","BX","BY","BZ"];let w="";d.forEach((u,p)=>{f[u.title]=m[p+1],v.push(u.field)}),h.forEach((u,p)=>{let _={A:p+1};v.forEach((b,ee)=>{_[m[ee+1]]=S(u[b])}),y.push(_)});function S(u){return u=="1"?"开启":u=="0"?"关闭":u}return{titles_json_data:JSON.stringify(f),infoData_json_data:JSON.stringify(y),isNumerical:w}}}function J(t){return new Promise((e,a)=>{const l={},r=t.columnConfig.filter(o=>n.isShowItem({...o.data,uniqueId:t.uniqueId})).map(o=>o.data).filter(o=>o.fieldExport==!0).map(o=>(Object.keys(o).forEach(i=>{const c=i;typeof o[c]=="function"&&(l[o.field]||(l[o.field]=[]),l[o.field].push(o[c]))}),{fieldName:o.field,title:o.title}));if(n._.isEmpty(r))return n.ElMessage.warning("未配置导出字段"),a();const s=t.data.map(o=>(Object.keys(l).forEach(i=>{var c;(c=l[i])==null||c.forEach(d=>{o[`_old_${i}`]=o[`_old_${i}`]||o[i],o[i]=o[`_old_${i}`],o[i]=d({row:o,column:{field:i}})||""})}),o));return n.request({url:`/${t.projectCode}-web/pri/easyexcel/export_model_assign`,responseType:"blob",method:"post",data:{titles_json_data:r,data_json_data:s,template_name:t.template_name},timeout:1e3*60*20}).then(o=>{e();const i=new Blob([o],{type:"application/vnd.ms-excel"});B(i,t.template_name+".xlsx")})})}function q(t,e="/pri/easyexcel/export_model_all"){return new Promise((a,l)=>{const r=t.columnConfig.filter(f=>n.isShowItem({...f.data,uniqueId:t.uniqueId})).map(f=>f.data).filter(f=>f.fieldExport==!0).map(f=>{var v;let y=f.field;if(typeof f.formatter=="function"){const m=(v=f.formatter_2)==null?void 0:v.match(new RegExp("(?<=row\\.)(\\w+)","g"));y=m?String(m):f.field}return{fieldName:y,title:f.title}});if(n._.isEmpty(r))return n.ElMessage.warning("未配置导出字段"),l();let i=(n.getOrderQueryData(t.uniqueId)||{})[`${n.QUERY_GROUP_TIP}${t.tableId}`]||{};for(let f in t.search_json_data)(t.search_json_data[f]||t.search_json_data[f]===0)&&(i[f]=t.search_json_data[f]);const c={titles_json_data:r,search_json_data:i,template_name:t.template_name,export_biz_type:t.export_biz_type},d=Object.keys(i).filter(f=>f.startsWith("_")).map(f=>{const[y,v,m]=f.split("|");return{type:y.slice(1),key:v,code:m,value:i[f]}});d.length>0&&(c.qry_json_data=JSON.stringify(d));const h=t.projectCode.replace("-web","");return n.request({url:`/${h}-web${e}`,responseType:"blob",method:"post",data:c,timeout:1e3*60*20}).then(f=>{a();const y=new Blob([f],{type:"application/vnd.ms-excel"});B(y,t.template_name+".xlsx")})})}function W(t){const e=document.createElement("a");e.href=t.url,e.download=t.name,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}function B(t,e){let a=document.createElement("a");a.href=window.URL.createObjectURL(t),a.download=/\./.test(e)?e:e+".xlsx",document.body.appendChild(a),a.click(),document.body.removeChild(a)}function z(t){const[e="",a=""]=t.split(","),l=e.match(/:(.*?);/)[1],r=atob(a);let s=r.length,o=new Uint8Array(s);for(;s--;)o[s]=r.charCodeAt(s);return new Blob([o],{type:l})}const he={start:()=>{const t=document.body,e=document.createElement("div");e.setAttribute("class","loading-next");const a=`
1
+ "use strict";const n=require("./bcVisual.vue_vue_type_style_index_0_scoped_cae31cec_lang-Kw1ikpRm.cjs"),D=require("vue");function te(t,e){const a=T(t),l=T(e);let r=0;const s=a.length;for(let o in l)for(let i in a)l[o]===a[i]&&r++;return r===s}function R(t,e){if(!t||!e)return!1;let a=Object.getOwnPropertyNames(t),l=Object.getOwnPropertyNames(e);if(a.length!=l.length)return!1;for(let r=0;r<a.length;r++){let s=a[r],o=t[s],i=e[s];if(!e.hasOwnProperty(s))return!1;if(o instanceof Object){if(!R(o,i))return!1}else if(o!==i)return!1}return!0}function T(t,e){if(Object.keys(t).length)if(e){const a={};return t.reduce((l,r)=>(a[r[e]]||(a[r[e]]=r[e]&&l.push(r)),l),[])}else return[...new Set(t)];else return t}let j="127.0.0.1",O=54321,g;function ne(t,e,a="ws"){return g||(g=new ws(t,e,{automaticOpen:!1,reconnectDecay:1.5,output:"output",protocol:a}),g.onconnecting=function(l){g.log("正与服务器建立连接...",l)},g.onopen=function(l){g.log("与服务器连接成功。",l)},g.onclose=function(l){g.log("与打印服务器的连接已关闭",l)},g.onmessage=function(l){g.log('收到消息!"'+l.data+'"',l);let r=JSON&&JSON.parse(l.data);r.result===1||n.ElMessage.error("Print failed: "+r.message)},g.onerror=function(l){typeof l.detail=="object"?(typeof l.detail.message=="string"&&g.log("遇到一个错误: "+l.detail.message,l),typeof l.detail.data=="string"&&g.log("遇到一个错误: "+l.detail.message,l)):typeof l.data=="string"?g.log("遇到一个错误: "+l.data,l):g.log("遇到一个错误",l)},g)}const P=()=>ne(j,O);function U(){const t=P();return t.open(),new Promise((e,a)=>{t.addEventListener("open",e),t.addEventListener("close",a)})}function k(t){return U().then(()=>{const e=P(),a=function(r,s){e.protocol==="ws"&&(e.setHost(j),e.setPort(O)),e.protocol,e.open()},l=function(r){e.log("SENT: <br/>"+r),e.log("正在发送消息..."),e.send(r)};e.state()!==e.OPEN?(e.log("连接已断开,正在重新连接。"),e.onopen=function(r){e.log("与服务器连接成功。",r),l(t)},a()):l(t)}).catch(()=>{n.ElMessage.warning("请先启动康虎云打印服务器!")})}async function Y(t,e){var v,m,w,S;if(!t.config_info)return n.ElMessage.warning("请先添加模板!"),Promise.reject();const a=JSON.parse(t.config_info)||{};let l=[],r={},s=[],o=[],i=[],c=[];(v=a.formData)==null||v.map(u=>{l.push({type:"str",size:255,name:u.name,required:!1}),u.name==="销售日期"||u.name==="移库日期"||u.name==="申请单单据日期"||u.name==="交易日期"?r[u.name]=e[u.value]?n.hooks(e[u.value]).format("YYYY-MM-DD HH:mm"):"":n._.endsWith(u.name,"日期")||u.name==="有效期"?r[u.name]=e[u.value]?n.hooks(e[u.value]).format("YYYY-MM-DD"):"":n._.endsWith(u.name,"金额")?r[u.name]=n.fixedNumAccuracy(e[u.value]||""):r[u.name]=e[u.value]||""});const d=await n.systemStore.get("userInfo");r.所属公司=d.company_name;const h=((m=e==null?void 0:e.detail)==null?void 0:m.reduce((u,p)=>u+=p.commodity_num||0,0))||0;r.本单合计数量=h,["repayment_sum","arrears_sum","receipt_sum","refunds_sum","payment_sum","amount_sum","apply_sum","payment_app_sum","return_sum_total","return_sum","discount_after_sum","delivery_sum","commodity_sum","contract_sum","sum_of_reject","move_sum","real_amount"].forEach(u=>{if(!e[u])return;let p=n.convertCurrency(e[u]);r.本单合计金额大写=p,r.本单合计金额=e.commodity_sum||e.delivery_sum}),s=((w=a.tableData)==null?void 0:w.map(u=>({type:u.type,size:u.type==="Str"?255:0,name:u.name,required:!1})))||[],o=((S=e==null?void 0:e.detail)==null?void 0:S.map(u=>{var _;let p={};return(_=a.tableData)==null||_.forEach(b=>{n._.endsWith(b.name,"日期")||n._.endsWith(b.name,"时间")||b.name==="有效期至"?p[b.name]=u[b.value]?n.hooks(u[b.value]).format("YYYY-MM-DD"):"":n._.endsWith(b.name,"金额")?p[b.name]=n.fixedNumAccuracy(u[b.value]||""):p[b.name]=u[b.value]||""}),p}))||[],e.other_information&&(i=a.otherData.map(u=>({type:u.type,size:u.type==="Str"?255:0,name:u.name,required:!1})),c=e.other_information.map(u=>{let p={};return a.otherData.forEach(_=>{p[_.name]=u[_.value]||""}),p}));const y={template:`base64:${t.template_base64}`,ver:4,Copies:t.copies,Duplex:t.duplex||0,Printer:t.printer?JSON.parse(t.printer).default:"",Design:t.design||0,PageTop:t.page_top||10,PageLeft:t.page_left||10,Preview:t.preview,Tables:[{Name:"表单信息",Cols:l,Data:[r]},{Name:"销售配车单",Cols:s,Data:o.length?o:[{}]}]};return i.length&&y.Tables.push({Name:"其他信息",Cols:i,Data:c.length?c:[{}]}),y}function le(t){return new Promise((e,a)=>{try{let l=document.createElement("canvas"),r=l.getContext("2d"),s=new Image;s.setAttribute("crossOrigin","anonymous"),s.src=t,s.onload=function(){l.height=s.height,l.width=s.width,r.drawImage(s,0,0);let o=l.toDataURL("image/jpeg",1);l=null,e("base64/jpeg:"+o.split(",")[1])}}catch{a("")}})}async function re(t,e){const a=await n.systemStore.get("userInfo"),l=await n.request({url:`/${a.project_code}-web/pri/print_template/get_template_by_code`,method:"get",params:{template_code:t}}).then(s=>n._.get(s,"data",{}));e||(e={detail:[]});const r=await Y(l,e);return k(JSON.stringify(r))}const ae=t=>({toClipboard(e,a){return new Promise((l,r)=>{const s=document.createElement("button"),o=new n.Clipboard(s,{text:()=>e,action:()=>"copy",container:a!==void 0?a:document.body});o.on("success",i=>{o.destroy(),l(i)}),o.on("error",i=>{o.destroy(),r(i)}),document.body.appendChild(s),s.click(),document.body.removeChild(s)})}}),$=t=>new Promise((e,a)=>{try{ae().toClipboard(t),n.ElMessage.success("复制成功!"),e(t)}catch(l){n.ElMessage.error("复制失败!"),a(l)}});function F(t,e,a=["id"]){for(let l in e)Object.keys(t).includes(l)?typeof e[l]=="object"&&!Array.isArray(e[l])?F(t[l],e[l]):t[l]=e[l]:a.includes(l)&&(t[l]=e[l]);return t}function oe(t){const e=D.ref(!1),a=()=>{e.value=n.screenfull.isFullscreen};n.screenfull.on("change",a);function l(){if(!n.screenfull.isEnabled)return n.ElMessage.warning("暂不不支持全屏"),!1;n.screenfull.toggle(t)}return D.onBeforeUnmount(()=>{n.screenfull.off("change",a)}),{isFullPage:e,toggle:l}}function C(t,e){if(!t)return"";let a=t.getDay(),l=K(t),r=Math.floor((t.getMonth()+3)/3).toString();const s={"Y+":t.getFullYear().toString(),"m+":(t.getMonth()+1).toString(),"d+":t.getDate().toString(),"H+":t.getHours().toString(),"M+":t.getMinutes().toString(),"S+":t.getSeconds().toString(),"q+":r},o={0:"日",1:"一",2:"二",3:"三",4:"四",5:"五",6:"六"},i={1:"一",2:"二",3:"三",4:"四"};/(W+)/.test(e)&&(e=e.replace(RegExp.$1,RegExp.$1.length>1?RegExp.$1.length>2?"星期"+o[a]:"周"+o[a]:o[a])),/(Q+)/.test(e)&&(e=e.replace(RegExp.$1,RegExp.$1.length==4?"第"+i[r]+"季度":i[r])),/(Z+)/.test(e)&&(e=e.replace(RegExp.$1,RegExp.$1.length==3?"第"+l+"周":l+""));for(let c in s){let d=new RegExp("("+c+")").exec(e);d&&(e=e.replace(d[1],RegExp.$1.length==1?s[c]:s[c].padStart(RegExp.$1.length,"0")))}return e}function K(t){let e=new Date(t.getTime()),a=e.getDay()||7;e.setDate(e.getDate()-a+1+5);let l=new Date(e.getFullYear(),0,1),r=l.getDay(),s=1;r!=0&&(s=7-r+1),l=new Date(e.getFullYear(),0,1+s);let o=Math.ceil((e.valueOf()-l.valueOf())/864e5);return Math.ceil(o/7)}function se(t,e="YYYY-mm-dd"){let a,l,r=new Date().getTime();if(typeof t=="string"||typeof t=="object"?a=new Date(t).getTime():a=t,r=Number.parseInt(`${r-a}`),r<1e4)return"刚刚";if(r<6e4&&r>=1e4)return l=Math.floor(r/1e3),`${l}秒前`;if(r<36e5&&r>=6e4)return l=Math.floor(r/6e4),`${l}分钟前`;if(r<864e5&&r>=36e5)return l=Math.floor(r/36e5),`${l}小时前`;if(r<2592e5&&r>=864e5)return l=Math.floor(r/864e5),`${l}天前`;{let s=t;return(typeof t=="string"||typeof t=="object")&&(s=new Date(t)),C(s,e)}}function ie(t){let e=new Date(t).getHours();return e<6?"凌晨好":e<9?"早上好":e<12?"上午好":e<14?"中午好":e<17?"下午好":e<19?"傍晚好":e<22?"晚上好":"夜里好"}const ue=(t,e,a)=>a?`${a}%`:"-",ce=(t,e,a)=>a?C(new Date(a),"YYYY-mm-dd"):"-",de=(t,e,a)=>a?C(new Date(a),"YYYY-mm-dd HH:MM:SS"):"-",fe=(t,e,a)=>{if(!a)return"-";let l=0;return typeof t=="number"&&(l=t),typeof a=="number"&&(l=a),C(new Date(l*1e3),"HH:MM:SS")},ge=(t="0",e=4)=>Number.parseFloat(t).toFixed(e),me=(t="0")=>Number.parseFloat(t).toFixed(2),pe=t=>{let e=t&&t.toUpperCase();const a={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外 "};let l="",r=!0;if(!e||!/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(e))l="身份证号格式错误",r=!1;else if(!a[e.substr(0,2)])l="身份证地址编码错误",r=!1;else if(e.length==18){e=e.split("");for(var s=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],o=[1,0,"X",9,8,7,6,5,4,3,2],i=0,c=0,d=0,h=0;h<17;h++)c=e[h],d=s[h],i+=c*d;o[i%11],o[i%11]!=e[17]&&(l="身份证校验位错误",r=!1)}return{tip:l,pass:r}},ye=(t,e,a)=>{e=e||"hskj20180614java",a=a||"hskj20180614java";let l=n.CryptoJS.enc.Utf8.parse(e),r=n.CryptoJS.enc.Utf8.parse(a),s=n.CryptoJS.enc.Utf8.parse(t),o=n.CryptoJS.AES.encrypt(s,l,{iv:r,mode:n.CryptoJS.mode.CBC,padding:n.CryptoJS.pad.ZeroPadding});return n.CryptoJS.enc.Base64.stringify(o.ciphertext)},be=(t,e,a)=>{e=e||"hskj20180614java",a=a||"hskj20180614java";var l=n.CryptoJS.enc.Utf8.parse(e);let r=n.CryptoJS.enc.Utf8.parse(a);var s=n.CryptoJS.AES.decrypt(t,l,{iv:r,mode:n.CryptoJS.mode.CBC,padding:n.CryptoJS.pad.ZeroPadding});return n.CryptoJS.enc.Base64.stringify(s.ciphertext)};function H({uniqueId:t,projectCode:e,templateName:a,tableConfig:l,tableData:r}){const s=[];if(l.filter(d=>n.isShowItem({...d.data,uniqueId:t})).map(d=>d.data).filter(d=>d.fieldExport==!0).forEach(d=>{n.specialType.includes(d.type)||s.push(d)}),n._.isEmpty(s))return n.ElMessage.warning("未配置导出字段"),Promise.reject();const o=c({templateArr:s,tableData:r});return i({template_name:a,...o},e);async function i(d,h){return n.request({url:`/${h}-web/pub/excel/export_model_assign`,responseType:"blob",method:"post",data:d,timeout:1e3*60*20}).then(f=>{const y=new Blob([f],{type:"application/vnd.ms-excel"}),v=d.template_name?d.template_name:new Date().getTime().toString();let m=document.createElement("a");return m.href=URL.createObjectURL(y),m.download=v+".xlsx",document.body.appendChild(m),m.click(),document.body.removeChild(m),f})}function c({templateArr:d,tableData:h}){const f={序号:"A"},y=[],v=[],m=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AK","AL","AM","AN","AO","AP","AQ","AR","AS","AT","AU","AV","AW","AX","AY","AZ","BA","BB","BC","BD","BE","BF","BG","BH","BI","BJ","BK","BL","BM","BN","BO","BP","BQ","BR","BS","BT","BU","BV","BW","BX","BY","BZ"];let w="";d.forEach((u,p)=>{f[u.title]=m[p+1],v.push(u.field)}),h.forEach((u,p)=>{let _={A:p+1};v.forEach((b,ee)=>{_[m[ee+1]]=S(u[b])}),y.push(_)});function S(u){return u=="1"?"开启":u=="0"?"关闭":u}return{titles_json_data:JSON.stringify(f),infoData_json_data:JSON.stringify(y),isNumerical:w}}}function J(t){return new Promise((e,a)=>{const l={},r=t.columnConfig.filter(o=>n.isShowItem({...o.data,uniqueId:t.uniqueId})).map(o=>o.data).filter(o=>o.fieldExport==!0).map(o=>(Object.keys(o).forEach(i=>{const c=i;typeof o[c]=="function"&&(l[o.field]||(l[o.field]=[]),l[o.field].push(o[c]))}),{fieldName:o.field,title:o.title}));if(n._.isEmpty(r))return n.ElMessage.warning("未配置导出字段"),a();const s=t.data.map(o=>(Object.keys(l).forEach(i=>{var c;(c=l[i])==null||c.forEach(d=>{o[`_old_${i}`]=o[`_old_${i}`]||o[i],o[i]=o[`_old_${i}`],o[i]=d({row:o,column:{field:i}})||""})}),o));return n.request({url:`/${t.projectCode}-web/pri/easyexcel/export_model_assign`,responseType:"blob",method:"post",data:{titles_json_data:r,data_json_data:s,template_name:t.template_name,export_biz_type:t.export_biz_type},timeout:1e3*60*20}).then(o=>{e();const i=new Blob([o],{type:"application/vnd.ms-excel"});B(i,t.template_name+".xlsx")})})}function q(t,e="/pri/easyexcel/export_model_all"){return new Promise((a,l)=>{const r=t.columnConfig.filter(f=>n.isShowItem({...f.data,uniqueId:t.uniqueId})).map(f=>f.data).filter(f=>f.fieldExport==!0).map(f=>{var v;let y=f.field;if(typeof f.formatter=="function"){const m=(v=f.formatter_2)==null?void 0:v.match(new RegExp("(?<=row\\.)(\\w+)","g"));y=m?String(m):f.field}return{fieldName:y,title:f.title}});if(n._.isEmpty(r))return n.ElMessage.warning("未配置导出字段"),l();let i=(n.getOrderQueryData(t.uniqueId)||{})[`${n.QUERY_GROUP_TIP}${t.tableId}`]||{};for(let f in t.search_json_data)(t.search_json_data[f]||t.search_json_data[f]===0)&&(i[f]=t.search_json_data[f]);const c={titles_json_data:r,search_json_data:i,template_name:t.template_name,export_biz_type:t.export_biz_type},d=Object.keys(i).filter(f=>f.startsWith("_")).map(f=>{const[y,v,m]=f.split("|");return{type:y.slice(1),key:v,code:m,value:i[f]}});d.length>0&&(c.qry_json_data=JSON.stringify(d));const h=t.projectCode.replace("-web","");return n.request({url:`/${h}-web${e}`,responseType:"blob",method:"post",data:c,timeout:1e3*60*20}).then(f=>{a();const y=new Blob([f],{type:"application/vnd.ms-excel"});B(y,t.template_name+".xlsx")})})}function W(t){const e=document.createElement("a");e.href=t.url,e.download=t.name,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}function B(t,e){let a=document.createElement("a");a.href=window.URL.createObjectURL(t),a.download=/\./.test(e)?e:e+".xlsx",document.body.appendChild(a),a.click(),document.body.removeChild(a)}function z(t){const[e="",a=""]=t.split(","),l=e.match(/:(.*?);/)[1],r=atob(a);let s=r.length,o=new Uint8Array(s);for(;s--;)o[s]=r.charCodeAt(s);return new Blob([o],{type:l})}const he={start:()=>{const t=document.body,e=document.createElement("div");e.setAttribute("class","loading-next");const a=`
2
2
  <div class="loading-next-box">
3
3
  <div class="loading-next-box-warp">
4
4
  <div class="loading-next-box-item"></div>