Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
electron-printer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhuzhequan
electron-printer
Commits
495695bd
Commit
495695bd
authored
Mar 05, 2025
by
zhuzhequan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
转为工厂端
parent
a7b73f94
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
384 additions
and
639 deletions
+384
-639
config/env.json
+5
-0
src/background.js
+2
-1
src/server/entity/function.js
+53
-59
src/server/routes/index.js
+1
-1
src/server/utils/index.js
+7
-12
src/server/utils/log.js
+0
-7
src/utils/axios.js
+0
-2
src/views/design/detail/index.vue
+180
-245
src/views/design/head/index.vue
+65
-84
src/views/design/head/printDialog.vue
+10
-7
src/views/design/index.vue
+1
-3
src/views/design/main/imgSetting.vue
+4
-2
src/views/design/main/index.vue
+20
-23
src/views/design/updateDialog.vue
+1
-1
src/views/login/index.vue
+31
-192
vue.config.js
+4
-0
No files found.
config/env.json
0 → 100644
View file @
495695bd
{
"apiApiHost"
:
"https://factory.jomalls.com/api"
,
"fileApiUrl"
:
"https://factory.jomalls.com/upload/factory"
,
"visionUrl"
:
"https://console.jomalls.com"
}
src/background.js
View file @
495695bd
...
@@ -77,8 +77,9 @@ async function createWindow() {
...
@@ -77,8 +77,9 @@ async function createWindow() {
});
});
win
.
on
(
"closed"
,
()
=>
{
win
.
on
(
"closed"
,
()
=>
{
win
.
removeAllListeners
();
win
&&
win
.
removeAllListeners
();
win
=
null
;
win
=
null
;
newWindow
&&
newWindow
.
close
()
newWindow
=
null
;
newWindow
=
null
;
});
});
...
...
src/server/entity/function.js
View file @
495695bd
import
{
downloadImage
,
toSend
,
writeProfileXml
}
from
"@/server/utils"
;
import
{
downloadImage
,
toSend
,
writeProfileXml
}
from
"@/server/utils"
;
import
axios
from
"axios"
;
import
{
returnLogFilePath
}
from
"../utils/log"
;
var
request
=
require
(
"request"
);
var
request
=
require
(
"request"
);
const
compressing
=
require
(
"compressing"
);
const
compressing
=
require
(
"compressing"
);
const
uuid
=
require
(
"uuid"
);
const
uuid
=
require
(
"uuid"
);
const
path
=
require
(
"path"
);
const
path
=
require
(
"path"
);
const
fs
=
require
(
"fs"
);
const
fs
=
require
(
"fs"
);
const
os
=
require
(
"os"
);
const
os
=
require
(
"os"
);
import
axios
from
"axios"
;
const
{
app
}
=
require
(
"electron"
);
import
{
returnLogFilePath
}
from
"../utils/log"
;
let
fileEnv
,
env
,
visionUrl
;
axios
.
defaults
.
timeout
=
12600000
;
axios
.
defaults
.
timeout
=
12600000
;
const
multiparty
=
require
(
"multiparty"
);
const
multiparty
=
require
(
"multiparty"
);
function
readEnv
()
{
let
exePath
,
configPath
if
(
process
.
env
.
NODE_ENV
===
"development"
)
{
configPath
=
path
.
join
(
__dirname
,
"../config/env.json"
);
}
else
{
exePath
=
path
.
dirname
(
app
.
getPath
(
"exe"
)).
replace
(
/
\\
/g
,
"/"
);
configPath
=
`
${
exePath
}
/config/env.json`
;
}
console
.
log
(
configPath
,
__dirname
);
fs
.
readFile
(
configPath
,
"utf-8"
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
"读取配置文件失败:"
,
err
);
return
;
}
const
config
=
JSON
.
parse
(
data
);
fileEnv
=
config
.
fileApiUrl
;
env
=
config
.
apiApiHost
;
visionUrl
=
config
.
visionUrl
;
});
}
readEnv
()
export
default
{
export
default
{
writePrintLog
:
async
(
req
,
res
)
=>
{
writePrintLog
:
async
(
req
,
res
)
=>
{
try
{
try
{
...
@@ -33,32 +56,24 @@ export default {
...
@@ -33,32 +56,24 @@ export default {
res
.
json
({
code
:
500
,
msg
:
e
});
res
.
json
({
code
:
500
,
msg
:
e
});
}
}
},
},
getPodProductionInfo
:
async
(
req
,
res
)
=>
{
downloadBySubOrderNumber
:
async
(
req
,
res
)
=>
{
const
token
=
req
.
headers
[
"jwt-token"
];
const
token
=
req
.
headers
[
"jwt-token"
];
const
company
=
req
.
headers
[
"company"
];
const
productionNo
=
req
.
body
.
productionNo
;
try
{
try
{
let
{
data
}
=
await
axios
.
post
(
let
{
`https://
${
company
}
/api/podDesignCenter/getPodImageByProduction`
,
data
{
productionNo
},
}
=
await
axios
.
get
(
{
headers
:
{
"jwt-token"
:
token
}
}
`
${
env
}
/factory/podJomallOrder/downloadBySubOrderNumber`
,
{
params
:
req
.
body
,
headers
:
{
"jwt-token"
:
token
}
}
);
);
console
.
log
(
data
);
console
.
log
(
data
);
if
(
data
.
code
===
200
&&
data
.
data
&&
data
.
data
.
length
>
0
)
{
let
files
=
[];
let
f
=
data
.
data
.
find
(
el
=>
!
el
.
productionFile
);
if
(
data
.
code
===
200
&&
data
.
message
)
{
if
(
f
)
{
files
=
[
data
.
message
];
return
res
.
json
({
code
:
500
,
msg
:
"存在地址错误的素材图"
});
files
=
files
.
map
(
el
=>
{
}
return
{
url
:
`
${
fileEnv
}${
el
}
`
};
data
.
data
.
forEach
(
el
=>
{
if
(
!
el
.
productionFile
.
includes
(
"http"
))
{
el
.
productionFile
=
el
.
productionFile
.
replace
(
"/data/upload/erp/"
,
""
);
el
.
productionFile
=
`https://
${
company
}
/upload/erp
${
el
.
productionFile
}
`
;
}
});
});
downloadImage
(
data
.
data
)
console
.
log
(
files
);
downloadImage
(
files
)
.
then
(
data
=>
{
.
then
(
data
=>
{
res
.
json
({
code
:
200
,
data
});
res
.
json
({
code
:
200
,
data
});
})
})
...
@@ -75,11 +90,10 @@ export default {
...
@@ -75,11 +90,10 @@ export default {
},
},
findByPodProductionNo
:
async
(
req
,
res
)
=>
{
findByPodProductionNo
:
async
(
req
,
res
)
=>
{
const
token
=
req
.
headers
[
"jwt-token"
];
const
token
=
req
.
headers
[
"jwt-token"
];
const
company
=
req
.
headers
[
"company"
];
const
q
=
req
.
body
;
const
q
=
req
.
body
;
try
{
try
{
let
{
data
}
=
await
axios
.
get
(
let
{
data
}
=
await
axios
.
get
(
`
https://
${
company
}
/api/pod/podProductionInfo/findByPodProductionNo
`
,
`
${
env
}
/factory/podJomallOrderProduct/getSubOrderBySubOrderNumber
`
,
{
{
params
:
q
,
params
:
q
,
headers
:
{
"jwt-token"
:
token
}
headers
:
{
"jwt-token"
:
token
}
...
@@ -101,34 +115,20 @@ export default {
...
@@ -101,34 +115,20 @@ export default {
res
.
json
({
code
:
500
,
msg
:
err
});
res
.
json
({
code
:
500
,
msg
:
err
});
}
}
},
},
commitApply
:
async
(
req
,
res
)
=>
{
commitApply
:
async
(
req
,
res
)
=>
{},
const
company
=
req
.
headers
[
"company"
];
const
q
=
req
.
body
;
try
{
let
{
data
}
=
await
axios
.
post
(
`https://
${
company
}
/api/sysDeviceInfo/commitApply`
,
q
);
res
.
send
(
data
);
}
catch
(
err
)
{
console
.
log
(
err
);
res
.
json
({
code
:
500
,
msg
:
err
});
}
},
completeDelivery
:
async
(
req
,
res
)
=>
{
completeDelivery
:
async
(
req
,
res
)
=>
{
const
token
=
req
.
headers
[
"jwt-token"
];
const
token
=
req
.
headers
[
"jwt-token"
];
const
company
=
req
.
headers
[
"company"
];
const
q
=
req
.
body
;
try
{
try
{
let
{
data
}
=
await
axios
.
post
(
let
{
`https://
${
company
}
/api/pod/podProductionInfo/completeDelivery`
,
data
q
,
}
=
await
axios
.
post
(
{
`
${
env
}
/factory/podJomallOrderProduct/completeDelivery`
,
headers
:
{
"jwt-token"
:
token
}
req
.
body
,
}
{
headers
:
{
"jwt-token"
:
token
}
}
);
);
res
.
json
(
data
);
res
.
send
(
data
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
err
);
res
.
json
({
code
:
500
,
msg
:
err
});
res
.
json
({
code
:
500
,
msg
:
err
});
}
}
},
},
...
@@ -232,14 +232,9 @@ export default {
...
@@ -232,14 +232,9 @@ export default {
}
}
},
},
login
:
async
(
req
,
res
)
=>
{
login
:
async
(
req
,
res
)
=>
{
const
{
loginName
,
company
,
password
,
deviceId
}
=
req
.
body
;
try
{
try
{
let
{
data
}
=
await
axios
.
post
(
`https://
${
company
}
/api/sysLogin/login`
,
{
console
.
log
(
`
${
env
}
/factory/login`
);
loginName
,
let
{
data
}
=
await
axios
.
post
(
`
${
env
}
/factory/login`
,
req
.
body
);
password
,
deviceId
});
res
.
send
(
data
);
res
.
send
(
data
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
err
);
console
.
log
(
err
);
...
@@ -282,8 +277,7 @@ export default {
...
@@ -282,8 +277,7 @@ export default {
let
from
=
path
.
join
(
process
.
cwd
(),
"./resources/app/css.zip"
);
let
from
=
path
.
join
(
process
.
cwd
(),
"./resources/app/css.zip"
);
let
dirName
=
path
.
join
(
process
.
cwd
(),
"./resources/app/"
);
let
dirName
=
path
.
join
(
process
.
cwd
(),
"./resources/app/"
);
let
stream
=
fs
.
createWriteStream
(
from
);
let
stream
=
fs
.
createWriteStream
(
from
);
const
company
=
req
.
headers
[
"company"
];
req
.
body
.
url
=
visionUrl
+
req
.
body
.
url
;
req
.
body
.
url
=
"https://"
+
company
+
req
.
body
.
url
;
console
.
log
(
req
.
body
.
url
,
"下载zip地址"
);
console
.
log
(
req
.
body
.
url
,
"下载zip地址"
);
request
(
req
.
body
.
url
)
request
(
req
.
body
.
url
)
.
pipe
(
stream
)
.
pipe
(
stream
)
...
...
src/server/routes/index.js
View file @
495695bd
...
@@ -23,7 +23,7 @@ router.post("/commitApply", fn.commitApply);
...
@@ -23,7 +23,7 @@ router.post("/commitApply", fn.commitApply);
// 下载素材到本地
// 下载素材到本地
router
.
post
(
"/downloadByDesignId"
,
fn
.
downloadByDesignId
);
router
.
post
(
"/downloadByDesignId"
,
fn
.
downloadByDesignId
);
// 获取 生产单号返回素材地址
// 获取 生产单号返回素材地址
router
.
post
(
"/
getPodProductionInfo"
,
fn
.
getPodProductionInfo
);
router
.
post
(
"/
downloadBySubOrderNumber"
,
fn
.
downloadBySubOrderNumber
);
// 提交生产完成
// 提交生产完成
router
.
post
(
"/completeDelivery"
,
fn
.
completeDelivery
);
router
.
post
(
"/completeDelivery"
,
fn
.
completeDelivery
);
// 根据生产单号查询详情
// 根据生产单号查询详情
...
...
src/server/utils/index.js
View file @
495695bd
...
@@ -27,6 +27,7 @@ function zip(from, to) {
...
@@ -27,6 +27,7 @@ function zip(from, to) {
fs
.
renameSync
(
file_path
,
path
.
join
(
to
,
fileName
));
fs
.
renameSync
(
file_path
,
path
.
join
(
to
,
fileName
));
arr
.
push
({
arr
.
push
({
fileName
:
fileName
,
fileName
:
fileName
,
designId
:
data
[
i
].
split
(
"."
)[
0
],
productionFile
:
path
.
join
(
to
,
fileName
)
productionFile
:
path
.
join
(
to
,
fileName
)
});
});
}
}
...
@@ -53,7 +54,7 @@ export const downloadImage = list => {
...
@@ -53,7 +54,7 @@ export const downloadImage = list => {
}
}
let
count
=
0
;
let
count
=
0
;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
list
[
i
].
productionFile
&&
list
[
i
].
productionFile
.
includes
(
"http"
))
{
if
(
list
[
i
].
url
&&
list
[
i
].
url
.
includes
(
"http"
))
{
let
fileName
=
""
;
let
fileName
=
""
;
let
type
=
2
;
let
type
=
2
;
let
flag
=
let
flag
=
...
@@ -66,30 +67,24 @@ export const downloadImage = list => {
...
@@ -66,30 +67,24 @@ export const downloadImage = list => {
".7z"
,
".7z"
,
".gz"
,
".gz"
,
".bz2"
".bz2"
].
filter
(
el
=>
list
[
i
].
productionFile
.
toLowerCase
().
includes
(
el
))
].
filter
(
el
=>
list
[
i
].
url
.
toLowerCase
().
includes
(
el
))
.
length
>
0
;
.
length
>
0
;
if
(
flag
)
{
if
(
flag
)
{
fileName
=
list
[
i
].
productionFile
.
split
(
"/"
)[
fileName
=
list
[
i
].
url
.
split
(
"/"
)[
list
[
i
].
productionFile
.
split
(
"/"
).
length
-
1
list
[
i
].
url
.
split
(
"/"
).
length
-
1
];
];
type
=
1
;
type
=
1
;
}
else
{
}
else
{
fileName
=
uuid
.
v4
()
+
".png"
;
fileName
=
uuid
.
v4
()
+
".png"
;
type
=
2
;
type
=
2
;
}
}
list
[
i
].
fileName
=
fileName
;
list
[
i
].
type
=
type
;
let
p
=
path
.
join
(
process
.
cwd
(),
"./print/Input/"
+
fileName
);
let
p
=
path
.
join
(
process
.
cwd
(),
"./print/Input/"
+
fileName
);
let
stream
=
fs
.
createWriteStream
(
p
);
let
stream
=
fs
.
createWriteStream
(
p
);
request
(
list
[
i
].
productionFile
)
request
(
list
[
i
].
url
)
.
pipe
(
stream
)
.
pipe
(
stream
)
.
on
(
"close"
,
async
function
()
{
.
on
(
"close"
,
async
function
()
{
if
(
type
===
1
)
{
if
(
type
===
1
)
{
let
res_data
=
await
zip
(
p
,
dirPath
);
list
[
i
].
list
=
await
zip
(
p
,
dirPath
);
res_data
.
forEach
(
item
=>
{
item
.
designId
=
list
[
i
].
designId
;
});
list
[
i
].
list
=
res_data
;
if
(
count
===
list
.
length
-
1
)
{
if
(
count
===
list
.
length
-
1
)
{
resolve
(
list
);
resolve
(
list
);
}
}
...
...
src/server/utils/log.js
View file @
495695bd
...
@@ -43,7 +43,6 @@ const addFormatLog = function(req, res, data) {
...
@@ -43,7 +43,6 @@ const addFormatLog = function(req, res, data) {
const
resTime
=
now
-
req
.
_startTime
;
const
resTime
=
now
-
req
.
_startTime
;
const
token
=
req
.
headers
[
"jwt-token"
];
const
token
=
req
.
headers
[
"jwt-token"
];
const
company
=
req
.
headers
[
"company"
];
const
{
const
{
ip
,
ip
,
headers
,
headers
,
...
@@ -60,7 +59,6 @@ const addFormatLog = function(req, res, data) {
...
@@ -60,7 +59,6 @@ const addFormatLog = function(req, res, data) {
method
,
method
,
url
,
url
,
token
,
token
,
company
,
body
,
body
,
httpVersion
,
httpVersion
,
statusCode
,
statusCode
,
...
@@ -70,21 +68,16 @@ const addFormatLog = function(req, res, data) {
...
@@ -70,21 +68,16 @@ const addFormatLog = function(req, res, data) {
};
};
// ${JSON.stringify(logInfo)}
// ${JSON.stringify(logInfo)}
logger
(
"log"
).
info
(
`
logger
(
"log"
).
info
(
`
时间:
${
moment
(
new
Date
()).
format
(
"YYYY-MM-DD HH:mm:ss"
)}
时间:
${
moment
(
new
Date
()).
format
(
"YYYY-MM-DD HH:mm:ss"
)}
ip :
${
logInfo
.
ip
}
ip :
${
logInfo
.
ip
}
host :
${
logInfo
.
host
}
host :
${
logInfo
.
host
}
响应时间 :
${
logInfo
.
resTime
/
1000
}
s
响应时间 :
${
logInfo
.
resTime
/
1000
}
s
method :
${
logInfo
.
method
}
method :
${
logInfo
.
method
}
url :
${
logInfo
.
url
}
url :
${
logInfo
.
url
}
客户 :
${
logInfo
.
company
||
""
}
token :
${
logInfo
.
token
||
""
}
token :
${
logInfo
.
token
||
""
}
body :
${
JSON
.
stringify
(
logInfo
.
body
)}
body :
${
JSON
.
stringify
(
logInfo
.
body
)}
状态码 :
${
logInfo
.
statusCode
}
状态码 :
${
logInfo
.
statusCode
}
data :
${
JSON
.
stringify
(
logInfo
.
data
)}
data :
${
JSON
.
stringify
(
logInfo
.
data
)}
`
`
);
);
...
...
src/utils/axios.js
View file @
495695bd
...
@@ -28,10 +28,8 @@ service.interceptors.request.use(
...
@@ -28,10 +28,8 @@ service.interceptors.request.use(
config
=>
{
config
=>
{
console
.
log
(
Vue
.
prototype
.
$dataStore
);
console
.
log
(
Vue
.
prototype
.
$dataStore
);
const
user
=
Vue
.
prototype
.
$dataStore
.
get
(
"user"
);
const
user
=
Vue
.
prototype
.
$dataStore
.
get
(
"user"
);
const
company
=
Vue
.
prototype
.
$dataStore
.
get
(
"company"
);
if
(
user
)
{
if
(
user
)
{
config
.
headers
[
"jwt-token"
]
=
user
.
token
;
config
.
headers
[
"jwt-token"
]
=
user
.
token
;
config
.
headers
[
"company"
]
=
company
.
domain
;
}
}
startLoading
();
startLoading
();
return
config
;
return
config
;
...
...
src/views/design/detail/index.vue
View file @
495695bd
<
script
>
<
script
>
import
{
ipcRenderer
}
from
"electron"
;
import
{
ipcRenderer
}
from
"electron"
;
export
default
{
export
default
{
mounted
()
{
mounted
()
{
let
that
=
this
;
let
that
=
this
;
ipcRenderer
.
on
(
'getProductionNoInfo'
,
(
event
,
data
)
=>
{
ipcRenderer
.
on
(
"getProductionNoInfo"
,
(
event
,
data
)
=>
{
console
.
log
(
data
,
99622
)
console
.
log
(
data
,
99622
);
that
.
trackcodeInput
(
data
)
that
.
trackcodeInput
(
data
);
})
});
},
watch
:
{
},
},
watch
:
{},
data
()
{
data
()
{
return
{
return
{
shipForm
:
{
shipmentType
:
'1'
},
shipForm
:
{
shipmentType
:
"1"
},
logistics
:
[],
logistics
:
[],
placeholderText
:
''
,
placeholderText
:
""
,
sendNum
:
0
,
sendNum
:
0
,
type
:
1
,
type
:
1
,
isDownloadImage
:
false
,
isDownloadImage
:
false
,
isAutoSure
:
false
,
isAutoSure
:
false
,
currentStatus
:
'IN_PRODUCTION'
,
currentStatus
:
"IN_PRODUCTION"
,
detail
:
{
detail
:
{
imgList
:
[]
imgList
:
[]
},
},
...
@@ -34,129 +32,128 @@ export default {
...
@@ -34,129 +32,128 @@ export default {
weight_search_success
:
require
(
`../../../assets/audio/weight_search_success.mp3`
)
weight_search_success
:
require
(
`../../../assets/audio/weight_search_success.mp3`
)
},
},
productInfo
:
{},
productInfo
:
{},
TrackingNumber
:
''
TrackingNumber
:
""
}
}
;
},
},
methods
:
{
methods
:
{
changeStatus
()
{
changeStatus
()
{
if
(
!
this
.
detail
||
Object
.
keys
(
this
.
detail
).
length
<=
1
)
{
if
(
!
this
.
detail
||
Object
.
keys
(
this
.
detail
).
length
<=
1
)
{
return
this
.
$message
.
warning
(
'请扫码生产单号'
)
return
this
.
$message
.
warning
(
"请扫码生产单号"
);
}
}
this
.
$confirm
(
this
.
$confirm
(
`确定
${
this
.
type
===
1
?
'生产完成'
:
'确定发货'
}
?`
,
`确定
${
this
.
type
===
1
?
"生产完成"
:
"确定发货"
}
?`
,
'提示'
,
"提示"
,
{
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
"确定"
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
"取消"
,
type
:
'warning'
type
:
"warning"
}
}
).
then
(()
=>
{
).
then
(()
=>
{
this
.
setData
()
this
.
setData
()
;
})
})
;
},
},
async
setData
()
{
async
setData
()
{
if
(
this
.
detail
&&
this
.
detail
.
id
)
{
if
(
this
.
detail
&&
this
.
detail
.
id
)
{
let
url
=
let
url
=
this
.
currentStatus
==
'IN_PRODUCTION'
this
.
currentStatus
==
"IN_PRODUCTION"
?
'pod/podProductionInfo/completeDelivery'
?
"pod/podProductionInfo/completeDelivery"
:
'pod/podProductionInfo/completeShipment'
:
"pod/podProductionInfo/completeShipment"
;
try
{
try
{
let
data
=
let
data
=
this
.
currentStatus
==
'IN_PRODUCTION'
this
.
currentStatus
==
"IN_PRODUCTION"
?
{
?
{
id
:
this
.
detail
.
id
id
:
this
.
detail
.
id
}
}
:
{
:
{
list
:
[
this
.
detail
],
list
:
[
this
.
detail
],
...
this
.
shipForm
...
this
.
shipForm
}
};
if
(
data
.
list
)
{
if
(
data
.
list
)
{
data
.
list
[
0
].
note
=
data
.
list
[
0
].
note
=
data
.
list
[
0
].
note
&&
typeof
data
.
list
[
0
].
note
===
'object'
data
.
list
[
0
].
note
&&
typeof
data
.
list
[
0
].
note
===
"object"
?
JSON
.
stringify
(
data
.
list
[
0
].
note
)
?
JSON
.
stringify
(
data
.
list
[
0
].
note
)
:
null
:
null
;
}
}
await
post
(
url
,
data
)
await
post
(
url
,
data
)
;
if
(
this
.
type
===
2
)
{
if
(
this
.
type
===
2
)
{
this
.
sendNum
=
this
.
sendNum
+
1
this
.
sendNum
=
this
.
sendNum
+
1
;
}
}
this
.
playAudio
(
'weight_success'
)
this
.
playAudio
(
"weight_success"
);
this
.
detail
=
{
imgList
:
[]}
this
.
detail
=
{
imgList
:
[]
};
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
e
)
console
.
error
(
e
)
;
this
.
detail
=
{
imgList
:
[]}
this
.
detail
=
{
imgList
:
[]
};
this
.
playAudio
(
'weight_search_error'
)
this
.
playAudio
(
"weight_search_error"
);
}
}
}
}
},
},
downloadAllWe
(
data
,
designId
)
{
downloadAllWe
(
data
,
designId
)
{
if
(
!
this
.
detail
||
Object
.
keys
(
this
.
detail
).
length
<=
1
)
{
if
(
!
this
.
detail
||
Object
.
keys
(
this
.
detail
).
length
<=
1
)
{
return
this
.
$message
.
warning
(
'请扫码生产单号'
)
return
this
.
$message
.
warning
(
"请扫码生产单号"
);
}
}
let
params
=
{
let
params
=
{
productionNo
:
this
.
detail
.
podProductionNo
,
productionNo
:
this
.
detail
.
podProductionNo
,
method
:
'POST'
method
:
"POST"
}
}
;
if
(
data
===
1
)
{
if
(
data
===
1
)
{
params
=
{
params
=
{
...
params
,
...
params
,
...{
...{
designId
designId
}
}
}
}
;
}
else
if
(
data
===
2
)
{
}
else
if
(
data
===
2
)
{
params
=
{
params
=
{
...
params
,
...
params
,
...{
...{
negativeDesignId
:
designId
negativeDesignId
:
designId
}
}
}
}
;
}
}
downloadFile
(
'podDesignCenter/downloadByDesignId'
,
params
)
downloadFile
(
"podDesignCenter/downloadByDesignId"
,
params
)
.
then
((
res
)
=>
{
.
then
(
res
=>
{
const
{
data
,
fileName
}
=
res
const
{
data
,
fileName
}
=
res
;
let
url
=
window
.
URL
.
createObjectURL
(
data
)
let
url
=
window
.
URL
.
createObjectURL
(
data
);
// 生成一个a标签
// 生成一个a标签
let
link
=
document
.
createElement
(
'a'
)
let
link
=
document
.
createElement
(
"a"
);
link
.
style
.
display
=
'none'
link
.
style
.
display
=
"none"
;
link
.
href
=
url
link
.
href
=
url
;
// 生成时间戳
// 生成时间戳
link
.
download
=
fileName
link
.
download
=
fileName
;
link
.
click
()
link
.
click
();
window
.
URL
.
revokeObjectURL
(
url
)
window
.
URL
.
revokeObjectURL
(
url
);
})
.
catch
((
err
)
=>
{
console
.
log
(
err
)
})
})
.
catch
(
err
=>
{
console
.
log
(
err
);
});
},
},
playAudio
(
key
,
message
)
{
playAudio
(
key
,
message
)
{
let
text
=
''
let
text
=
""
;
switch
(
key
)
{
switch
(
key
)
{
case
'weight_search_success'
:
case
"weight_search_success"
:
text
=
''
text
=
""
;
break
break
;
case
'weight_search_error'
:
case
"weight_search_error"
:
text
=
'请录入生产单号'
text
=
"请录入生产单号"
;
break
break
;
case
'weight_success'
:
case
"weight_success"
:
text
=
''
text
=
""
;
break
break
;
case
'weight_repeat'
:
case
"weight_repeat"
:
text
=
'称重复录入'
text
=
"称重复录入"
;
break
break
;
default
:
default
:
text
=
'请录入跟踪号或重量'
text
=
"请录入跟踪号或重量"
;
break
break
;
}
}
if
(
message
||
text
)
this
.
$message
.
warning
(
message
||
text
)
if
(
message
||
text
)
this
.
$message
.
warning
(
message
||
text
)
;
let
audio
=
document
.
createElement
(
'audio'
)
let
audio
=
document
.
createElement
(
"audio"
);
console
.
log
(
key
)
console
.
log
(
key
)
;
audio
.
src
=
this
.
audios
[
key
]
audio
.
src
=
this
.
audios
[
key
]
;
audio
.
play
()
audio
.
play
()
;
},
},
async
trackcodeInput
(
data
)
{
async
trackcodeInput
(
data
)
{
// if (this.type === 1) {
// if (this.type === 1) {
// if (this.isAutoSure) {
// if (this.isAutoSure) {
// await this.setData()
// await this.setData()
...
@@ -166,81 +163,78 @@ export default {
...
@@ -166,81 +163,78 @@ export default {
// }
// }
try
{
try
{
let
d
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
d
=
JSON
.
parse
(
JSON
.
stringify
(
data
))
if
(
d
.
note
)
{
if
(
d
.
note
)
{
d
.
note
=
JSON
.
parse
(
d
.
note
)
d
.
note
=
JSON
.
parse
(
d
.
note
)
;
}
else
{
}
else
{
d
.
note
=
[]
d
.
note
=
[]
;
}
}
let
arr
=
[]
let
arr
=
[]
;
if
(
!
d
.
imageAry
)
{
if
(
!
d
.
imageAry
)
{
arr
=
[
arr
=
[
{
url
:
d
.
variantImage
,
title
:
'正面'
,
id
:
d
.
designId
},
{
url
:
d
.
variantImage
,
title
:
"正面"
,
id
:
d
.
designId
},
{
url
:
d
.
negativeImage
,
title
:
'反面'
,
id
:
d
.
negativeDesignId
}
{
url
:
d
.
negativeImage
,
title
:
"反面"
,
id
:
d
.
negativeDesignId
}
].
filter
(
(
el
)
=>
el
.
url
)
].
filter
(
el
=>
el
.
url
);
}
else
{
}
else
{
arr
=
arr
=
typeof
d
.
imageAry
==
'string'
?
JSON
.
parse
(
d
.
imageAry
)
:
d
.
imageAry
typeof
d
.
imageAry
==
"string"
?
JSON
.
parse
(
d
.
imageAry
)
:
d
.
imageAry
;
arr
=
arr
.
concat
([
arr
=
arr
.
concat
([
{
url
:
d
.
negativeImage
,
title
:
'反面'
,
id
:
d
.
negativeDesignId
}
{
url
:
d
.
negativeImage
,
title
:
"反面"
,
id
:
d
.
negativeDesignId
}
])
])
;
}
}
const
result
=
[]
const
result
=
[]
;
console
.
log
(
arr
)
console
.
log
(
arr
)
;
arr
=
arr
.
filter
(
(
el
)
=>
el
.
url
)
arr
=
arr
.
filter
(
el
=>
el
.
url
);
arr
=
arr
.
map
(
(
el
)
=>
{
arr
=
arr
.
map
(
el
=>
{
return
{
return
{
...
el
,
...
el
,
...{
...{
url
:
el
.
url
.
includes
(
'http'
)
url
:
el
.
url
.
includes
(
"http"
)
?
el
.
url
?
el
.
url
:
window
.
location
.
origin
+
'/upload/erp'
+
el
.
url
:
window
.
location
.
origin
+
"/upload/erp"
+
el
.
url
}
}
}
}
;
})
})
;
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
+=
2
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
+=
2
)
{
result
.
push
(
arr
.
slice
(
i
,
i
+
2
))
result
.
push
(
arr
.
slice
(
i
,
i
+
2
))
;
}
}
d
.
imgList
=
result
d
.
imgList
=
result
;
console
.
log
(
d
.
imgList
,
'this.detail.imgList '
)
console
.
log
(
d
.
imgList
,
"this.detail.imgList "
);
this
.
detail
=
d
this
.
detail
=
d
;
// 自动下载素材
// 自动下载素材
// if (this.isDownloadImage) {
// if (this.isDownloadImage) {
// this.downloadAllWe()
// this.downloadAllWe()
// }
// }
this
.
playAudio
(
'weight_search_success'
)
this
.
playAudio
(
"weight_search_success"
);
// this.$nextTick(() => {
// this.$nextTick(() => {
// if (this.$refs.trackingNumberRef) {
// if (this.$refs.trackingNumberRef) {
// this.$refs.trackingNumberRef.focus()
// this.$refs.trackingNumberRef.focus()
// }
// }
// })
// })
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
e
)
console
.
error
(
e
)
;
this
.
productInfo
=
{}
this
.
productInfo
=
{}
;
this
.
playAudio
(
'weight_search_error'
)
this
.
playAudio
(
"weight_search_error"
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
if
(
this
.
$refs
.
trackingNumberRef
)
{
if
(
this
.
$refs
.
trackingNumberRef
)
{
this
.
$refs
.
trackingNumberRef
.
focus
()
this
.
$refs
.
trackingNumberRef
.
focus
()
;
}
}
})
})
;
}
}
}
}
}
}
}
}
;
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"page"
>
<div
class=
"page"
>
<div
class=
"sure-btn"
v-if=
"type
=== 2"
>
<div
class=
"sure-btn"
v-if=
"type
=== 2"
>
<el-button
@
click=
"changeStatus"
size=
"small"
type=
"success"
>
<el-button
@
click=
"changeStatus"
size=
"small"
type=
"success"
>
{{
type
===
1
?
'生产完成'
:
'确定发货'
}}
{{
type
===
1
?
"生产完成"
:
"确定发货"
}}
</el-button>
</el-button>
</div>
</div>
<div
class=
"detail-div"
>
<div
class=
"detail-div"
>
<div
class=
"detail-content"
>
<div
class=
"detail-content"
>
...
@@ -250,17 +244,20 @@ export default {
...
@@ -250,17 +244,20 @@ export default {
v-if=
"detail.imgList.length > 0"
v-if=
"detail.imgList.length > 0"
style=
"height: 100%"
style=
"height: 100%"
:autoplay=
"false"
:autoplay=
"false"
indicator-position=
"none"
>
indicator-position=
"none"
>
<el-carousel-item
<el-carousel-item
style=
"height: 100%"
style=
"height: 100%"
:key=
"index"
:key=
"index"
v-for=
"(item, index) in detail.imgList"
>
v-for=
"(item, index) in detail.imgList"
>
<el-row
:gutter=
"10"
style=
"width: 100%; height: 100%"
>
<el-row
:gutter=
"10"
style=
"width: 100%; height: 100%"
>
<el-col
<el-col
style=
"height: 100%"
style=
"height: 100%"
v-for=
"(it, i) in item"
v-for=
"(it, i) in item"
:key=
"i"
:key=
"i"
:span=
"12"
>
:span=
"12"
>
<div
class=
"left-image"
>
<div
class=
"left-image"
>
<b
v-show=
"it.title && it.url"
>
<b
v-show=
"it.title && it.url"
>
{{
it
.
title
}}
{{
it
.
title
}}
...
@@ -276,11 +273,12 @@ export default {
...
@@ -276,11 +273,12 @@ export default {
it.id
it.id
)
)
"
"
v-if=
"it.id"
>
v-if=
"it.id"
>
(DID:
{{
it
.
id
}}
)
(DID:
{{
it
.
id
}}
)
</span>
</span>
</b>
</b>
<img
:src=
"it.url"
alt=
""
/>
<img
:src=
"it.url"
alt=
""
/>
</div>
</div>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -304,24 +302,46 @@ export default {
...
@@ -304,24 +302,46 @@ export default {
<!-- 查询-->
<!-- 查询-->
<!--
</el-button>
-->
<!--
</el-button>
-->
<!--
</div>
-->
<!--
</div>
-->
<div
class=
"div-text"
>
<div
class=
"div-content"
>
<div
:title=
"String(detail?.userMark)"
class=
"div-item"
>
<span
style=
"font-size: 18px"
>
客户
</span>
<p
style=
"color: red; font-size: 30px"
>
{{
detail
?.
userMark
}}
</p>
</div>
<div
:title=
"String(detail?.factoryOrderNumber)"
class=
"div-item"
>
<span
style=
"font-size: 18px"
>
订单号
</span>
<p
style=
"color: red; font-size: 22px"
>
{{
detail
?.
factoryOrderNumber
}}
</p>
</div>
</div>
</div>
<div
class=
"div-text"
>
<div
class=
"div-text"
>
<b>
生产单信息
</b>
<b>
生产单信息
</b>
<div
class=
"div-content"
>
<div
class=
"div-content"
>
<div
:title=
"detail.podProductionNo"
class=
"div-item"
>
<div
:title=
"detail.podProductionNo"
class=
"div-item"
>
<span>
生产单号
</span>
<span>
生产单号
</span>
<p>
{{
detail
.
podProductionNo
}}
</p>
<p>
{{
detail
.
factorySubOrderNumber
}}
</p>
<p
<p
style=
"margin-left: 5px"
style=
"margin-left: 5px"
v-if=
"detail.podProductionNo"
v-if=
"detail.podProductionNo"
:style=
"
{
:style=
"
{
color: detail.customizedQuantity > 1 ? 'red' : '#67C23A'
color: detail.customizedQuantity > 1 ? 'red' : '#67C23A'
}">
}"
{{
detail
.
customizedQuantity
>
1
?
'多'
:
'单'
}}
>
{{
detail
.
customizedQuantity
>
1
?
"多"
:
"单"
}}
</p>
</p>
</div>
</div>
<div
:title=
"detail.p
odProcessName"
class=
"div-item"
>
<div
:title=
"detail.p
rocess"
class=
"div-item"
>
<span>
生产工艺
</span>
<span>
生产工艺
</span>
<p>
{{
detail
.
p
odProcessName
}}
</p>
<p>
{{
detail
.
p
rocess
}}
</p>
</div>
</div>
<div
:title=
"detail.baseSku"
class=
"div-item"
>
<div
:title=
"detail.baseSku"
class=
"div-item"
>
<span>
基版
</span>
<span>
基版
</span>
...
@@ -335,162 +355,97 @@ export default {
...
@@ -335,162 +355,97 @@ export default {
<span>
变体SKU
</span>
<span>
变体SKU
</span>
<p>
{{
detail
.
variantSku
}}
</p>
<p>
{{
detail
.
variantSku
}}
</p>
</div>
</div>
<div
:title=
"detail.
categoryName"
class=
"div-item"
>
<div
:title=
"detail.
num"
class=
"div-item"
>
<span>
类别
</span>
<span>
数量
</span>
<p>
{{
detail
.
categoryName
}}
</p>
<p>
{{
detail
.
num
}}
</p>
</div>
</div>
<div
:title=
"detail.color"
class=
"div-item"
>
<div
:title=
"detail.color"
class=
"div-item"
>
<span>
颜色
</span>
<span>
颜色
</span>
<p>
{{
detail
.
color
}}
</p>
<p>
{{
detail
.
baseSku
?
detail
.
baseSku
.
split
(
"_"
)[
1
]:
null
}}
</p>
</div>
</div>
<div
:title=
"detail.size"
class=
"div-item"
>
<div
:title=
"detail.size"
class=
"div-item"
>
<span>
尺寸
</span>
<span>
尺寸
</span>
<p>
{{
detail
.
size
}}
</p>
<p>
{{
detail
.
size
}}
</p>
</div>
</div>
<div
:title=
"detail.material"
class=
"div-item"
>
<span>
材质
</span>
<p>
{{
detail
.
material
}}
</p>
</div>
<div
:title=
"detail.batchNo"
class=
"div-item"
>
<span>
批次号
</span>
<p>
{{
detail
.
batchNo
}}
</p>
</div>
<div
:title=
"detail.supplyMerchantCode"
v-if=
"currentStatus !== 'TO_BE_ASSIGN'"
class=
"div-item"
>
<span>
供应商编号
</span>
<p>
{{
detail
.
supplyMerchantCode
}}
</p>
</div>
<div
:title=
"detail.shopNumber"
class=
"div-item"
>
<div
:title=
"detail.shopNumber"
class=
"div-item"
>
<span>
店铺单号
</span>
<span>
店铺单号
</span>
<p>
{{
detail
.
shopNumber
}}
</p>
<p>
{{
detail
.
shopNumber
}}
</p>
</div>
</div>
<div
:title=
"detail.shopShortName"
class=
"div-item"
>
<span>
店铺简称
</span>
<p>
{{
detail
.
shopShortName
}}
</p>
</div>
<div
:title=
"detail.expectDeliveryTime"
class=
"div-item"
>
<div
:title=
"detail.expectDeliveryTime"
class=
"div-item"
>
<span>
期望交货时间
</span>
<span>
期望交货时间
</span>
<p>
{{
detail
.
expectDeliveryTime
}}
</p>
<p>
{{
detail
.
expectDeliveryTime
}}
</p>
</div>
</div>
<div
:title=
"detail.purchaseUserName"
class=
"div-item"
>
<span>
采购员
</span>
<p>
{{
detail
.
purchaseUserName
}}
</p>
</div>
<div
:title=
"detail.productionConfirmTime"
class=
"div-item"
>
<div
:title=
"detail.productionConfirmTime"
class=
"div-item"
>
<span>
生产确认时间
</span>
<span>
生产确认时间
</span>
<p>
{{
detail
.
productionConfirmTime
}}
</p>
<p>
{{
detail
.
startStockingTime
}}
</p>
</div>
<div
:title=
"detail.followerName"
class=
"div-item"
>
<span>
跟单员
</span>
<p>
{{
detail
.
followerName
}}
</p>
</div>
<div
:title=
"detail.actualDeliveryTime"
class=
"div-item"
>
<span>
实际交货时间
</span>
<p>
{{
detail
.
actualDeliveryTime
}}
</p>
</div>
<div
:title=
"detail.storedName"
class=
"div-item"
>
<span>
入库人
</span>
<p>
{{
detail
.
storedName
}}
</p>
</div>
<div
:title=
"detail.storedTime"
class=
"div-item"
>
<span>
入库时间
</span>
<p>
{{
detail
.
storedTime
}}
</p>
</div>
<div
:title=
"detail.replenishmentNumber"
class=
"div-item"
>
<span>
补胚数量
</span>
<p>
{{
detail
.
replenishmentNumber
}}
</p>
</div>
<div
:title=
"detail.shipmentType == 1 ? '送货上门' : '快递'"
class=
"div-item"
>
<span>
发货方式
</span>
<p
v-if=
"detail.shipmentType"
>
{{
detail
.
shipmentType
==
1
?
'送货上门'
:
'快递'
}}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div
<div
class=
"form"
class=
"form"
style=
"margin: 15px 0; background: #4168ff; border-radius: 5px"
style=
"margin: 15px 0; background: #4168ff; border-radius: 5px"
v-if=
"type === 2"
>
v-if=
"type === 2"
>
<el-form
<el-form
:model=
"shipForm"
:model=
"shipForm"
ref=
"form"
ref=
"form"
label-width=
"80px"
label-width=
"80px"
:inline=
"false"
:inline=
"false"
size=
"small"
>
size=
"small"
>
<el-form-item
style=
"margin-top: 10px"
label=
"发货方式"
>
<el-form-item
style=
"margin-top: 10px"
label=
"发货方式"
>
<el-select
<el-select
style=
"width: 384px"
style=
"width: 384px"
v-model=
"shipForm.shipmentType"
v-model=
"shipForm.shipmentType"
value-key=
""
value-key=
""
placeholder=
"请选择"
>
placeholder=
"请选择"
>
<el-option
label=
"送货上门"
value=
"1"
></el-option>
<el-option
label=
"送货上门"
value=
"1"
></el-option>
<el-option
label=
"快递"
value=
"2"
></el-option>
<el-option
label=
"快递"
value=
"2"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
label=
"物流方式"
label=
"物流方式"
v-if=
"shipForm.shipmentType == '2'"
>
v-if=
"shipForm.shipmentType == '2'"
>
<el-select
<el-select
v-model=
"shipForm.shipmentWay"
v-model=
"shipForm.shipmentWay"
style=
"width: 384px"
style=
"width: 384px"
placeholder=
"请选择"
>
placeholder=
"请选择"
>
<el-option
<el-option
v-for=
"(item, index) in logistics"
v-for=
"(item, index) in logistics"
:key=
"index"
:key=
"index"
:label=
"item.name"
:label=
"item.name"
:value=
"item.name"
></el-option>
:value=
"item.name"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
label=
"物流单号"
label=
"物流单号"
v-if=
"shipForm.shipmentType == '2'"
>
v-if=
"shipForm.shipmentType == '2'"
>
<el-input
<el-input
style=
"width: 384px"
style=
"width: 384px"
v-model=
"shipForm.shipmentNumber"
v-model=
"shipForm.shipmentNumber"
placeholder=
"请输入"
></el-input>
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
label=
"物流费用"
label=
"物流费用"
v-if=
"shipForm.shipmentType == '2'"
>
v-if=
"shipForm.shipmentType == '2'"
>
<el-input
<el-input
style=
"width: 384px"
style=
"width: 384px"
v-model=
"shipForm.shipmentFreight"
v-model=
"shipForm.shipmentFreight"
placeholder=
"请输入"
></el-input>
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
<!--
<div-->
<!-- class="btn"-->
<!-- v-if="type !== 2">-->
<!--
<div
class=
"btn-sure"
>
-->
<!--
<el-button
style=
"width: 100%; height: 100%; font-size: 18px"
size=
"large"
@
click=
"changeStatus"
--
>
<!-- type="success">-->
<!--
{{
type
===
1
?
'生产完成'
:
'确定发货'
}}
-->
<!--
</el-button>
-->
<!-- <!–
<div
class=
"check"
>
–>
-->
<!-- <!–
<el-checkbox
v-if=
"type===1"
v-model=
"isAutoSure"
>
自动完成上一单
</el-checkbox>
–>
-->
<!-- <!–
</div>
–>
-->
<!--
</div>
-->
<!-- <!–
<div
class=
"btn-down"
>
–>
-->
<!-- <!–
<div
class=
"check"
>
–>
-->
<!-- <!–
<el-checkbox
size=
"large"
v-model=
"isDownloadImage"
>
扫码下载素材
</el-checkbox>
–>
-->
<!-- <!–
</div>
–>
-->
<!-- <!–
<el-button
&
ndash
;&
gt
;
--
>
<!-- <!– size="medium"–>-->
<!-- <!– @click="downloadAllWe"–>-->
<!-- <!– style="width: 100%; height: 100%; font-size: 18px"–>-->
<!-- <!– type="primary">–>-->
<!-- <!– 下载素材–>-->
<!-- <!–
</el-button>
–>
-->
<!-- <!–
</div>
–>
-->
<!--
</div>
-->
<div
<div
v-if=
"type !== 2"
v-if=
"type !== 2"
class=
"div-text"
class=
"div-text"
...
@@ -500,13 +455,15 @@ export default {
...
@@ -500,13 +455,15 @@ export default {
flex-shrink: 0;
flex-shrink: 0;
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
"
>
"
>
<div
style=
"height: 100%"
class=
"div-content"
v-if=
"detail.note"
>
<div
style=
"height: 100%"
class=
"div-content"
v-if=
"detail.note"
>
<b
style=
"position: absolute; top: -12px"
>
客户留言信息
</b>
<b
style=
"position: absolute; top: -12px"
>
客户留言信息
</b>
<div
<div
v-for=
"(item, index) in detail.note"
v-for=
"(item, index) in detail.note"
:key=
"index"
:key=
"index"
class=
"div-item"
>
class=
"div-item"
>
<span>
{{
item
.
prop
}}
:
</span>
<span>
{{
item
.
prop
}}
:
</span>
<p>
<p>
{{
item
.
value
}}
{{
item
.
value
}}
...
@@ -522,7 +479,8 @@ export default {
...
@@ -522,7 +479,8 @@ export default {
flex-shrink: 0;
flex-shrink: 0;
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
"
>
"
>
<div
style=
"height: 100%"
class=
"div-content"
>
<div
style=
"height: 100%"
class=
"div-content"
>
<b
style=
"position: absolute; top: -12px"
>
本次发货数量
</b>
<b
style=
"position: absolute; top: -12px"
>
本次发货数量
</b>
<div
<div
...
@@ -534,40 +492,17 @@ export default {
...
@@ -534,40 +492,17 @@ export default {
height: 100%;
height: 100%;
font-size: 40px;
font-size: 40px;
justify-content: center;
justify-content: center;
"
>
"
>
<h2
style=
"color: red; font-weight: bold"
>
{{
sendNum
}}
</h2>
<h2
style=
"color: red; font-weight: bold"
>
{{
sendNum
}}
</h2>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"detail-images"
v-if=
"detail && Object.keys(detail).length > 1"
>
<div
class=
"scroll-list"
>
<div
class=
"img-title"
>
<b>
商品信息
</b>
<div
class=
"id"
>
<img
src=
"@/assets/id.png"
alt=
""
/>
<span>
{{
detail
.
variantSku
.
split
(
'_'
)[
0
]
}}
</span>
</div>
</div>
<div
class=
"scroll-content"
>
<div
class=
"scroll-item"
v-for=
"(it, i) in detail.colorImageList"
:key=
"i"
>
<el-image
style=
"width: 100%; height: 100%"
:src=
"it"
:preview-src-list=
"[it]"
></el-image>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
...
@@ -706,7 +641,7 @@ export default {
...
@@ -706,7 +641,7 @@ export default {
text-align
:
right
;
text-align
:
right
;
width
:
100px
;
width
:
100px
;
&::after
{
&::after
{
content
:
':'
;
content
:
":"
;
margin
:
0
3px
;
margin
:
0
3px
;
}
}
}
}
...
@@ -766,11 +701,13 @@ export default {
...
@@ -766,11 +701,13 @@ export default {
}
}
}
}
}
}
.detail-div
.right
.btn
.btn-sure
,
.detail-div
.right
.btn
.btn-down
{
.detail-div
.right
.btn
.btn-sure
,
.detail-div
.right
.btn
.btn-down
{
width
:
100%
;
width
:
100%
;
position
:
relative
;
position
:
relative
;
}
}
.detail-div
.right
.btn
.btn-sure
.check
,
.detail-div
.right
.btn
.btn-down
.check
{
.detail-div
.right
.btn
.btn-sure
.check
,
.detail-div
.right
.btn
.btn-down
.check
{
position
:
absolute
;
position
:
absolute
;
width
:
144px
;
width
:
144px
;
height
:
100%
;
height
:
100%
;
...
@@ -809,6 +746,4 @@ export default {
...
@@ -809,6 +746,4 @@ export default {
p
{
p
{
margin
:
0
;
margin
:
0
;
}
}
</
style
>
</
style
>
src/views/design/head/index.vue
View file @
495695bd
...
@@ -12,13 +12,10 @@ export default {
...
@@ -12,13 +12,10 @@ export default {
props
:
{
props
:
{
user
:
{
user
:
{
default
:
{
default
:
{
avatar
:
""
avatar
:
""
,
factory
:
{}
},
},
type
:
Object
type
:
Object
},
company
:
{
default
:
{},
type
:
Object
}
}
},
},
data
()
{
data
()
{
...
@@ -32,16 +29,12 @@ export default {
...
@@ -32,16 +29,12 @@ export default {
{
{
label
:
"登录记录"
,
label
:
"登录记录"
,
value
:
"userList"
value
:
"userList"
},{
},
label
:
"公司信息"
,
{
value
:
"company"
},
{
label
:
"打印预设"
,
label
:
"打印预设"
,
value
:
"print-setting"
value
:
"print-setting"
},
{
},
label
:
"系统授权信息"
,
{
value
:
"deviceId"
},
{
label
:
"系统设置"
,
label
:
"系统设置"
,
value
:
"setting"
value
:
"setting"
}
}
...
@@ -84,22 +77,6 @@ export default {
...
@@ -84,22 +77,6 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
avatar
()
{
if
(
this
.
user
&&
this
.
user
.
avatar
&&
this
.
company
.
domain
)
{
console
.
log
(
this
.
user
,
9
);
console
.
log
(
this
.
company
,
8
);
let
host
=
this
.
company
.
domain
;
if
(
host
.
includes
(
"console"
))
{
host
=
host
.
replace
(
".jomalls.com"
,
".joshine.cn"
);
}
let
avatar
=
this
.
user
.
avatar
.
includes
(
"http"
)
?
this
.
user
.
avatar
:
`https://
${
host
}
/erpimg/
${
this
.
user
.
avatar
}
`
;
console
.
log
(
avatar
);
return
avatar
;
}
return
""
;
},
actionList
()
{
actionList
()
{
return
this
.
$store
.
getters
.
getActionList
;
return
this
.
$store
.
getters
.
getActionList
;
}
}
...
@@ -149,23 +126,9 @@ export default {
...
@@ -149,23 +126,9 @@ export default {
this
.
$dataStore
.
delete
(
"user"
);
this
.
$dataStore
.
delete
(
"user"
);
this
.
$router
.
push
(
"/"
);
this
.
$router
.
push
(
"/"
);
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{});
});
break
;
case
"company"
:
this
.
$confirm
(
"是否切换系统?"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
})
.
then
(()
=>
{
this
.
$dataStore
.
delete
(
"company"
);
this
.
$dataStore
.
delete
(
"user"
);
this
.
$router
.
push
(
"/"
);
})
.
catch
(()
=>
{
});
break
;
break
;
case
"cache"
:
case
"cache"
:
this
.
checkList
=
[];
this
.
checkList
=
[];
this
.
cacheVisible
=
true
;
this
.
cacheVisible
=
true
;
...
@@ -174,9 +137,8 @@ export default {
...
@@ -174,9 +137,8 @@ export default {
},
},
async
setData
(
data
)
{
async
setData
(
data
)
{
if
(
!
data
)
return
this
.
$message
.
warning
(
"请扫描生产单号"
);
if
(
!
data
)
return
this
.
$message
.
warning
(
"请扫描生产单号"
);
await
this
.
$api
.
post
(
"/completeDelivery"
,
{
id
:
data
.
id
}).
then
(()
=>
{
await
this
.
$api
.
post
(
"/completeDelivery"
,
{
id
:
data
.
id
}).
then
(()
=>
{});
});
this
.
$message
.
success
(
"操作成功"
);
this
.
$message
.
success
(
"成功生产完成"
);
},
},
async
sureData
()
{
async
sureData
()
{
if
(
!
this
.
detail
||
Object
.
keys
(
this
.
detail
).
length
<=
1
)
{
if
(
!
this
.
detail
||
Object
.
keys
(
this
.
detail
).
length
<=
1
)
{
...
@@ -202,13 +164,15 @@ export default {
...
@@ -202,13 +164,15 @@ export default {
.
then
(()
=>
{
.
then
(()
=>
{
for
(
let
k
of
this
.
checkList
)
{
for
(
let
k
of
this
.
checkList
)
{
if
(
k
===
"print-setting"
||
k
===
"deviceId"
)
{
if
(
k
===
"print-setting"
||
k
===
"deviceId"
)
{
let
list
=
Object
.
keys
(
this
.
$dataStore
.
store
).
filter
(
el
=>
el
.
includes
(
k
));
let
list
=
Object
.
keys
(
this
.
$dataStore
.
store
).
filter
(
el
=>
el
.
includes
(
k
)
);
list
.
forEach
(
el
=>
{
list
.
forEach
(
el
=>
{
this
.
$dataStore
.
delete
(
el
);
this
.
$dataStore
.
delete
(
el
);
});
});
}
else
if
(
k
===
"token"
)
{
}
else
if
(
k
===
"token"
)
{
this
.
$dataStore
.
delete
(
'token'
);
this
.
$dataStore
.
delete
(
"token"
);
this
.
$dataStore
.
delete
(
'user'
);
this
.
$dataStore
.
delete
(
"user"
);
}
else
{
}
else
{
if
(
this
.
$dataStore
.
get
(
k
))
{
if
(
this
.
$dataStore
.
get
(
k
))
{
this
.
$dataStore
.
delete
(
k
);
this
.
$dataStore
.
delete
(
k
);
...
@@ -217,14 +181,13 @@ export default {
...
@@ -217,14 +181,13 @@ export default {
}
}
window
.
location
.
reload
();
window
.
location
.
reload
();
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{});
});
},
},
async
downloadImage
()
{
async
downloadImage
()
{
if
(
!
this
.
detail
||
Object
.
keys
(
this
.
detail
).
length
===
0
)
if
(
!
this
.
detail
||
Object
.
keys
(
this
.
detail
).
length
===
0
)
return
this
.
$message
.
warning
(
"请扫描生产单号"
);
return
this
.
$message
.
warning
(
"请扫描生产单号"
);
let
params
=
{
let
params
=
{
productionNo
:
this
.
detail
.
podProductionNo
,
productionNo
:
this
.
detail
.
factorySubOrderNumber
,
imgList
:
this
.
imgList
imgList
:
this
.
imgList
};
};
...
@@ -246,30 +209,28 @@ export default {
...
@@ -246,30 +209,28 @@ export default {
const
findByPodProductionNo
=
await
this
.
$api
.
post
(
const
findByPodProductionNo
=
await
this
.
$api
.
post
(
"/findByPodProductionNo"
,
"/findByPodProductionNo"
,
{
{
podProductionNo
:
this
.
productionNo
,
factorySubOrderNumber
:
this
.
productionNo
status
:
"IN_PRODUCTION"
}
}
);
);
this
.
detail
=
findByPodProductionNo
.
data
;
this
.
detail
=
findByPodProductionNo
.
data
;
console
.
log
(
findByPodProductionNo
.
data
,
"findByPodProductionNo.data"
);
ipcRenderer
.
send
(
"win-subScreen"
,
findByPodProductionNo
.
data
);
ipcRenderer
.
send
(
"win-subScreen"
,
findByPodProductionNo
.
data
);
// 根据生产单号查找 素材图片 下载到本地 然后返回本地地址去显示
// 根据生产单号查找 素材图片 下载到本地 然后返回本地地址去显示
let
res
=
await
this
.
$api
.
post
(
"/getPodProductionInfo"
,
{
let
res
=
await
this
.
$api
.
post
(
"/downloadBySubOrderNumber"
,
{
productionNo
:
this
.
productionNo
subOrderNumber
:
this
.
productionNo
});
this
.
imgList
=
[];
res
.
data
.
forEach
(
el
=>
{
this
.
imgList
=
this
.
imgList
.
concat
(
el
.
list
||
[]);
});
});
this
.
$dataStore
.
set
(
'production_no'
,
this
.
productionNo
)
this
.
$dataStore
.
set
(
"production_no"
,
this
.
productionNo
);
if
(
res
.
data
.
length
===
0
)
if
(
res
.
data
.
length
===
0
)
return
this
.
$message
.
warning
(
"未找到素材图!"
);
return
this
.
$message
.
warning
(
"未找到素材图!"
);
let
arr
=
[];
let
arr
=
[];
res
.
data
.
forEach
(
el
=>
{
res
.
data
.
forEach
(
el
=>
{
arr
.
push
(
el
);
if
(
el
.
list
)
{
if
(
el
.
list
)
{
el
.
list
.
forEach
(
it
=>
{
el
.
list
.
forEach
(
it
=>
{
arr
.
push
({
arr
.
push
(
it
);
...
it
,
...{
designId
:
el
.
designId
}
});
});
});
}
}
});
});
...
@@ -367,9 +328,8 @@ export default {
...
@@ -367,9 +328,8 @@ export default {
<!--
</el-tooltip>
-->
<!--
</el-tooltip>
-->
<el-dropdown
trigger=
"click"
@
command=
"command"
:hide-on-click=
"false"
>
<el-dropdown
trigger=
"click"
@
command=
"command"
:hide-on-click=
"false"
>
<el-button
style=
"height: 100%;margin-right: 0px"
size=
"small"
>
{{
<el-button
style=
"height: 100%;margin-right: 0px"
size=
"small"
grid
[
selectGridIndex
].
label
>
{{
grid
[
selectGridIndex
].
label
}}
}}
</el-button>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
:command=
"i"
v-for=
"(it, i) in grid"
:key=
"i"
>
<el-dropdown-item
:command=
"i"
v-for=
"(it, i) in grid"
:key=
"i"
>
...
@@ -492,7 +452,12 @@ export default {
...
@@ -492,7 +452,12 @@ export default {
</el-form-item>
</el-form-item>
<el-form-item
prop=
"language"
label=
"版本号"
>
<el-form-item
prop=
"language"
label=
"版本号"
>
<b>
{{
pkg
.
version
||
""
}}
</b>
<b>
{{
pkg
.
version
||
""
}}
</b>
<el-button
@
click=
"checkUpdate"
style=
"margin-left: 15px"
type=
"text"
>
检查更新
</el-button>
<el-button
@
click=
"checkUpdate"
style=
"margin-left: 15px"
type=
"text"
>
检查更新
</el-button
>
</el-form-item>
</el-form-item>
<!--
<el-form-item
label=
"自动打印模式"
>
-->
<!--
<el-form-item
label=
"自动打印模式"
>
-->
...
@@ -510,7 +475,7 @@ export default {
...
@@ -510,7 +475,7 @@ export default {
<el-tooltip
slot=
"reference"
content=
"设置"
>
<el-tooltip
slot=
"reference"
content=
"设置"
>
<el-button
style=
"margin-right: 8px"
size=
"small"
>
<el-button
style=
"margin-right: 8px"
size=
"small"
>
<img
<img
style=
"width: 1
5px;height: 15px"
style=
"width: 1
8px;height: 18px"
src=
"@/static/icon/shezhi.png"
src=
"@/static/icon/shezhi.png"
alt=
""
alt=
""
/>
/>
...
@@ -539,8 +504,7 @@ export default {
...
@@ -539,8 +504,7 @@ export default {
style=
"margin-left: 10px"
style=
"margin-left: 10px"
type=
"primary"
type=
"primary"
>
查询
>
查询
</el-button
</el-button>
>
<div
class=
"sure-btn"
>
<div
class=
"sure-btn"
>
<el-button
<el-button
@
click=
"sureData"
@
click=
"sureData"
...
@@ -562,13 +526,14 @@ export default {
...
@@ -562,13 +526,14 @@ export default {
</el-button>
</el-button>
</div>
</div>
<div
class=
"right-user"
>
<div
class=
"right-user"
>
<p>
{{
company
.
companyName
}}
</p>
<p
v-if=
"user && user.factory"
>
{{
user
.
factory
.
title
}}
</p>
<el-avatar
:src=
"avatar"
></el-avatar>
<el-dropdown
@
command=
"dropdownCommand"
>
<el-dropdown
@
command=
"dropdownCommand"
>
<b
style=
"cursor:pointer;"
>
{{
user
.
employeeName
}}
</b>
<div
style=
"margin-right: 20px"
>
<b
style=
"cursor:pointer;"
>
{{
user
.
account
}}
</b>
<i
class=
"el-icon-arrow-down"
></i>
</div>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<!--
<el-dropdown-item
command=
"clear"
>
清除缓存
</el-dropdown-item>
-->
<el-dropdown-item
command=
"company"
>
切换系统
</el-dropdown-item>
<el-dropdown-item
command=
"logout"
>
退出登录
</el-dropdown-item>
<el-dropdown-item
command=
"logout"
>
退出登录
</el-dropdown-item>
<el-dropdown-item
command=
"cache"
>
清除缓存
</el-dropdown-item>
<el-dropdown-item
command=
"cache"
>
清除缓存
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
...
@@ -577,12 +542,20 @@ export default {
...
@@ -577,12 +542,20 @@ export default {
</div>
</div>
<update-dialog
ref=
"updateDialog"
/>
<update-dialog
ref=
"updateDialog"
/>
<el-dialog
:visible
.
sync=
"cacheVisible"
title=
"清除缓存"
width=
"700px"
>
<el-dialog
:visible
.
sync=
"cacheVisible"
title=
"清除缓存"
width=
"700px"
>
<el-checkbox-group
style=
"display: flex;flex-direction: column"
v-model=
"checkList"
>
<el-checkbox-group
<el-checkbox
style=
"margin-bottom: 10px"
:label=
"item.value"
v-for=
"(item,i) in cacheList"
style=
"display: flex;flex-direction: column"
:key=
"i"
>
{{
item
.
label
}}
</el-checkbox>
v-model=
"checkList"
>
<el-checkbox
style=
"margin-bottom: 10px"
:label=
"item.value"
v-for=
"(item, i) in cacheList"
:key=
"i"
>
{{
item
.
label
}}
</el-checkbox
>
</el-checkbox-group>
</el-checkbox-group>
<template
#
footer
>
<template
#
footer
>
<el-button
@
click=
"cacheVisible =
false"
>
取消
</el-button>
<el-button
@
click=
"cacheVisible =
false"
>
取消
</el-button>
<el-button
@
click=
"clearCache"
type=
"primary"
>
清除
</el-button>
<el-button
@
click=
"clearCache"
type=
"primary"
>
清除
</el-button>
</
template
>
</
template
>
</el-dialog>
</el-dialog>
...
@@ -595,7 +568,7 @@ export default {
...
@@ -595,7 +568,7 @@ export default {
align-items
:
center
;
align-items
:
center
;
b
{
b
{
margin
:
0
10px
;
margin
:
0
3px
;
display
:
inline-block
;
display
:
inline-block
;
color
:
black
;
color
:
black
;
font-size
:
15px
;
font-size
:
15px
;
...
@@ -675,4 +648,12 @@ export default {
...
@@ -675,4 +648,12 @@ export default {
z-index
:
2
;
z-index
:
2
;
color
:
white
;
color
:
white
;
}
}
::v-deep
.el-color-picker__trigger
{
background
:
white
;
width
:
41px
;
}
::v-deep
.el-color-picker__color
{
border
:
none
!important
;
}
</
style
>
</
style
>
src/views/design/head/printDialog.vue
View file @
495695bd
...
@@ -903,7 +903,7 @@ export default {
...
@@ -903,7 +903,7 @@ export default {
<el-button
<el-button
@
click=
"getPrintCmd"
@
click=
"getPrintCmd"
type=
"primary"
type=
"primary"
style=
"width:
100%;height: 50px"
style=
"width:
98%;height: 50px"
>
打印
>
打印
</el-button>
</el-button>
</div>
</div>
...
@@ -929,10 +929,10 @@ export default {
...
@@ -929,10 +929,10 @@ export default {
}
}
.el-form
{
.el-form
{
height
:
8
4%
;
height
:
8
7%
;
display
:
flex
;
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column
;
padding-top
:
15px
;
padding-top
:
0
;
border-top
:
1px
solid
#ececec
;
border-top
:
1px
solid
#ececec
;
}
}
...
@@ -952,8 +952,7 @@ export default {
...
@@ -952,8 +952,7 @@ export default {
font-size
:
20px
;
font-size
:
20px
;
color
:
#409eff
;
color
:
#409eff
;
position
:
relative
;
position
:
relative
;
margin-bottom
:
30px
;
margin
:
15px
0
;
margin-top
:
30px
;
display
:
inline-block
;
display
:
inline-block
;
left
:
-15px
;
left
:
-15px
;
}
}
...
@@ -969,6 +968,7 @@ export default {
...
@@ -969,6 +968,7 @@ export default {
.setting-left
{
.setting-left
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
15px
30px
;
padding
:
15px
30px
;
background-color
:
white
;
background-color
:
white
;
...
@@ -981,8 +981,8 @@ export default {
...
@@ -981,8 +981,8 @@ export default {
}
}
.bottom-info
{
.bottom-info
{
padding
:
15px
0
;
padding
:
5px
0
;
margin-top
:
20px
;
margin-top
:
10px
;
font-size
:
14px
;
font-size
:
14px
;
justify-content
:
space-between
;
justify-content
:
space-between
;
border-top
:
1px
solid
#ececec
;
border-top
:
1px
solid
#ececec
;
...
@@ -1080,6 +1080,9 @@ export default {
...
@@ -1080,6 +1080,9 @@ export default {
justify-content
:
center
;
justify-content
:
center
;
}
}
}
}
::v-deep
.el-form-item
{
margin-bottom
:
9px
;
}
</
style
>
</
style
>
<
style
>
<
style
>
.my-popper
{
.my-popper
{
...
...
src/views/design/index.vue
View file @
495695bd
...
@@ -9,12 +9,10 @@ export default {
...
@@ -9,12 +9,10 @@ export default {
data
()
{
data
()
{
return
{
return
{
user
:
{},
user
:
{},
company
:
{}
};
};
},
},
mounted
()
{
mounted
()
{
this
.
user
=
this
.
$dataStore
.
get
(
"user"
);
this
.
user
=
this
.
$dataStore
.
get
(
"user"
);
this
.
company
=
this
.
$dataStore
.
get
(
"company"
);
this
.
$refs
.
updateDialog
.
checkUpdate
().
then
(
data
=>
{
this
.
$refs
.
updateDialog
.
checkUpdate
().
then
(
data
=>
{
if
(
data
)
{
if
(
data
)
{
// 有新版本更新
// 有新版本更新
...
@@ -27,7 +25,7 @@ export default {
...
@@ -27,7 +25,7 @@ export default {
<
template
>
<
template
>
<div
class=
"page"
>
<div
class=
"page"
>
<p-head
:
company=
"company"
:user=
"user"
/>
<p-head
:
user=
"user"
/>
<p-main
/>
<p-main
/>
<update-dialog
ref=
"updateDialog"
/>
<update-dialog
ref=
"updateDialog"
/>
</div>
</div>
...
...
src/views/design/main/imgSetting.vue
View file @
495695bd
...
@@ -41,7 +41,6 @@ export default {
...
@@ -41,7 +41,6 @@ export default {
item
:
{
item
:
{
handler
()
{
handler
()
{
if
(
this
.
item
)
{
if
(
this
.
item
)
{
let
setting
=
this
.
$dataStore
.
get
(
"setting"
);
let
setting
=
this
.
$dataStore
.
get
(
"setting"
);
this
.
item
.
y
=
(
this
.
item
.
y
-
this
.
item
.
h
/
2
);
this
.
item
.
y
=
(
this
.
item
.
y
-
this
.
item
.
h
/
2
);
this
.
item
.
x
=
(
this
.
item
.
x
-
this
.
item
.
w
/
2
);
this
.
item
.
x
=
(
this
.
item
.
x
-
this
.
item
.
w
/
2
);
...
@@ -139,7 +138,7 @@ export default {
...
@@ -139,7 +138,7 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"drawer"
:style=
"
{animation:`ltr-drawer-in .3s 1ms`}"
v-show="visible">
<div
class=
"drawer"
:style=
"
{animation:`ltr-drawer-in .3s 1ms`}"
>
<div
class=
"title"
>
<div
class=
"title"
>
图片编辑
图片编辑
</div>
</div>
...
@@ -246,6 +245,7 @@ export default {
...
@@ -246,6 +245,7 @@ export default {
</el-row>
</el-row>
</el-form>
</el-form>
</div>
</div>
<slot></slot>
</div>
</div>
</
template
>
</
template
>
...
@@ -299,6 +299,8 @@ export default {
...
@@ -299,6 +299,8 @@ export default {
position
:
fixed
;
position
:
fixed
;
border-right
:
1px
solid
#ececec
;
border-right
:
1px
solid
#ececec
;
height
:
calc
(
100vh
-
50px
);
height
:
calc
(
100vh
-
50px
);
display
:
flex
;
flex-direction
:
column
;
//
animation
:
ltr-drawer-in
.3s
1ms
;
//
animation
:
ltr-drawer-in
.3s
1ms
;
.title
{
.title
{
padding-bottom
:
10px
;
padding-bottom
:
10px
;
...
...
src/views/design/main/index.vue
View file @
495695bd
...
@@ -82,7 +82,7 @@ export default {
...
@@ -82,7 +82,7 @@ export default {
selectImgList
:
[],
selectImgList
:
[],
bus
:
0
,
bus
:
0
,
grid
,
grid
,
showImgSetting
:
false
,
showImgSetting
:
true
,
printDialogShow
:
true
,
printDialogShow
:
true
,
parentHeight
:
0
,
parentHeight
:
0
,
width
:
0
,
width
:
0
,
...
@@ -259,6 +259,8 @@ export default {
...
@@ -259,6 +259,8 @@ export default {
},
},
selectImg
(
it
,
i
)
{
selectImg
(
it
,
i
)
{
// this.selectImgIndexList.push(i)
// this.selectImgIndexList.push(i)
let
item
=
this
.
imgList
.
find
(
img
=>
img
.
fileName
===
it
.
fileName
)
if
(
item
)
return
// this.selectImgIndexList = Array.from(new Set(this.selectImgIndexList))
// this.selectImgIndexList = Array.from(new Set(this.selectImgIndexList))
this
.
getBackFile
([
it
],
file
=>
{
this
.
getBackFile
([
it
],
file
=>
{
this
.
imgHistoryList
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
imgList
)));
this
.
imgHistoryList
.
push
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
imgList
)));
...
@@ -635,17 +637,6 @@ export default {
...
@@ -635,17 +637,6 @@ export default {
<div
class=
"page-main"
>
<div
class=
"page-main"
>
<div
@
click=
"outsideClick"
class=
"main-bg"
>
<div
@
click=
"outsideClick"
class=
"main-bg"
>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"select-img"
v-if=
"selectImgList.length > 1"
>
<div
@
click=
"selectImg(it, i)"
v-for=
"(it, i) in selectImgList"
:key=
"i"
class=
"img-item"
>
<img
style=
"width: 100px;height: auto;"
:src=
"it.productionFile"
/>
<span>
{{
it
.
designId
}}
</span>
</div>
</div>
<div
:style=
"
{ height: imgHeight }" id="img">
<div
:style=
"
{ height: imgHeight }" id="img">
<div
id=
"line"
>
<div
id=
"line"
>
<div
<div
...
@@ -738,8 +729,19 @@ export default {
...
@@ -738,8 +729,19 @@ export default {
@
change=
"formChange"
@
change=
"formChange"
:item=
"returnItem"
:item=
"returnItem"
@
close=
"close"
@
close=
"close"
:visible=
"showImgSetting"
>
>
<div
class=
"select-img"
v-if=
"selectImgList.length"
>
<div
@
click=
"selectImg(it, i)"
v-for=
"(it, i) in selectImgList"
:key=
"i"
class=
"img-item"
>
<img
style=
"width: 140px;height: auto;"
:src=
"it.productionFile"
/>
<span>
{{
it
.
designId
}}
</span>
</div>
</div>
</img-setting>
</img-setting>
</div>
</div>
</
template
>
</
template
>
...
@@ -870,18 +872,12 @@ export default {
...
@@ -870,18 +872,12 @@ export default {
}
}
.select-img
{
.select-img
{
border-color
:
#409eff
;
border
:
1px
solid
#ececec
;
width
:
120px
;
width
:
100%
;
z-index
:
5
;
overflow
:
auto
;
overflow
:
auto
;
background-color
:
gray
;
height
:
calc
(
100%
-
251px
);
height
:
calc
(
100%
-
72px
);
padding
:
10px
;
padding
:
10px
;
position
:
fixed
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
left
:
0
;
bottom
:
0
;
border-right
:
1px
solid
#ececec
;
}
}
img
{
img
{
...
@@ -910,8 +906,9 @@ img {
...
@@ -910,8 +906,9 @@ img {
justify-content
:
center
;
justify-content
:
center
;
span
{
span
{
font-size
:
14px
;
margin
:
5px
0
;
margin
:
5px
0
;
color
:
white
;
color
:
black
;
}
}
}
}
...
...
src/views/design/updateDialog.vue
View file @
495695bd
...
@@ -91,7 +91,7 @@ export default {
...
@@ -91,7 +91,7 @@ export default {
console
.
log
(
"开始下载"
);
console
.
log
(
"开始下载"
);
if
(
this
.
item
.
fullUpdate
)
{
if
(
this
.
item
.
fullUpdate
)
{
// 全量更新
// 全量更新
const
domain
=
"https://
"
+
this
.
$dataStore
.
get
(
"company"
).
domain
;
const
domain
=
"https://
console.jomalls.com"
;
this
.
item
.
url
=
this
.
item
.
url
=
domain
+
this
.
item
.
fileList
[
0
].
versionPath
.
replace
(
"/data"
,
""
);
domain
+
this
.
item
.
fileList
[
0
].
versionPath
.
replace
(
"/data"
,
""
);
console
.
log
(
this
.
item
.
url
);
console
.
log
(
this
.
item
.
url
);
...
...
src/views/login/index.vue
View file @
495695bd
...
@@ -3,43 +3,26 @@ export default {
...
@@ -3,43 +3,26 @@ export default {
data
()
{
data
()
{
return
{
return
{
rules
:
{
rules
:
{
company
:
[
factoryCode
:
[
{
validator
:
this
.
validatePass
,
message
:
"请检查客户名称"
,
required
:
true
,
trigger
:
"blur"
},
{
message
:
"请输入工厂编码"
,
required
:
true
,
trigger
:
"blur"
}
],
],
loginName
:
[
account
:
[{
message
:
"请输入账号"
,
required
:
true
,
trigger
:
"blur"
}],
{
message
:
"请输入用户名"
,
required
:
true
,
trigger
:
"blur"
},
password
:
[{
message
:
"请输入密码"
,
required
:
true
,
trigger
:
"blur"
}]
],
password
:
[{
message
:
"请输入密码"
,
required
:
true
,
trigger
:
"blur"
}],
},
},
companyList
:
[],
userList
:
[],
userList
:
[],
company
:
null
,
authorityVisible
:
false
,
authorityVisible
:
false
,
remember
:
true
,
remember
:
true
,
authorityForm
:
{},
authorityForm
:
{},
form
:
{
form
:
{
loginName
:
""
,
factoryCode
:
""
,
user
:
""
,
account
:
""
,
company
:
""
,
password
:
""
password
:
""
,
}
},
};
};
},
},
created
()
{
created
()
{
// this.len = Object.keys(this.$dataStore.store).length
this
.
userList
=
this
.
$dataStore
.
get
(
'userList'
)
||
[]
console
.
log
(
this
.
$dataStore
,
"this.$dataStore"
);
// this.$dataStore.set('console_deviceId_Zhe Wang','920d79c4748c2a3c4111fb878ffe44a2')
this
.
company
=
this
.
$dataStore
.
get
(
"company"
);
this
.
userList
=
this
.
$dataStore
.
get
(
"userList"
)
||
[];
if
(
this
.
company
)
{
this
.
form
.
company
=
this
.
company
.
domain
.
replace
(
'.jomalls.com'
,
''
);
}
// if (user) {
// return this.$router.push('/design')
// }
this
.
getCompanyList
();
},
},
mounted
()
{
mounted
()
{
document
.
addEventListener
(
"keyup"
,
this
.
keyUp
);
document
.
addEventListener
(
"keyup"
,
this
.
keyUp
);
...
@@ -49,100 +32,26 @@ export default {
...
@@ -49,100 +32,26 @@ export default {
},
},
methods
:
{
methods
:
{
keyUp
(
e
)
{
keyUp
(
e
)
{
console
.
log
(
e
);
if
(
e
.
keyCode
===
13
)
{
if
(
e
.
keyCode
===
13
)
{
this
.
login
();
this
.
login
();
}
}
},
},
submitAuthority
()
{
this
.
$refs
.
authorityForm
.
validate
((
v
)
=>
{
if
(
v
)
{
this
.
$api
.
post
(
"/commitApply"
,
{
...
this
.
authorityForm
,
...
this
.
form
,
},
{
headers
:
{
company
:
this
.
form
.
company
+
'.jomalls.com'
,
},
}
)
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
this
.
authorityVisible
=
false
;
this
.
$message
.
success
(
"申请提交成功"
);
this
.
$dataStore
.
set
(
this
.
form
.
company
+
"_deviceId_"
+
this
.
form
.
loginName
,
res
.
data
.
id
);
}
});
}
});
},
validatePass
(
rule
,
value
,
callback
)
{
if
(
!
value
||
value
===
""
)
{
return
callback
(
new
Error
(
"请输入客户(例如demo)"
));
}
let
item
=
this
.
companyList
.
find
(
(
item
)
=>
item
.
domain
.
replace
(
".jomalls.com"
,
""
)
===
value
);
if
(
item
)
{
return
callback
();
}
else
{
return
callback
(
new
Error
(
"未查找到该客户"
));
}
},
async
login
()
{
async
login
()
{
// if (this.form.auth) {
this
.
$refs
.
formRef
.
validate
(
async
valid
=>
{
// this.$dataStore.set(this.form.auth.split(",")[0], this.form.auth.split(",")[1]);
// console.log("存储成功");
// console.log(this.$dataStore.store);
//
// }
this
.
$refs
.
formRef
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
let
f
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
));
let
f
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
));
let
{
data
}
=
await
this
.
$api
.
post
(
"/login"
,
f
);
if
(
!
f
.
deviceId
)
{
this
.
$dataStore
.
set
(
"user"
,
{
...
data
.
sysUser
,...{
token
:
data
.
token
}
});
f
.
deviceId
=
this
.
$dataStore
.
get
(
console
.
log
(
this
.
$dataStore
);
f
.
company
+
"_deviceId_"
+
this
.
form
.
loginName
);
}
if
(
f
.
company
){
f
.
company
=
f
.
company
.
includes
(
'.jomalls.com'
)?
f
.
company
:
f
.
company
+
'.jomalls.com'
}
if
(
!
f
.
deviceId
)
delete
f
.
deviceId
;
let
{
data
,
code
,
message
}
=
await
this
.
$api
.
post
(
"/login"
,
f
);
if
(
code
===
411
)
{
this
.
authorityVisible
=
true
;
this
.
authorityForm
=
{};
return
this
.
$message
.
error
(
message
);
}
data
=
{
...
data
.
sysUser
,
...{
token
:
data
.
token
,
},
};
delete
data
.
sysMenus
;
delete
data
.
sysUser
;
let
item
=
this
.
companyList
.
find
((
item
)
=>
item
.
domain
===
f
.
company
);
console
.
log
(
item
,
111222
);
this
.
$dataStore
.
set
(
"user"
,
data
);
this
.
$dataStore
.
set
(
"company"
,
item
);
console
.
log
(
this
.
$dataStore
);
if
(
this
.
remember
)
{
if
(
this
.
remember
)
{
let
userList
=
this
.
$dataStore
.
get
(
"userList"
);
let
userList
=
this
.
$dataStore
.
get
(
"userList"
);
if
(
userList
)
{
if
(
userList
)
{
if
(
if
(
!
userList
.
find
(
!
userList
.
find
(
(
el
)
=>
el
=>
el
.
loginName
===
f
.
loginName
&&
el
.
company
===
f
.
company
el
.
account
===
f
.
account
&&
el
.
factoryCode
===
f
.
factoryCode
)
)
)
{
)
{
userList
.
push
(
f
);
userList
.
push
(
f
);
...
@@ -158,21 +67,11 @@ export default {
...
@@ -158,21 +67,11 @@ export default {
});
});
},
},
userChange
(
v
)
{
userChange
(
v
)
{
if
(
v
===
""
)
{
this
.
form
.
account
=
this
.
userList
[
v
].
account
;
this
.
form
.
deviceId
=
""
;
this
.
form
.
factoryCode
=
this
.
userList
[
v
].
factoryCode
;
return
;
}
console
.
log
(
this
.
userList
,
v
);
this
.
form
.
company
=
this
.
userList
[
v
].
company
.
replace
(
'.jomalls.com'
,
''
);
this
.
form
.
loginName
=
this
.
userList
[
v
].
loginName
;
this
.
form
.
password
=
this
.
userList
[
v
].
password
;
this
.
form
.
password
=
this
.
userList
[
v
].
password
;
this
.
form
.
deviceId
=
this
.
userList
[
v
].
deviceId
;
}
},
}
async
getCompanyList
()
{
let
{
data
}
=
await
this
.
$api
.
get
(
"/getCompanyList"
);
this
.
companyList
=
data
.
records
;
},
},
};
};
</
script
>
</
script
>
...
@@ -195,45 +94,24 @@ export default {
...
@@ -195,45 +94,24 @@ export default {
<el-option
<el-option
v-for=
"(it, i) in userList"
v-for=
"(it, i) in userList"
:key=
"i"
:key=
"i"
:label=
"`${it.
loginName}(${it.company.split('.')[0]})`"
:label=
"`${it.
account}(${it.factoryCode})`"
:value=
"i"
:value=
"i"
></el-option>
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"!company"
prop=
"company"
>
<el-form-item
prop=
"factoryCode"
>
<!-- <el-select prefix-icon="el-icon-monitor" v-model="form.company">-->
<el-input
<!-- <el-option v-for="(it,i) in companyList" :key="i" :label="it.companyName" :value="it.domain.replace('.jomalls.com','')"></el-option>-->
placeholder=
"工厂编码"
<!-- </el-select>-->
prefix-icon=
"el-icon-s-shop"
<el-input
placeholder=
"客户(例如demo)"
prefix-icon=
"el-icon-monitor"
v-model=
"form.company"
v-model=
"form.factoryCode"
clearable
>
clearable
<
template
#
append
>
></el-input>
.jomalls.com
</
template
>
</el-input>
<!-- <el-select-->
<!-- filterable-->
<!-- style="width: 100%"-->
<!-- placeholder="系统"-->
<!-- v-model="form.company"-->
<!-- clearable-->
<!-- >-->
<!-- <template slot="prefix">-->
<!-- <i class="el-icon-monitor"></i>-->
<!-- </template>-->
<!-- <el-option-->
<!-- v-for="(it, i) in companyList"-->
<!-- :key="i"-->
<!-- :label="it.companyName"-->
<!-- :value="it.domain"-->
<!-- ></el-option>-->
<!-- </el-select>-->
</el-form-item>
</el-form-item>
<el-form-item
prop=
"account"
>
<el-form-item
prop=
"loginName"
>
<el-input
<el-input
placeholder=
"
用户名"
placeholder=
"
账号"
prefix-icon=
"el-icon-user"
prefix-icon=
"el-icon-user"
v-model=
"form.
loginName"
v-model=
"form.
account"
clearable
clearable
></el-input>
></el-input>
</el-form-item>
</el-form-item>
...
@@ -247,10 +125,6 @@ export default {
...
@@ -247,10 +125,6 @@ export default {
clearable
clearable
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<!-- <el-form-item v-if="len===0" prop="授权信息">-->
<!-- <el-input placeholder="授权信息" prefix-icon="el-icon-lock" v-model="form.auth"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<div
class=
"check"
>
<div
class=
"check"
>
<el-checkbox
v-model=
"remember"
>
记住账号
</el-checkbox>
<el-checkbox
v-model=
"remember"
>
记住账号
</el-checkbox>
</div>
</div>
...
@@ -267,41 +141,6 @@ export default {
...
@@ -267,41 +141,6 @@ export default {
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
<el-dialog
:close-on-click-modal=
"false"
title=
"权限申请"
:visible
.
sync=
"authorityVisible"
top=
"15%"
width=
"400px"
>
<el-form
:model=
"authorityForm"
size=
"mini"
ref=
"authorityForm"
label-width=
"80px"
>
<el-form-item
label=
"设备名称"
prop=
"deviceName"
required
>
<el-input
v-model=
"authorityForm.deviceName"
></el-input>
</el-form-item>
<el-form-item
label=
"授权类型"
prop=
"authType"
required
>
<el-radio
v-model=
"authorityForm.authType"
label=
"1"
>
一次授权
</el-radio>
<el-radio
v-model=
"authorityForm.authType"
label=
"2"
>
永久授权
</el-radio>
</el-form-item>
</el-form>
<span
slot=
"footer"
>
<el-button
size=
"mini"
@
click=
"authorityVisible = false"
>
取 消
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"submitAuthority"
>
提交
</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
</template>
...
...
vue.config.js
View file @
495695bd
...
@@ -106,6 +106,10 @@ module.exports = {
...
@@ -106,6 +106,10 @@ module.exports = {
{
{
from
:
"./logs/"
,
from
:
"./logs/"
,
to
:
"../logs"
to
:
"../logs"
},
{
from
:
"./config/"
,
to
:
"../config"
}
}
]
]
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment