Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
66fdd543
Commit
66fdd543
authored
Sep 01, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'product' of
http://git.mes123.com/zhouyx/mes-ui
into product
parents
90f57519
0c4ad817
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
2928 additions
and
2052 deletions
+2928
-2052
dataGrid.vue
components/page/dataGrid.vue
+83
-0
api.js
components/page/import/api.js
+37
-0
detailExcel.vue
components/page/import/detailExcel.vue
+121
-0
process.vue
components/page/import/process.vue
+482
-0
opration.vue
components/page/opration.vue
+73
-68
npm-shrinkwrap.json
npm-shrinkwrap.json
+1
-1
index.vue
pages/import/index.vue
+1
-1
index.vue
pages/materiel/classification/index.vue
+25
-9
masterData.vue
pages/materiel/classification/masterData.vue
+141
-129
index.vue
pages/materiel/masterData/index.vue
+34
-10
masterData.vue
pages/materiel/masterData/masterData.vue
+401
-368
index.vue
pages/mesPlan/index.vue
+1000
-984
api.js
pages/resource/resource/api.js
+4
-0
index.vue
pages/resource/resource/index.vue
+520
-479
iview.js
plugins/iview.js
+2
-0
route.js
plugins/route.js
+1
-1
config.js
static/config.js
+1
-1
account.js
store/admin/account.js
+1
-1
No files found.
components/page/dataGrid.vue
View file @
66fdd543
...
...
@@ -21,6 +21,9 @@
</div>
<div
class=
"btns"
>
<slot
name=
"buttons"
></slot>
<Button
@
click=
"export2Excel"
v-if=
"exportTitle.length>0"
>
导出
</Button>
<Button
v-if=
"set&&type=='table'"
@
click=
"config=!config"
>
<Icon
type=
"md-build"
title=
"列设置"
/>
</Button>
...
...
@@ -64,6 +67,7 @@
</li>
</ul>
</Drawer>
<FooterToolbar
v-if=
"batch"
v-show=
"footerToolbar"
>
<div
class=
"tip"
>
已选
{{
selectItems
.
length
}}
项
</div>
<slot
name=
"batch"
></slot>
...
...
@@ -212,6 +216,10 @@ export default {
type
:
Number
,
default
:
40
,
},
exportTitle
:
{
type
:
String
,
default
:
""
,
}
},
created
()
{
this
.
columns
.
forEach
((
u
)
=>
{
...
...
@@ -462,6 +470,81 @@ export default {
this
.
footerToolbar
=
false
;
this
.
$refs
.
table
.
selectAll
(
false
);
},
//导出excel
export2Excel
()
{
//当前显示数据
var
where
=
[];
var
conditions
=
this
.
conditions
;
if
(
conditions
)
{
Object
.
keys
(
conditions
).
forEach
((
u
)
=>
{
let
v
=
conditions
[
u
].
value
;
let
op
=
conditions
[
u
].
op
;
if
(
!
this
.
$u
.
isNull
(
v
))
{
if
(
op
==
"Range"
)
{
let
times
=
[];
v
.
map
((
u
)
=>
{
if
(
!
this
.
$u
.
isNull
(
u
))
{
times
.
push
(
this
.
$u
.
toTime
(
u
));
}
});
v
=
times
.
join
(
","
);
}
else
if
(
op
.
indexOf
(
"In"
)
>
-
1
)
{
v
=
v
.
join
(
","
);
}
if
(
!
this
.
$u
.
isNull
(
v
))
{
where
.
push
({
fieldName
:
u
,
fieldValue
:
v
,
conditionalType
:
op
,
});
}
}
});
}
let
searchs
=
{
pageIndex
:
1
,
conditions
:
where
,
pageSize
:
1000
}
this
.
$api
.
post
(
this
.
action
,
searchs
).
then
((
r
)
=>
{
let
list
=
[]
list
=
r
.
result
.
items
;
const
tHeader
=
[];
// 设置Excel的表格第一行的标题
const
filterVal
=
[];
//list里对象的属性
var
tempCol
=
[];
var
columnsCur
=
this
.
$u
.
clone
(
this
.
columnsNow
);
//导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur
.
forEach
((
el
)
=>
{
if
((
el
.
hide
&&
!
el
.
import
)
||
(
!
el
.
hide
&&
el
.
key
!=
"action"
&&
el
.
type
!=
"selection"
&&
el
.
key
!=
"ico"
))
{
if
(
el
.
code
)
{
tempCol
.
push
({
key
:
el
.
key
,
code
:
el
.
code
});
//临时存放code数据字典的字段及对应的数据字典code
}
tHeader
.
push
(
el
.
title
);
filterVal
.
push
(
el
.
key
);
}
});
list
.
forEach
((
e
)
=>
{
//给导出数据增加数据字典对应的name
tempCol
.
forEach
((
ele
)
=>
{
e
[
ele
.
key
]
=
this
.
$u
.
dirName
(
this
.
$store
.
getters
.
dictionaryByKey
(
ele
.
code
),
e
[
ele
.
key
]
);
});
});
let
nowDate
=
this
.
$u
.
getNowTime
();
//年月日时分秒yyyyMMddhhmmss
//获取导出数据结束
this
.
$u
.
outExcel
(
this
.
exportTitle
+
"("
+
nowDate
+
")"
,
tHeader
,
filterVal
,
list
);
});
},
},
computed
:
{
columnsNow
()
{
...
...
components/page/import/api.js
0 → 100644
View file @
66fdd543
import
Api
from
'@/plugins/request'
import
{
getJSON
}
from
'js-cookie'
;
export
default
{
index
:
`
${
systemUrl
}
/importcenter/paged`
,
paged
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/importcenter/paged`
,
params
);
},
get
(
params
)
{
return
Api
.
get
(
`
${
systemUrl
}
/importcenter/get`
,
params
);
},
create
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/importcenter/create`
,
params
);
},
update
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/importcenter/update`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
systemUrl
}
/importcenter/delete`
,
{
params
:
{
id
:
id
}
});
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/importcenter/batchdelete`
,
params
);
},
openExcel
(
params
)
{
//处理时打开以前上传的excel返回数据
return
Api
.
post
(
`
${
systemUrl
}
/importcenter/open`
,
params
);
},
importUser
(
params
)
{
//用户管理导入
return
Api
.
post
(
`
${
systemUrl
}
/userimportservice/import`
,
params
);
},
updateimportstatus
(
params
)
{
//用户管理导入
return
Api
.
post
(
`
${
systemUrl
}
/importcenter/updateimportstatus`
,
params
);
},
}
components/page/import/detailExcel.vue
0 → 100644
View file @
66fdd543
<
template
>
<div
class=
"h100"
>
<Tabs
type=
"card"
width=
"100"
>
<TabPane
label=
"excel数据"
>
<TablePaste
hide-table
:input-props=
"inputProps"
@
on-success=
"handleSuccess"
@
on-error=
"handleError"
/>
</TabPane>
<TabPane
label=
"预览"
>
<Table
:border=
"true"
:columns=
"columnsImport"
:data=
"excelData"
:height=
"tableHeight"
ref=
"tableExcel"
class=
"tableCommon"
></Table>
</TabPane>
</Tabs>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"detailExcel"
,
data
()
{
return
{
entity
:
{},
downUrl
:
fileUrlDown
,
fileUrlPath
:
""
,
excelRows
:
100
,
tableHeight
:
''
,
inputProps
:
{
rows
:
10
,
placeholder
:
"请从Excel复制一段表格数据,粘贴在这里"
,
},
columnsImport
:
[],
excelData
:
[]
};
},
props
:
{
eid
:
Number
,
},
created
()
{
this
.
excelRows
=
parseInt
((
window
.
innerHeight
-
231
)
/
21
)
+
1
;
this
.
inputProps
.
rows
=
this
.
excelRows
this
.
tableHeight
=
window
.
innerHeight
-
200
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
excelRows
=
parseInt
((
window
.
screenHeight
-
231
)
/
21
)
+
1
;
this
.
inputProps
.
rows
=
this
.
excelRows
this
.
tableHeight
=
window
.
innerHeight
-
200
})();
};
},
methods
:
{
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
downFile
(
path
)
{
//alert(path)
let
truePath
=
path
;
if
(
truePath
.
length
>
2
)
{
if
(
truePath
.
substring
(
0
,
7
).
toLowerCase
()
==
"http://"
||
truePath
.
substring
(
0
,
8
).
toLowerCase
()
==
"https://"
)
{
window
.
open
(
truePath
,
"_blank"
);
}
else
{
this
.
fileUrlPath
=
this
.
downUrl
+
path
;
window
.
open
(
this
.
fileUrlPath
,
"_blank"
);
}
}
},
//粘贴excel成功
handleSuccess
(
tableData
)
{
//初始化数据
this
.
excelData
=
[];
this
.
columnsImport
=
[];
//处理colum和data
let
tabColum
=
tableData
.
columns
let
tabData
=
tableData
.
data
let
arrData
=
[]
tabData
.
forEach
(
ele
=>
{
let
objData
=
{}
tabColum
.
forEach
(
el
=>
{
objData
[
el
.
title
]
=
ele
[
el
.
key
]
})
arrData
.
push
(
objData
)
})
//处理title和key一致
tabColum
.
forEach
(
el
=>
{
el
.
key
=
el
.
title
})
this
.
columnsImport
=
tabColum
;
this
.
columnsImport
.
unshift
({
type
:
'index'
,
width
:
80
,
align
:
'right'
,
title
:
'序号'
})
this
.
excelData
=
arrData
;
this
.
$emit
(
"on-datalength"
,
this
.
excelData
.
length
)
},
//粘贴excel失败
handleError
(
tableData
,
errorIndex
)
{
//console.log(tableData, errorIndex);
this
.
$Message
.
error
(
"表格数据有误"
);
},
//粘贴excel相关end
},
watch
:
{
eid
(
v
)
{
if
(
v
>
0
)
{
this
.
load
(
v
);
}
},
},
};
</
script
>
components/page/import/process.vue
0 → 100644
View file @
66fdd543
<
template
>
<Modal
v-model=
"ImportModal"
title=
"导入"
fullscreen
footer-hide
@
on-cancel=
"cancelModal"
>
<div
class=
"table-content"
>
<div
class=
"table-tools"
>
<div
class=
"table-search"
>
<Form
inline
>
<FormItem>
<div
style=
"height:34px;overflow: hidden;padding:0;width:120px"
>
<Upload
action
:before-upload=
"beforeUpload"
ref=
"uploadfile"
:format=
"formatList"
>
<Button
icon=
"ios-cloud-upload-outline"
>
上传文件
</Button>
</Upload>
</div>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"openInfoModal"
:disabled=
"btnIm"
>
导入
</Button>
</FormItem>
</Form>
</div>
<div
class=
"btns"
>
<Form
inline
>
<FormItem>
<RadioGroup
v-model=
"excelType"
type=
"button"
@
on-change=
"changeExcel"
size=
"small"
>
<Tooltip
content=
"文件数据"
>
<Radio
label=
"0"
>
<Icon
type=
"ios-list-box-outline"
/>
</Radio>
</Tooltip>
<Tooltip
content=
"粘贴Excel数据"
>
<Radio
label=
"1"
>
<Icon
type=
"ios-copy"
/>
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</Form>
</div>
</div>
<div
class=
"table-main"
ref=
"main"
>
<Table
:border=
"true"
:columns=
"columnsImport"
:data=
"excelData"
:height=
"tdHeightExcel"
:no-data-text=
"noDataText"
ref=
"table"
class=
"tableCommon"
v-if=
"tableImport"
></Table>
<component
:is=
"detailExcel"
ref=
"comExcel"
@
on-datalength=
"datalength"
/>
</div>
<FooterToolbar
v-if=
"sheetNames.length>1&&tableImport"
>
<Form
inline
>
<FormItem>
<Tabs
:animated=
"false"
:value=
"0"
@
on-click=
"sheetClick"
>
<TabPane
:label=
"item"
v-for=
"(item,index) in sheetNames"
:key=
"index"
></TabPane>
</Tabs>
</FormItem>
</Form>
</FooterToolbar>
<Modal
v-model=
"infoModal"
:title=
"titleInfo"
fullscreen
>
<DataGrid
:tool=
"false"
:page=
"false"
:columns=
"colsIm"
:data=
"dataIm"
:height=
"tdHeightExcel+30"
ref=
"dataImport"
></DataGrid>
<div
slot=
"footer"
>
<Button
@
click=
"infoModal=false"
>
关闭
</Button>
<Button
type=
"primary"
@
click=
"importOk"
v-show=
"imBtn"
>
确定导入
</Button>
</div>
</Modal>
</div>
</Modal>
</
template
>
<
script
>
import
XLSX
from
"xlsx"
;
import
{
Switch
}
from
"view-design"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
tabVal
:
0
,
infoModal
:
false
,
entity
:
{},
downUrl
:
fileUrlDown
,
fileUrlPath
:
""
,
disabled
:
false
,
detailExcel
:
null
,
tableImport
:
true
,
tdHeightExcel
:
""
,
excelData
:
[],
excelDataBack
:
[],
//临时存储原始数据
formatList
:
[
"xlsx"
],
columnsImport
:
[],
departArr
:
[],
//部门list
sheetNames
:
[],
//excel的表明
workBook
:
{},
openDatas
:
[],
dataType
:
0
,
//new
colsIm
:
[],
dataIm
:
[],
excelType
:
'0'
,
btnIm
:
true
,
titleInfo
:
''
,
noDataText
:
'暂无数据'
,
imBtn
:
true
,
columnsIm
:
this
.
columns
,
ImportModal
:
this
.
open
,
batchImportUrl
:
''
,
};
},
props
:
{
eid
:
Number
,
data
:
{
// 当作table使用,直接显示数据
type
:
Array
,
default
:
function
()
{
return
[];
},
},
columns
:
{
//要显示的字段
type
:
Array
,
default
:
[],
},
open
:
{
type
:
Boolean
,
default
:
false
}
},
created
()
{
this
.
tdHeightExcel
=
window
.
innerHeight
-
180
;
//导出对列表头进行预加载start
this
.
$api
.
get
(
`
${
systemUrl
}
/Department/GetDepartments`
).
then
((
r
)
=>
{
this
.
departArr
=
r
.
result
.
items
;
});
//导出对列表头进行预加载end
},
mounted
()
{
//if (this.eid > 0) {
// this.load(this.eid);
//}
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
tdHeightExcel
=
window
.
screenHeight
-
180
;
})();
};
},
methods
:
{
//重新处理colum
loadColum
(
columns
)
{
let
tempCol
=
this
.
$u
.
clone
(
columns
);
tempCol
.
forEach
((
ele
,
index
)
=>
{
if
(
ele
.
key
==
"action"
||
ele
.
type
==
"selection"
||
ele
.
key
==
"ico"
)
{
ele
.
hide
=
true
;
}
});
this
.
colsIm
=
tempCol
;
this
.
colsIm
.
unshift
({
type
:
'index'
,
width
:
80
,
align
:
'right'
,
title
:
'序号'
},
{
key
:
"ico"
,
title
:
" "
,
align
:
"center"
,
width
:
60
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
""
},
[
h
(
params
.
row
.
ico
?
"op"
:
""
,
{
attrs
:
{
icon
:
"ios-alert"
,
type
:
"icon"
,
title
:
"数据不合法"
,
color
:
"#ff9900"
}
}),
]);
},
})
//处理原始数据和表头进行对应
let
temCol
=
this
.
$u
.
clone
(
this
.
colsIm
);
//原始数据表头
let
temColPage
=
this
.
$u
.
clone
(
columns
);
//需要显示的页面的表头
//let temData = this.$u.clone(this.excelDataBack); //原始数据
let
temData
=
[];
//原始数据
if
(
this
.
excelType
==
"0"
)
{
temData
=
this
.
$u
.
clone
(
this
.
excelDataBack
)
}
else
{
temData
=
this
.
$u
.
clone
(
this
.
$refs
.
comExcel
.
excelData
)
}
let
arrTitleUse
=
[];
////使用数据字典的字段
temColPage
.
forEach
((
elCode
)
=>
{
if
(
elCode
.
code
)
{
arrTitleUse
.
push
({
key
:
elCode
.
key
,
code
:
elCode
.
code
,
});
}
});
let
useData
=
[];
//重新组织list列表数据
temData
.
forEach
((
elData
,
index
)
=>
{
let
objTm
=
{};
temCol
.
forEach
((
elTitle
)
=>
{
objTm
[
elTitle
.
key
]
=
elData
[
elTitle
.
title
];
});
useData
.
push
(
objTm
);
});
//对列表里的部门及数据字典项进行处理
useData
.
forEach
(
eles
=>
{
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if
(
eles
.
departmentTitle
&&
eles
.
departmentTitle
!=
""
&&
(
!
eles
.
departmentId
||
eles
.
departmentId
==
""
)
)
{
this
.
departArr
.
forEach
((
e
)
=>
{
if
(
eles
.
departmentTitle
&&
eles
.
departmentTitle
==
e
.
name
)
{
eles
.
departmentId
=
e
.
id
;
}
});
}
else
if
(
//如果导入文件没有departmentTitle,但存在departmentid的话,通过id获取departmentTitle
eles
.
departmentId
&&
eles
.
departmentId
+
""
!=
""
&&
(
!
eles
.
departmentTitle
||
eles
.
departmentTitle
==
""
)
)
{
this
.
departArr
.
forEach
((
e
)
=>
{
if
(
eles
.
departmentId
&&
eles
.
departmentId
==
e
.
id
)
{
eles
.
departmentTitle
=
e
.
name
;
}
});
}
arrTitleUse
.
forEach
((
elem
)
=>
{
if
(
eles
[
elem
.
key
]
&&
eles
[
elem
.
key
]
!=
""
&&
eles
[
elem
.
key
]
!=
null
)
{
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles
[
elem
.
key
]
=
this
.
$u
.
dirCode
(
this
.
$store
.
getters
.
dictionaryByKey
(
elem
.
code
),
eles
[
elem
.
key
]
);
}
});
})
this
.
dataIm
=
useData
;
let
tempData
=
this
.
$u
.
clone
(
this
.
dataIm
);
this
.
$emit
(
"on-get-data"
,
tempData
)
},
//导入excel文件
async
beforeUpload
(
file
)
{
//初始化
this
.
sheetNames
=
[];
this
.
workBook
=
{};
this
.
$refs
.
uploadfile
.
clearFiles
();
//清除上一次上传文件列表
//上传成功后的读取到excel信息
this
.
workBook
=
await
this
.
$u
.
readXLSX
(
file
);
this
.
sheetNames
=
this
.
workBook
.
SheetNames
;
//execel里的表明
this
.
btnIm
=
false
;
this
.
dealSheet
(
0
);
//默认显示第一个表
return
false
;
},
//对上传的excel表信息进行处理,不对表头进行处理
dealSheet
(
index
)
{
this
.
dataType
=
1
;
this
.
columnsImport
=
[];
this
.
excelData
=
[];
this
.
excelDataBack
=
[];
const
sheet2JSONOpts
=
{
defval
:
""
,
//给defval赋值为空的字符串
};
var
csv
=
XLSX
.
utils
.
sheet_to_csv
(
this
.
workBook
.
Sheets
[
this
.
workBook
.
SheetNames
[
index
]],
sheet2JSONOpts
);
var
lines
=
csv
.
split
(
"
\n
"
);
//第一行标题
var
headers
=
lines
[
0
].
split
(
","
);
var
headersNow
=
[];
headersNow
.
push
({
type
:
'index'
,
width
:
80
,
align
:
'right'
,
title
:
'序号'
})
headers
.
forEach
((
elHead
)
=>
{
let
headObj
=
{};
headObj
.
title
=
elHead
;
headObj
.
key
=
elHead
;
headersNow
.
push
(
headObj
);
});
this
.
columnsImport
=
headersNow
;
var
result
=
[];
for
(
var
i
=
1
;
i
<
lines
.
length
-
1
;
i
++
)
{
var
obj
=
{};
var
currentline
=
lines
[
i
].
split
(
","
);
for
(
var
j
=
0
;
j
<
headers
.
length
;
j
++
)
{
obj
[
headers
[
j
]]
=
currentline
[
j
];
}
result
.
push
(
obj
);
}
this
.
excelData
=
result
;
this
.
excelDataBack
=
result
;
this
.
changeExcel
(
0
)
},
//切换sheet表重新加载
sheetClick
(
val
)
{
this
.
tabVal
=
val
this
.
dealSheet
(
val
);
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
cancelExcel
()
{
this
.
excelData
=
[];
this
.
excelDataBack
=
[];
this
.
$refs
.
uploadfile
.
clearFiles
();
let
parms
=
{
status
:
1
,
id
:
this
.
eid
}
//导入中心列表数据状态更新
this
.
$emit
(
"on-close"
);
},
//打开导入数据格式化后的窗口
openInfoModal
()
{
if
((
this
.
excelType
==
'0'
&&
this
.
excelData
.
length
>
0
)
||
(
this
.
excelType
==
'1'
&&
this
.
$refs
.
comExcel
.
excelData
.
length
>
0
))
{
this
.
imBtn
=
true
;
this
.
loadColum
(
this
.
columnsIm
);
this
.
titleInfo
=
"批量导入"
;
this
.
infoModal
=
true
;
}
else
{
this
.
imBtn
=
false
;
this
.
$Message
.
error
(
"没有可导入的数据!"
)
}
},
//确定导入按钮操作
importOk
()
{
let
imData
=
[];
let
imDataError
=
[]
this
.
dataIm
.
forEach
(
ele
=>
{
if
(
!
ele
.
ico
)
{
imData
.
push
(
ele
)
}
else
{
imDataError
.
push
(
ele
)
}
})
this
.
$api
.
post
(
this
.
batchImportUrl
,
{
list
:
imData
}).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"批量导入成功"
+
imData
.
length
+
"条数据"
)
this
.
dataIm
=
imDataError
this
.
$emit
(
"on-ok"
)
}
else
{
this
.
$Message
.
error
(
"批量导入失败"
)
}
}).
catch
(
err
=>
{
this
.
$Message
.
error
(
"数据异常!"
);
});;
},
//切换列表和excel按钮
changeExcel
(
val
)
{
if
(
val
==
1
)
{
this
.
tableImport
=
false
this
.
detailExcel
=
()
=>
import
(
"./detailExcel"
);
this
.
excelType
=
'1'
;
this
.
btnIm
=
true
}
else
{
this
.
detailExcel
=
null
;
this
.
tableImport
=
true
;
this
.
excelType
=
'0'
;
if
(
this
.
excelData
.
length
>
0
)
{
this
.
btnIm
=
false
}
else
{
this
.
btnIm
=
true
}
}
},
datalength
(
val
)
{
if
(
val
>
0
)
{
this
.
btnIm
=
false
}
},
cancelModal
()
{
this
.
$emit
(
'on-cancel'
)
},
//主页面里第二次处理数据
deelData
(
url
,
columns
,
formatList
)
{
this
.
dataIm
=
formatList
this
.
batchImportUrl
=
url
},
l
(
key
)
{
key
=
"user"
+
"."
+
key
;
return
this
.
$t
(
key
);
},
},
watch
:
{
"columns"
()
{
this
.
columns
.
forEach
((
u
)
=>
{
if
(
!
u
.
hide
)
{
u
.
hide
=
false
;
}
});
this
.
colsIm
=
this
.
$u
.
clone
(
this
.
columns
);
this
.
columnsIm
=
this
.
$u
.
clone
(
this
.
columns
)
},
open
(
v
)
{
this
.
ImportModal
=
v
}
},
};
</
script
>
<
style
lang=
"less"
>
.table-content {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
.tip {
display: inline;
}
form {
display: inline-block;
.ivu-form-item {
margin: 0;
vertical-align: middle;
}
}
.table-main {
width: 100%;
text-align: left;
padding: 0;
display: block;
overflow-y: auto;
flex-grow: 1;
tr td .ivu-table-cell {
padding: 0 5px;
}
overflow-x: hidden;
}
.table-tools {
display: flex;
line-height: 50px;
.table-search {
flex-grow: 1;
}
.btns {
min-width: 200px;
text-align: right;
}
}
.table-footer {
line-height: 45px;
background: #f5f5f5;
}
.ivu-footer-toolbar {
text-align: left;
background: #f5f5f5;
.ivu-footer-toolbar-right {
float: left;
}
}
}
</
style
>
components/page/opration.vue
View file @
66fdd543
<
template
>
<Tooltip
trigger=
"hover"
v-if=
"title"
:content=
"title"
placement=
"top-end"
>
<Tooltip
trigger=
"hover"
v-if=
"title"
:content=
"title"
placement=
"top-end"
>
<a
class=
"op"
:class=
"css"
@
click=
"handler"
>
<slot>
<Icon
v-if=
"type=='icon'"
:type=
"icon
"
/>
<span
v-else=
"type=='text'"
v-text=
"text"
></span>
</slot>
<slot>
<Icon
v-if=
"type=='icon'"
:type=
"icon"
:color=
"color
"
/>
<span
v-else=
"type=='text'"
v-text=
"text"
></span>
</slot>
</a>
</Tooltip>
<a
class=
"op"
v-else
:class=
"css"
@
click=
"handler"
>
</Tooltip>
<a
class=
"op"
v-else
:class=
"css"
@
click=
"handler"
>
<slot>
<Icon
v-if=
"type=='icon'"
:type=
"icon
"
/>
<span
v-else=
"type=='text'"
v-text=
"text"
></span>
<Icon
v-if=
"type=='icon'"
:type=
"icon"
:color=
"color
"
/>
<span
v-else=
"type=='text'"
v-text=
"text"
></span>
</slot>
</a>
</a>
</
template
>
<
script
>
export
default
{
name
:
"op"
,
props
:
{
icon
:
{
type
:
String
},
oprate
:
{
type
:
String
},
type
:
{
type
:
String
,
default
:
"text"
name
:
"op"
,
props
:
{
icon
:
{
type
:
String
},
oprate
:
{
type
:
String
},
type
:
{
type
:
String
,
default
:
"text"
},
title
:
{
type
:
String
,
},
msg
:
{
type
:
String
,
default
:
"确认要删除吗?"
},
color
:
{
type
:
String
}
},
title
:
{
type
:
String
,
data
()
{
return
{
text
:
""
,
css
:
"detail"
};
},
msg
:
{
type
:
String
,
default
:
"确认要删除吗?"
}
},
data
()
{
return
{
text
:
""
,
css
:
"detail"
};
},
created
()
{
var
oprates
=
{
detail
:
"查看"
,
edit
:
"编辑"
,
add
:
"添加"
,
delete
:
"删除"
,
remove
:
"删除"
};
created
()
{
var
oprates
=
{
detail
:
"查看"
,
edit
:
"编辑"
,
add
:
"添加"
,
delete
:
"删除"
,
remove
:
"删除"
};
if
(
oprates
[
this
.
oprate
])
{
this
.
text
=
oprates
[
this
.
oprate
];
this
.
css
=
this
.
oprate
;
}
else
if
(
this
.
oprate
)
{
this
.
css
=
this
.
oprate
;
}
else
if
(
this
.
type
==
"icon"
)
{
this
.
css
=
"icon"
;
}
},
methods
:
{
handler
()
{
if
(
this
.
oprate
==
"delete"
||
this
.
oprate
==
"remove"
)
{
this
.
$Modal
.
confirm
({
title
:
this
.
title
,
content
:
"<p>"
+
this
.
msg
+
"</p>"
,
onOk
:
()
=>
{
this
.
$emit
(
"click"
,
event
);
}
});
}
else
{
this
.
$emit
(
"click"
,
event
);
}
if
(
oprates
[
this
.
oprate
])
{
this
.
text
=
oprates
[
this
.
oprate
];
this
.
css
=
this
.
oprate
;
}
else
if
(
this
.
oprate
)
{
this
.
css
=
this
.
oprate
;
}
else
if
(
this
.
type
==
"icon"
)
{
this
.
css
=
"icon"
;
}
},
methods
:
{
handler
()
{
if
(
this
.
oprate
==
"delete"
||
this
.
oprate
==
"remove"
)
{
this
.
$Modal
.
confirm
({
title
:
this
.
title
,
content
:
"<p>"
+
this
.
msg
+
"</p>"
,
onOk
:
()
=>
{
this
.
$emit
(
"click"
,
event
);
}
});
}
else
{
this
.
$emit
(
"click"
,
event
);
}
}
}
}
};
</
script
>
<
style
lang=
"less"
>
a.op {
display: inline;
margin: 0 3px;
display: inline;
margin: 0 3px;
}
</
style
>
\ No newline at end of file
</
style
>
npm-shrinkwrap.json
View file @
66fdd543
...
...
@@ -11753,7 +11753,7 @@
"dependencies"
:
{
"source-map"
:
{
"version"
:
"0.6.1"
,
"resolved"
:
"http
s://registry.npm.taobao
.org/source-map/download/source-map-0.6.1.tgz"
,
"resolved"
:
"http
://r.cnpmjs
.org/source-map/download/source-map-0.6.1.tgz"
,
"integrity"
:
"sha1-dHIq8y6WFOnCh6jQu95IteLxomM="
,
"dev"
:
true
,
"optional"
:
true
...
...
pages/import/index.vue
View file @
66fdd543
<
template
>
<div
class=
"h100"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
exportTitle=
"导入中心"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
...
...
pages/materiel/classification/index.vue
View file @
66fdd543
...
...
@@ -84,6 +84,7 @@
</Modal>
</div>
</
template
>
<
script
>
import
MasterData
from
"./masterData.vue"
;
...
...
@@ -126,17 +127,14 @@ export default {
},
methods
:
{
clickItem
(
val
)
{
console
.
log
(
val
);
this
.
nodeInfo
.
codeRuleId
=
val
;
this
.
model8
=
val
;
this
.
cityList
.
forEach
((
e
)
=>
{
if
(
val
==
e
.
id
)
{
this
.
downName
=
e
.
name
;
this
.
nodeInfo
.
codeRuleType
=
e
.
type
;
}
});
this
.
model8
=
val
;
this
.
loadTree
(
this
.
nodeInfo
.
codeRuleId
,
this
.
nodeInfo
.
codeRuleType
);
},
listSlecet
()
{
...
...
@@ -214,7 +212,10 @@ export default {
onOk
:
()
=>
{
Api
.
delete
(
this
.
nodeInfo
.
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
loadTree
(
this
.
nodeInfo
.
codeRuleId
);
this
.
loadTree
(
this
.
nodeInfo
.
codeRuleId
,
this
.
nodeInfo
.
codeRuleType
);
this
.
$Message
.
success
(
"删除成功"
);
}
});
...
...
@@ -281,13 +282,17 @@ export default {
// this.$refs.dataTable.dataColumns = tableData;
// }
},
loadTree
(
id
)
{
loadTree
(
id
,
codeRuleType
)
{
let
data
=
{
conditions
:
[
{
fieldName
:
"codeRuleId"
,
fieldValue
:
id
,
conditionalType
:
"Equal"
},
{
fieldName
:
"codeRuleId"
,
fieldValue
:
id
,
conditionalType
:
"Equal"
,
},
{
fieldName
:
"codeRuleType"
,
fieldValue
:
this
.
nodeInfo
.
codeRuleType
,
fieldValue
:
codeRuleType
,
conditionalType
:
"Equal"
,
},
],
...
...
@@ -322,6 +327,7 @@ export default {
ids
.
push
(
b
.
id
);
if
(
b
.
children
)
{
addId
(
b
.
children
);
function
addId
(
data
)
{
data
.
map
((
u
)
=>
{
ids
.
push
(
u
.
id
);
...
...
@@ -345,6 +351,7 @@ export default {
let
expand
=
this
.
expand
;
let
result
=
[];
search
(
this
.
keys
,
items
);
function
search
(
keys
,
data
)
{
data
.
map
((
u
)
=>
{
if
(
keys
.
length
<
u
.
title
)
{
...
...
@@ -365,7 +372,8 @@ export default {
},
};
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.classification {
font-family: Microsoft YaHei;
...
...
@@ -381,6 +389,7 @@ export default {
background: #eee;
padding-left: 10px;
}
.p-list {
h3 {
height: 50px;
...
...
@@ -393,22 +402,26 @@ export default {
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
height: 100%;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
}
.show_menu {
width: 30px;
height: 30px;
...
...
@@ -416,6 +429,7 @@ export default {
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px;
height: 30px;
...
...
@@ -428,11 +442,13 @@ export default {
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover {
background-color: #2d8cf0;
color: white;
}
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
...
...
@@ -443,4 +459,4 @@ export default {
overflow-y: hidden;
}
}
</
style
>
\ No newline at end of file
</
style
>
pages/materiel/classification/masterData.vue
View file @
66fdd543
<
template
>
<div
class=
"master-data"
>
<div
class=
"master-data"
>
<!--
<Table
border
:columns=
"columns"
:data=
"dataColumns"
:height=
"tableHeight"
></Table>
-->
<DataGrid
:columns=
"columns"
ref=
"grid"
:conditions=
"easySearch"
:action=
"action"
:high=
"false"
:height=
"tableHeight"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入编码/名称"
v-width=
"200"
v-model=
"easySearch.keys.value"
clearable
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:conditions=
"easySearch"
:action=
"action"
:high=
"false"
:height=
"tableHeight"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入编码/名称"
v-width=
"200"
v-model=
"easySearch.keys.value"
clearable
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
</DataGrid>
</div>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"masterData"
,
props
:
[
"root"
],
data
()
{
return
{
action
:
Api
.
index
,
tableHeight
:
""
,
dataColumns
:
[],
easySearch
:
{
keys
:
{
op
:
"code,name"
,
value
:
null
},
id
:
{
op
:
"In"
,
value
:
""
}
},
columns
:
[
// {
// key: "index",
// title: "#",
// align: "left",
// width: 60
// },
{
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
},
{
key
:
"name"
,
title
:
"名称"
,
align
:
"left"
},
{
key
:
"status"
,
title
:
"状态"
,
align
:
"left"
,
code
:
"materail.category.status"
},
{
key
:
"description"
,
title
:
"描述"
,
align
:
"left"
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
260
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
name
:
"masterData"
,
props
:
[
"root"
],
data
()
{
return
{
action
:
Api
.
index
,
tableHeight
:
""
,
dataColumns
:
[],
easySearch
:
{
keys
:
{
op
:
"code,name"
,
value
:
null
},
id
:
{
op
:
"In"
,
value
:
""
}
},
columns
:
[
// {
// key: "index",
// title: "#",
// align: "left",
// width: 60
// },
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
)
}
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
key
:
"name"
,
title
:
"名称"
,
align
:
"left"
},
"删除"
)
]);
}
}
]
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
created
()
{
this
.
tableHeight
=
window
.
innerHeight
-
220
;
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
{
key
:
"status"
,
title
:
"状态"
,
align
:
"left"
,
code
:
"materail.category.status"
},
{
key
:
"description"
,
title
:
"描述"
,
align
:
"left"
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
260
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
)
}
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
},
"删除"
)
]);
}
}
]
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
created
()
{
this
.
tableHeight
=
window
.
innerHeight
-
220
;
})();
};
},
methods
:
{
search
()
{
// alert(JSON.stringify(this.easySearch));
console
.
log
(
this
.
easySearch
);
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
edit
(
row
)
{
this
.
$emit
(
"on-edit"
,
row
);
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
tableHeight
=
window
.
innerHeight
-
220
;
})();
};
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
$Message
.
success
(
"删除成功"
);
methods
:
{
search
()
{
// alert(JSON.stringify(this.easySearch));
console
.
log
(
this
.
easySearch
);
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
edit
(
row
)
{
this
.
$emit
(
"on-edit"
,
row
);
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
$Message
.
success
(
"删除成功"
);
}
});
}
});
}
},
watch
:
{
root
:
{
handler
(
newName
,
oldName
)
{
if
(
newName
.
id
)
{
this
.
easySearch
.
id
.
value
=
newName
.
ids
;
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
}
else
{
this
.
easySearch
.
id
.
value
=
"-1"
;
},
watch
:
{
root
:
{
handler
(
newName
,
oldName
)
{
if
(
newName
.
id
)
{
this
.
easySearch
.
id
.
value
=
newName
.
ids
;
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
}
else
{
this
.
easySearch
.
id
.
value
=
"-1"
;
}
},
immediate
:
true
,
deep
:
true
}
},
immediate
:
true
,
deep
:
true
}
}
};
</
script
>
<
style
lang=
"less"
scoped
>
.spare-parts {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
</
style
>
\ No newline at end of file
</
style
>
pages/materiel/masterData/index.vue
View file @
66fdd543
...
...
@@ -54,6 +54,7 @@
</Layout>
</div>
</
template
>
<
script
>
import
MasterData
from
"./masterData.vue"
;
...
...
@@ -74,6 +75,7 @@ export default {
nodeInfo
:
{
categoryId
:
0
,
rootCategoryId
:
0
,
rootCategoryName
:
""
,
ids
:
[],
addChange
:
true
,
codeRuleId
:
0
,
...
...
@@ -86,7 +88,9 @@ export default {
detail
:
null
,
showMenu
:
true
,
dataList
:
[],
codeRuleId
:
""
,
rootCategoryId
:
null
,
categoryId
:
null
,
};
},
async
fetch
({
store
,
params
})
{
...
...
@@ -98,16 +102,14 @@ export default {
},
methods
:
{
clickItem
(
val
)
{
this
.
codeRuleId
=
val
;
this
.
nodeInfo
.
codeRuleId
=
val
;
this
.
model8
=
val
;
this
.
cityList
.
forEach
((
e
)
=>
{
if
(
val
==
e
.
id
)
{
this
.
downName
=
e
.
name
;
this
.
nodeInfo
.
codeRuleType
=
e
.
type
;
}
});
this
.
loadTree
(
this
.
codeRuleId
,
this
.
nodeInfo
.
codeRuleType
);
this
.
loadTree
(
this
.
nodeInfo
.
codeRuleId
,
this
.
nodeInfo
.
codeRuleType
);
},
listSlecet
()
{
let
data
=
{
...
...
@@ -164,14 +166,17 @@ export default {
);
},
handleSelect
(
root
,
data
)
{
let
pid
=
null
;
//定义最顶级id
let
upId
=
data
.
upId
;
let
pid
=
-
1
;
//定义最顶级id
var
pname
=
""
;
var
upId
=
data
.
upId
;
let
roots
=
root
;
function
addId
(
roots
,
upId
)
{
roots
.
map
((
u
)
=>
{
if
(
u
.
node
.
id
==
upId
)
{
if
(
u
.
node
.
upId
==
0
)
{
pid
=
u
.
node
.
id
;
pname
=
u
.
node
.
name
;
}
else
{
upId
=
u
.
node
.
upId
;
addId
(
roots
,
upId
);
...
...
@@ -179,18 +184,26 @@ export default {
}
});
}
addId
(
roots
,
upId
);
this
.
nodeInfo
.
categoryId
=
data
.
id
;
if
(
pid
==
null
)
{
this
.
nodeInfo
.
rootCategoryName
=
data
.
name
;
if
(
pid
==
-
1
)
{
this
.
nodeInfo
.
rootCategoryId
=
data
.
id
;
this
.
nodeInfo
.
rootCategoryName
=
data
.
name
;
}
else
{
this
.
nodeInfo
.
rootCategoryId
=
pid
;
this
.
nodeInfo
.
rootCategoryName
=
pname
;
}
},
loadTree
(
id
,
codeRuleType
)
{
let
data
=
{
conditions
:
[
{
fieldName
:
"codeRuleId"
,
fieldValue
:
id
,
conditionalType
:
"Equal"
},
{
fieldName
:
"codeRuleId"
,
fieldValue
:
id
,
conditionalType
:
"Equal"
,
},
{
fieldName
:
"codeRuleType"
,
fieldValue
:
codeRuleType
,
...
...
@@ -231,6 +244,7 @@ export default {
ids
.
push
(
b
.
value
);
if
(
b
.
children
)
{
addId
(
b
.
children
);
function
addId
(
data
)
{
data
.
map
((
u
)
=>
{
ids
.
push
(
u
.
value
);
...
...
@@ -252,6 +266,7 @@ export default {
let
expand
=
this
.
expand
;
let
result
=
[];
search
(
this
.
keys
,
items
);
function
search
(
keys
,
data
)
{
data
.
map
((
u
)
=>
{
if
(
keys
.
length
<
u
.
title
)
{
...
...
@@ -272,7 +287,8 @@ export default {
},
};
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.classification {
font-family: Microsoft YaHei;
...
...
@@ -288,6 +304,7 @@ export default {
background: #eee;
padding-left: 10px;
}
.p-list {
h3 {
height: 50px;
...
...
@@ -300,22 +317,26 @@ export default {
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
}
.fg {
flex: none;
height: 100%;
overflow: auto;
padding-left: 10px;
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
}
.show_menu {
width: 30px;
height: 30px;
...
...
@@ -323,6 +344,7 @@ export default {
top: 100px;
left: 0;
z-index: 9;
.menu_play {
width: 30px;
height: 30px;
...
...
@@ -335,11 +357,13 @@ export default {
background: #ffffff;
box-shadow: #ccc 2px 2px 4px 1px;
}
.menu_play:hover {
background-color: #2d8cf0;
color: white;
}
}
.ivu-layout-content {
// margin-left: 5px;
background: rgba(255, 255, 255, 1);
...
...
@@ -350,4 +374,4 @@ export default {
overflow-y: hidden;
}
}
</
style
>
\ No newline at end of file
</
style
>
pages/materiel/masterData/masterData.vue
View file @
66fdd543
<
template
>
<div
class=
"master-data"
>
<DataGrid
:columns=
"cols"
ref=
"grid"
:conditions=
"easySearch"
:action=
"action"
:initsearch=
"sets"
:high=
"false"
:format=
"formatFun"
:height=
"tableHeight"
@
on-selection-change=
"onSelect"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入编码/名称/状态"
v-width=
"200"
v-model=
"easySearch.keys.value"
clearable
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
<div
class=
"master-data"
>
<DataGrid
:columns=
"cols"
ref=
"grid"
:conditions=
"easySearch"
:action=
"action"
:initsearch=
"sets"
:high=
"false"
:format=
"formatFun"
:height=
"tableHeight"
@
on-selection-change=
"onSelect"
:exportTitle=
"exportTitle"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入编码/名称/状态"
v-width=
"200"
v-model=
"easySearch.keys.value"
clearable
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
@
click=
"modalSchedule"
>
批量送审
</Button>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
<Button
@
click=
"openModalIm"
>
导入
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
@
click=
"modalSchedule"
>
批量送审
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1000"
footer-hide
:mask-closable=
"false"
:fullscreen=
"fullscreen"
>
<component
:is=
"detail"
:eid=
"curId"
:rootCategoryId=
"rootCategoryId"
:rowsTable=
"rowsTable"
:nodeInfo=
"nodeInfo"
@
on-close=
"cancel"
@
on-cancel=
"cancel"
@
on-ok=
"ok"
ref=
"chlidren"
/>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1000"
footer-hide
:mask-closable=
"false"
:fullscreen=
"fullscreen"
>
<component
:is=
"detail"
:eid=
"curId"
:rootCategoryId=
"rootCategoryId"
:rowsTable=
"rowsTable"
:nodeInfo=
"nodeInfo"
@
on-close=
"cancel"
@
on-cancel=
"cancel"
@
on-ok=
"ok"
ref=
"chlidren"
/>
</Modal>
</div>
<ImportExcel
ref=
"importExcel"
@
on-get-data=
"getData"
:columns=
"cols"
:open=
"ModalIm"
@
on-cancel=
"ModalImCancel"
@
on-ok=
"ok"
/>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
// import Search from "./search";
export
default
{
name
:
"masterData"
,
components
:
{
// Search
},
props
:
[
"nodeInfo"
],
data
()
{
return
{
action
:
Api
.
index
,
tableHeight
:
""
,
modal
:
false
,
title
:
"新增"
,
curId
:
0
,
rootCategoryId
:
0
,
selectRows
:
[],
rowsTable
:
[],
fullscreen
:
false
,
detail
:
null
,
sets
:
v
=>
{
v
.
categoryId
=
this
.
nodeInfo
.
categoryId
;
v
.
rootCategoryId
=
this
.
nodeInfo
.
rootCategoryId
;
},
easySearch
:
{
keys
:
{
op
:
"code,name"
,
value
:
null
},
categoryId
:
{
op
:
"In"
,
value
:
this
.
nodeInfo
.
ids
}
},
columns
:
[
{
type
:
"selection"
,
width
:
70
,
align
:
"center"
},
{
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"a"
,
{
props
:
{},
on
:
{
click
:
()
=>
this
.
details
(
params
.
row
)
name
:
"masterData"
,
components
:
{
// Search
},
props
:
[
"nodeInfo"
],
data
()
{
return
{
action
:
Api
.
index
,
tableHeight
:
""
,
modal
:
false
,
title
:
"新增"
,
curId
:
0
,
rootCategoryId
:
0
,
selectRows
:
[],
rowsTable
:
[],
fullscreen
:
false
,
detail
:
null
,
sets
:
v
=>
{
v
.
categoryId
=
this
.
nodeInfo
.
categoryId
;
v
.
rootCategoryId
=
this
.
nodeInfo
.
rootCategoryId
;
},
easySearch
:
{
keys
:
{
op
:
"code,name"
,
value
:
null
},
categoryId
:
{
op
:
"In"
,
value
:
this
.
nodeInfo
.
ids
}
},
!
params
.
row
.
code
?
"未分配"
:
params
.
row
.
code
);
}
},
{
key
:
"name"
,
title
:
"名称"
,
align
:
"left"
},
{
key
:
"status"
,
title
:
"状态"
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"state"
,
{
props
:
{
code
:
"material.main.status"
,
type
:
"text"
,
value
:
params
.
row
.
status
+
""
}
});
}
},
{
key
:
"version"
,
title
:
"版本"
,
align
:
"left"
,
code
:
"material.main.version"
},
{
key
:
"drawing"
,
title
:
"图号"
,
align
:
"left"
},
{
key
:
"creationTime"
,
title
:
"创建时间"
,
hide
:
true
,
align
:
"left"
,
type
:
"date"
},
{
key
:
"creatorUserId"
,
title
:
"创建人"
,
hide
:
true
,
align
:
"left"
,
type
:
"user"
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
150
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
},
columns
:
[{
type
:
"selection"
,
width
:
70
,
align
:
"center"
},
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
)
}
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"a"
,
{
props
:
{},
on
:
{
click
:
()
=>
this
.
details
(
params
.
row
)
}
},
!
params
.
row
.
code
||
params
.
row
.
code
==
0
?
"未分配"
:
params
.
row
.
code
);
}
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
key
:
"name"
,
title
:
"名称"
,
align
:
"left"
},
params
.
row
.
status
==
3
?
""
:
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
send
(
params
.
row
)
}
key
:
"status"
,
title
:
"状态"
,
align
:
"center"
,
code
:
"material.main.status"
,
},
(
params
.
row
.
status
==
0
||
params
.
row
.
status
==
1
)
&&
this
.
status
==
0
?
"送审"
:
""
)
]);
}
}
],
//基础咧
cols
:
[],
//
status
:
null
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
created
()
{
this
.
tableHeight
=
window
.
innerHeight
-
220
;
if
(
this
.
nodeInfo
.
rootCategoryId
==
0
)
{
this
.
cols
=
this
.
columns
;
}
else
{
this
.
initCols
();
}
Api
.
getbyid
({
id
:
"b6303ddc-8b5e-40a3-a51b-294657d1d913"
}).
then
(
r
=>
{
this
.
status
=
r
.
result
.
status
;
//status为0的话为启用,有送审,为1的话,流程是禁用的,没有送审按钮
this
.
nodeInfo
.
status
=
this
.
status
;
});
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
{
key
:
"version"
,
title
:
"版本"
,
align
:
"left"
,
code
:
"material.main.version"
},
{
key
:
"drawing"
,
title
:
"图号"
,
align
:
"left"
},
{
key
:
"creationTime"
,
title
:
"创建时间"
,
hide
:
true
,
align
:
"left"
,
type
:
"date"
},
{
key
:
"creatorUserId"
,
title
:
"创建人"
,
hide
:
true
,
align
:
"left"
,
type
:
"user"
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
150
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
)
}
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
},
params
.
row
.
status
==
3
?
""
:
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
send
(
params
.
row
)
}
},
(
params
.
row
.
status
==
0
||
params
.
row
.
status
==
1
)
&&
this
.
status
==
0
?
"送审"
:
""
)
]);
}
}
],
//基础咧
cols
:
[],
//
status
:
null
,
ModalIm
:
false
,
addCol
:
[],
exportTitle
:
'物料管理'
,
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
created
()
{
this
.
tableHeight
=
window
.
innerHeight
-
220
;
})();
};
},
methods
:
{
//格式化原始数据
formatFun
(
data
)
{
data
.
map
(
e
=>
{
if
(
e
.
status
==
0
)
{
e
.
_disabled
=
false
;
if
(
this
.
nodeInfo
.
rootCategoryId
==
0
)
{
this
.
cols
=
this
.
columns
;
}
else
{
e
.
_disabled
=
true
;
this
.
initCols
()
;
}
});
return
data
;
},
onSelect
(
a
,
b
)
{
// console.log(a);
// console.log(b);
//批量选择
this
.
rootCategoryId
=
a
[
0
].
rootCategoryId
;
this
.
selectRows
=
a
;
Api
.
getbyid
({
id
:
"b6303ddc-8b5e-40a3-a51b-294657d1d913"
}).
then
(
r
=>
{
this
.
status
=
r
.
result
.
status
;
//status为0的话为启用,有送审,为1的话,流程是禁用的,没有送审按钮
this
.
nodeInfo
.
status
=
this
.
status
;
});
},
modalSchedule
()
{
this
.
fullscreen
=
true
;
this
.
rowsTable
=
this
.
selectRows
;
this
.
title
=
"物料送审"
;
this
.
curId
=
0
;
this
.
detail
=
()
=>
import
(
"./submit"
);
this
.
modal
=
true
;
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
tableHeight
=
window
.
innerHeight
-
220
;
})();
};
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
initCols
(
delay
)
{
let
conditions
=
[
{
conditionalType
:
"Equal"
,
fieldName
:
"categoryId"
,
fieldValue
:
this
.
nodeInfo
.
rootCategoryId
}
];
methods
:
{
//格式化原始数据
formatFun
(
data
)
{
data
.
map
(
e
=>
{
if
(
e
.
status
==
0
)
{
e
.
_disabled
=
false
;
}
else
{
e
.
_disabled
=
true
;
}
});
return
data
;
},
onSelect
(
a
,
b
)
{
// console.log(a);
// console.log(b);
//批量选择
this
.
rootCategoryId
=
a
[
0
].
rootCategoryId
;
this
.
selectRows
=
a
;
},
modalSchedule
()
{
this
.
fullscreen
=
true
;
this
.
rowsTable
=
this
.
selectRows
;
this
.
title
=
"物料送审"
;
this
.
curId
=
0
;
this
.
detail
=
()
=>
import
(
"./submit"
);
this
.
modal
=
true
;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
initCols
(
delay
)
{
let
conditions
=
[{
conditionalType
:
"Equal"
,
fieldName
:
"categoryId"
,
fieldValue
:
this
.
nodeInfo
.
rootCategoryId
}];
Api
.
listTable
({
conditions
:
conditions
,
sortBy
:
"id"
,
isDesc
:
false
}).
then
(
r
=>
{
if
(
r
.
result
)
{
var
items
=
r
.
result
.
filter
(
u
=>
{
return
(
!
this
.
columns
.
some
(
p
=>
{
return
p
.
key
==
u
.
field
;
})
&&
u
.
dataType
!=
5
);
});
this
.
addCol
=
items
;
this
.
cols
=
this
.
$u
.
clone
(
this
.
columns
);
let
extra
=
items
.
map
(
u
=>
{
console
.
log
(
u
);
var
col
=
{
key
:
u
.
field
,
title
:
u
.
title
};
if
(
u
.
dataType
==
3
)
{
col
.
code
=
u
.
note
;
}
if
(
u
.
dataType
==
4
)
{
col
.
type
=
"date"
;
}
if
(
u
.
unitName
&&
(
u
.
dataType
==
1
||
u
.
dataType
==
2
))
{
var
units
=
this
.
$store
.
getters
.
dictionaryByKey
(
"material.main.unitName"
);
Api
.
listTable
({
conditions
:
conditions
,
sortBy
:
"id"
,
isDesc
:
false
}).
then
(
r
=>
{
if
(
r
.
result
)
{
var
items
=
r
.
result
.
filter
(
u
=>
{
return
(
!
this
.
columns
.
some
(
p
=>
{
return
p
.
key
==
u
.
field
;
})
&&
u
.
dataType
!=
5
);
});
this
.
cols
=
this
.
$u
.
clone
(
this
.
columns
);
let
extra
=
items
.
map
(
u
=>
{
console
.
log
(
u
);
var
col
=
{
key
:
u
.
field
,
title
:
u
.
title
};
if
(
u
.
dataType
==
3
)
{
col
.
code
=
u
.
note
;
let
item
=
units
.
filter
(
p
=>
{
return
p
.
code
==
u
.
unitName
;
});
// console.log(units, item);
col
.
title
+=
"("
+
item
[
0
].
name
+
")"
;
}
return
col
;
});
this
.
cols
=
this
.
cols
.
concat
(
extra
);
var
action
=
this
.
cols
.
splice
(
this
.
columns
.
length
-
1
,
1
);
this
.
cols
.
push
(
this
.
columns
[
this
.
columns
.
length
-
1
]);
if
(
delay
)
{
delay
();
}
// console.log(this.cols)
}
});
this
.
exportTitle
=
"物料管理-"
+
this
.
nodeInfo
.
rootCategoryName
;
},
add
()
{
if
(
this
.
nodeInfo
.
categoryId
)
{
if
(
this
.
nodeInfo
.
addChange
==
true
)
{
this
.
fullscreen
=
false
;
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请在设置的分类层级数下添加物料"
);
}
}
else
{
this
.
$Message
.
error
(
"请先选择分类"
);
}
if
(
u
.
dataType
==
4
)
{
col
.
type
=
"date"
;
},
edit
(
row
)
{
this
.
fullscreen
=
false
;
this
.
curId
=
row
.
id
;
this
.
title
=
"编辑"
;
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
details
(
row
)
{
this
.
fullscreen
=
true
;
this
.
curId
=
row
.
id
;
this
.
rootCategoryId
=
row
.
rootCategoryId
;
this
.
title
=
"详情"
;
this
.
detail
=
()
=>
import
(
"./details"
);
this
.
rowsTable
=
[];
this
.
modal
=
true
;
},
send
(
row
)
{
this
.
fullscreen
=
true
;
this
.
curId
=
row
.
id
;
this
.
rootCategoryId
=
row
.
rootCategoryId
;
this
.
title
=
"物料送审"
;
this
.
detail
=
()
=>
import
(
"./submit"
);
this
.
rowsTable
=
[];
this
.
modal
=
true
;
},
ok
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
modal
=
false
;
this
.
ModalIm
=
false
;
this
.
curId
=
0
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
//批量导入start
//导入功能
openModalIm
()
{
if
(
this
.
nodeInfo
.
categoryId
)
{
this
.
ModalIm
=
true
}
else
{
this
.
$Message
.
error
(
"请先选择分类"
);
}
if
(
u
.
unitName
&&
(
u
.
dataType
==
1
||
u
.
dataType
==
2
))
{
var
units
=
this
.
$store
.
getters
.
dictionaryByKey
(
"material.main.unitName"
);
let
item
=
units
.
filter
(
p
=>
{
return
p
.
code
==
u
.
unitName
;
});
// console.log(units, item);
col
.
title
+=
"("
+
item
[
0
].
name
+
")"
;
}
return
col
;
});
this
.
cols
=
this
.
cols
.
concat
(
extra
);
var
action
=
this
.
cols
.
splice
(
this
.
columns
.
length
-
1
,
1
);
this
.
cols
.
push
(
this
.
columns
[
this
.
columns
.
length
-
1
]);
if
(
delay
)
{
delay
();
}
// console.log(this.cols)
}
});
},
add
()
{
if
(
this
.
nodeInfo
.
categoryId
)
{
if
(
this
.
nodeInfo
.
addChange
==
true
)
{
this
.
fullscreen
=
false
;
this
.
curId
=
0
;
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请在设置的分类层级数下添加物料"
);
}
}
else
{
this
.
$Message
.
error
(
"请先选择分类"
);
}
},
edit
(
row
)
{
this
.
fullscreen
=
false
;
this
.
curId
=
row
.
id
;
this
.
title
=
"编辑"
;
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
details
(
row
)
{
this
.
fullscreen
=
true
;
this
.
curId
=
row
.
id
;
this
.
rootCategoryId
=
row
.
rootCategoryId
;
this
.
title
=
"详情"
;
this
.
detail
=
()
=>
import
(
"./details"
);
this
.
rowsTable
=
[];
this
.
modal
=
true
;
},
send
(
row
)
{
this
.
fullscreen
=
true
;
this
.
curId
=
row
.
id
;
this
.
rootCategoryId
=
row
.
rootCategoryId
;
this
.
title
=
"物料送审"
;
this
.
detail
=
()
=>
import
(
"./submit"
);
this
.
rowsTable
=
[];
this
.
modal
=
true
;
},
ok
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
this
.
modal
=
false
;
this
.
curId
=
0
;
},
ModalImCancel
()
{
this
.
ModalIm
=
false
},
getData
(
val
)
{
let
url
=
`
${
material
}
/materialimportservice/import`
;
this
.
$refs
.
importExcel
.
deelData
(
url
,
this
.
cols
,
this
.
formatMethod
(
val
))
},
//根据页面二次处理数据
formatMethod
(
val
)
{
let
tempData
=
this
.
$u
.
clone
(
val
);
let
tempList
=
[];
tempData
.
forEach
((
ele
)
=>
{
let
obj
=
{
name
:
ele
.
name
?
ele
.
name
:
''
,
version
:
ele
.
version
?
Number
(
ele
.
version
)
:
''
,
drawing
:
ele
.
drawing
?
ele
.
drawing
:
''
,
description
:
ele
.
description
?
ele
.
description
:
""
,
code
:
0
,
status
:
this
.
nodeInfo
.
status
==
1
?
3
:
0
,
codeRuleId
:
this
.
nodeInfo
.
codeRuleId
,
categoryId
:
this
.
nodeInfo
.
categoryId
,
//左侧树点击的id
customProperties
:
{},
rootCategoryId
:
this
.
nodeInfo
.
rootCategoryId
,
//左侧树点击的数据的最顶层id
};
this
.
addCol
.
forEach
(
el
=>
{
obj
[
el
.
field
]
=
ele
[
el
.
field
]
})
if
(
ele
.
name
&&
ele
.
name
!=
''
)
{
obj
.
ico
=
false
}
else
{
obj
.
ico
=
true
}
tempList
.
push
(
obj
);
});
return
tempList
},
//批量导入end
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
}
},
watch
:
{
nodeInfo
:
{
handler
(
newName
,
oldName
)
{
// console.log("ovo", newName, oldName);
if
(
newName
.
rootCategoryId
)
{
this
.
initCols
(()
=>
{
if
(
newName
.
categoryId
)
{
this
.
easySearch
.
categoryId
.
value
=
newName
.
ids
;
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
}
});
}
if
(
!
newName
.
categoryId
)
{
this
.
easySearch
.
categoryId
.
value
=
"-1"
;
watch
:
{
nodeInfo
:
{
handler
(
newName
,
oldName
)
{
// console.log("ovo", newName, oldName);
if
(
newName
.
rootCategoryId
)
{
this
.
initCols
(()
=>
{
if
(
newName
.
categoryId
)
{
this
.
easySearch
.
categoryId
.
value
=
newName
.
ids
;
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
}
});
}
if
(
!
newName
.
categoryId
)
{
this
.
easySearch
.
categoryId
.
value
=
"-1"
;
}
},
immediate
:
true
,
deep
:
true
}
},
immediate
:
true
,
deep
:
true
}
}
};
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.master-data {
.ivu-footer-toolbar-right {
margin-right: 72% !important;
}
.ivu-footer-toolbar-right {
margin-right: 72% !important;
}
}
</
style
>
\ No newline at end of file
</
style
>
pages/mesPlan/index.vue
View file @
66fdd543
<
template
>
<Layout
class=
"full"
>
<Layout
class=
"full"
>
<!--
<Sider
hide-trigger
:style=
"
{background: '#fff'}" width="260">
<div
class=
"zh-tree"
:style=
"
{height:treeHeight+'px'}">
<h3
class=
"zh-title"
>
产品结构
</h3>
...
...
@@ -15,104 +15,83 @@
</div>
</Sider>
-->
<Sider
hide-trigger
v-if=
"showMenu"
class=
"menu_side"
width=
"300"
>
<ProductTree
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
<ProductTree
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
</Sider>
<div
v-if=
"!showMenu"
class=
"show_menu"
>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
</div>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<!--:data="dataT"-->
<DataGrid
:action=
"action"
:columns=
"columns"
:conditions=
"easySearch"
ref=
"grid"
@
on-selection-change=
"onSelect"
:batch=
"true"
:border=
"false"
rowKey=
"id"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入订单编号/产品名称"
v-model=
"easySearch.keys.value"
v-width=
"300"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"addModal=true"
>
创建
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"openSendViewModal"
v-if=
"this.wfstatu==1"
>
订单送审
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"openSendModal"
>
订单派发
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"removeList"
>
批量删除
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"addModal"
title=
"新增"
footer-hide
width=
"1200"
>
<Add
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"editModal"
title=
"编辑"
footer-hide
width=
"1200"
>
<Edit
:row=
"rowData"
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"detailModal"
title=
"订单详情"
width=
"900"
>
<Detail
:row=
"rowData"
/>
</Modal>
<Modal
v-model=
"splitModal"
title=
"订单分解"
width=
"1200"
>
<Split
:row=
"rowData"
ref=
"orderSplit"
/>
<div
slot=
"footer"
>
<Button
@
click=
"splitModal = false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"orderSplitOk"
>
确定分解
</Button>
</div>
</Modal>
<Modal
v-model=
"sendViewModal"
title=
"订单送审"
width=
"1200"
>
<SendView
:row=
"rowDataArry"
ref=
"orderSendView"
/>
<div
slot=
"footer"
>
<Button
@
click=
"sendViewModal = false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"sendViewOk"
>
确定送审
</Button>
</div>
</Modal>
<Modal
v-model=
"sendModal"
title=
"订单派发"
width=
"1200"
>
<Send
:row=
"rowDataArry"
ref=
"orderSend"
/>
<div
slot=
"footer"
>
<Button
@
click=
"sendModal = false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"sendOk"
>
确定派发
</Button>
</div>
</Modal>
<Modal
v-model=
"deletelModal"
title=
"删除"
@
on-ok=
"removeOk"
@
on-cancel=
"cancel"
>
<p>
确定删除 订单:{{delMsg}} ?
</p>
</Modal>
<!-- 信息提示 -->
<Modal
v-model=
"ModalInfo"
title=
"信息提示"
width=
"600"
:mask-closable=
"false"
:scrollable=
"true"
ok-text=
"确定"
cancel-text=
"取消"
>
{{ metCodesStrTxt }}
<div
slot=
"footer"
>
<Button
@
click=
"ModalInfo = false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"modalInfoOk"
>
确定
</Button>
</div>
</Modal>
<!--:data="dataT"-->
<DataGrid
:action=
"action"
:columns=
"columns"
:conditions=
"easySearch"
ref=
"grid"
@
on-selection-change=
"onSelect"
:batch=
"true"
:border=
"false"
rowKey=
"id"
exportTitle=
"订单管理"
@
on-import-data=
"onImportData"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入订单编号/产品名称"
v-model=
"easySearch.keys.value"
v-width=
"300"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
<
template
slot=
"searchForm"
>
<Search
/>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"addModal=true"
>
创建
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"openSendViewModal"
v-if=
"this.wfstatu==1"
>
订单送审
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"openSendModal"
>
订单派发
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"removeList"
>
批量删除
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"addModal"
title=
"新增"
footer-hide
width=
"1200"
>
<Add
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"editModal"
title=
"编辑"
footer-hide
width=
"1200"
>
<Edit
:row=
"rowData"
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"detailModal"
title=
"订单详情"
width=
"900"
>
<Detail
:row=
"rowData"
/>
</Modal>
<Modal
v-model=
"splitModal"
title=
"订单分解"
width=
"1200"
>
<Split
:row=
"rowData"
ref=
"orderSplit"
/>
<div
slot=
"footer"
>
<Button
@
click=
"splitModal = false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"orderSplitOk"
>
确定分解
</Button>
</div>
</Modal>
<Modal
v-model=
"sendViewModal"
title=
"订单送审"
width=
"1200"
>
<SendView
:row=
"rowDataArry"
ref=
"orderSendView"
/>
<div
slot=
"footer"
>
<Button
@
click=
"sendViewModal = false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"sendViewOk"
>
确定送审
</Button>
</div>
</Modal>
<Modal
v-model=
"sendModal"
title=
"订单派发"
width=
"1200"
>
<Send
:row=
"rowDataArry"
ref=
"orderSend"
/>
<div
slot=
"footer"
>
<Button
@
click=
"sendModal = false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"sendOk"
>
确定派发
</Button>
</div>
</Modal>
<Modal
v-model=
"deletelModal"
title=
"删除"
@
on-ok=
"removeOk"
@
on-cancel=
"cancel"
>
<p>
确定删除 订单:{{delMsg}} ?
</p>
</Modal>
<!-- 信息提示 -->
<Modal
v-model=
"ModalInfo"
title=
"信息提示"
width=
"600"
:mask-closable=
"false"
:scrollable=
"true"
ok-text=
"确定"
cancel-text=
"取消"
>
{{ metCodesStrTxt }}
<div
slot=
"footer"
>
<Button
@
click=
"ModalInfo = false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"modalInfoOk"
>
确定
</Button>
</div>
</Modal>
</Content>
</Layout>
</Layout>
</template>
<
script
>
import
Api
from
"./api"
;
import
Add
from
"./add"
;
...
...
@@ -124,931 +103,968 @@ import Send from "./send";
import
SendView
from
"./sendView"
;
import
ProductTree
from
"@/components/page/productTree.vue"
;
export
default
{
name
:
"list"
,
components
:
{
Add
,
Edit
,
Detail
,
Search
,
Split
,
Send
,
SendView
,
ProductTree
},
data
()
{
return
{
action
:
Api
.
index
,
showMenu
:
true
,
easySearch
:
{
keys
:
{
op
:
"mesCode,productName"
,
value
:
null
,
default
:
true
},
productId
:
{
op
:
"In"
,
value
:
""
}
},
addModal
:
false
,
editModal
:
false
,
detailModal
:
false
,
deletelModal
:
false
,
splitModal
:
false
,
ModalInfo
:
false
,
sendModal
:
false
,
sendViewModal
:
false
,
curId
:
0
,
id
:
"id"
,
columns
:
[
{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
},
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
},
{
key
:
"mesCode"
,
title
:
this
.
l
(
"mesCode"
),
align
:
"left"
,
width
:
240
,
easy
:
true
,
high
:
true
,
tree
:
true
,
render
:
(
h
,
params
)
=>
{
let
name
=
params
.
row
.
mesCode
;
let
isUpId
=
params
.
row
.
upId
;
let
isDivideMark
=
params
.
row
.
divideMark
;
let
rowChildren
=
params
.
row
.
children
;
return
h
(
"div"
,
{
style
:
{
cursor
:
"pointer"
,
display
:
"inline"
,
marginLeft
:
isDivideMark
==
0
&&
isUpId
==
0
?
"20px"
:
"0px"
name
:
"list"
,
components
:
{
Add
,
Edit
,
Detail
,
Search
,
Split
,
Send
,
SendView
,
ProductTree
},
data
()
{
return
{
action
:
Api
.
index
,
showMenu
:
true
,
easySearch
:
{
keys
:
{
op
:
"mesCode,productName"
,
value
:
null
,
default
:
true
},
productId
:
{
op
:
"In"
,
value
:
""
}
},
params
.
row
.
mesCode
);
}
},
addModal
:
false
,
editModal
:
false
,
detailModal
:
false
,
deletelModal
:
false
,
splitModal
:
false
,
ModalInfo
:
false
,
sendModal
:
false
,
sendViewModal
:
false
,
curId
:
0
,
id
:
"id"
,
columns
:
[{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
},
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
},
{
key
:
"mesCode"
,
title
:
this
.
l
(
"mesCode"
),
align
:
"left"
,
width
:
240
,
easy
:
true
,
high
:
true
,
tree
:
true
,
render
:
(
h
,
params
)
=>
{
let
name
=
params
.
row
.
mesCode
;
let
isUpId
=
params
.
row
.
upId
;
let
isDivideMark
=
params
.
row
.
divideMark
;
let
rowChildren
=
params
.
row
.
children
;
return
h
(
"div"
,
{
style
:
{
cursor
:
"pointer"
,
display
:
"inline"
,
marginLeft
:
isDivideMark
==
0
&&
isUpId
==
0
?
"20px"
:
"0px"
}
},
params
.
row
.
mesCode
);
}
},
{
key
:
"taskType"
,
title
:
this
.
l
(
"taskType"
),
align
:
"center"
,
high
:
true
,
code
:
"plan.order.taskType"
,
width
:
100
},
{
key
:
"quantity"
,
title
:
this
.
l
(
"quantity"
),
align
:
"right"
,
high
:
true
,
width
:
80
},
{
key
:
"taskRequire"
,
title
:
this
.
l
(
"taskRequire"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"center"
,
high
:
true
,
code
:
"plan.order.status"
,
width
:
100
},
{
key
:
"productCode"
,
title
:
this
.
l
(
"productCode"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
},
{
key
:
"productName"
,
title
:
this
.
l
(
"productName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"drawnNumber"
,
title
:
this
.
l
(
"drawnNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"batchNumber"
,
title
:
this
.
l
(
"batchNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"projectNumber"
,
title
:
this
.
l
(
"projectNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"urgencyLevel"
,
title
:
this
.
l
(
"urgencyLevel"
),
align
:
"center"
,
high
:
true
,
code
:
"plan.order.urgencyLevel"
,
width
:
100
},
{
key
:
"productingPreparationPeople"
,
title
:
this
.
l
(
"productingPreparationPeople"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
'workShopName'
},
{
key
:
"productingPreparationFinishDate"
,
title
:
this
.
l
(
"productingPreparationFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
},
{
key
:
"quotationPeople"
,
title
:
this
.
l
(
"quotationPeople"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"user"
},
{
key
:
"quotationFinishDate"
,
title
:
this
.
l
(
"quotationFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
},
{
key
:
"demandStartDate"
,
title
:
this
.
l
(
"demandStartDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"date"
},
{
key
:
"demandFinishDate"
,
title
:
this
.
l
(
"demandFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"date"
},
{
key
:
"creatorUserId"
,
title
:
this
.
$t
(
"creatorUserId"
),
align
:
"left"
,
high
:
true
,
type
:
"user"
},
{
key
:
"creationTime"
,
title
:
this
.
$t
(
"creationTime"
),
align
:
"center"
,
high
:
true
,
width
:
180
},
{
key
:
"lastModifierUserId"
,
title
:
this
.
$t
(
"lastModifierUserId"
),
hide
:
true
,
align
:
"left"
,
high
:
true
,
type
:
"user"
},
{
key
:
"lastModificationTime"
,
title
:
this
.
$t
(
"lastModificationTime"
),
hide
:
true
,
align
:
"center"
,
high
:
true
,
width
:
180
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
180
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
detail
(
params
.
row
)
}
},
"查看"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
)
},
style
:
this
.
wfstatu
==
1
?
(
(
params
.
row
.
status
==
1
&&
params
.
row
.
id
==
params
.
row
.
rootId
&&
params
.
row
.
divideMark
!=
0
)
||
params
.
row
.
id
!=
params
.
row
.
rootId
||
params
.
row
.
status
!=
1
?
"display:none"
:
""
)
:
(
(
params
.
row
.
status
==
3
&&
params
.
row
.
id
==
params
.
row
.
rootId
&&
params
.
row
.
divideMark
!=
0
)
||
params
.
row
.
id
!=
params
.
row
.
rootId
||
params
.
row
.
status
!=
3
?
"display:none"
:
""
)
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"remove"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
)
},
style
:
this
.
wfstatu
==
1
?
(
(
params
.
row
.
status
==
1
&&
params
.
row
.
id
==
params
.
row
.
rootId
&&
params
.
row
.
divideMark
!=
0
)
||
params
.
row
.
id
!=
params
.
row
.
rootId
||
params
.
row
.
status
!=
1
?
"display:none"
:
""
)
:
(
(
params
.
row
.
status
==
3
&&
params
.
row
.
id
==
params
.
row
.
rootId
&&
params
.
row
.
divideMark
!=
0
)
||
params
.
row
.
id
!=
params
.
row
.
rootId
||
params
.
row
.
status
!=
3
?
"display:none"
:
""
)
},
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
split
(
params
.
row
)
},
style
:
this
.
wfstatu
==
1
?
(
(
params
.
row
.
divideMark
!=
0
&&
params
.
row
.
id
==
params
.
row
.
rootId
)
||
params
.
row
.
status
!=
1
||
params
.
row
.
quantity
<=
1
?
"display:none"
:
""
)
:
(
(
params
.
row
.
divideMark
!=
0
&&
params
.
row
.
id
==
params
.
row
.
rootId
)
||
params
.
row
.
status
!=
3
||
params
.
row
.
quantity
<=
1
?
"display:none"
:
""
)
},
"分解"
)
]);
}
}
],
treeData
:
[],
treeInputSearch
:
""
,
ocolumn
:
[],
treeHeight
:
""
,
tableHeight
:
""
,
ids
:
[],
orderSearchForm
:
{
productId
:
""
,
//产品id
productName
:
""
,
//产品名称
taskType
:
""
,
//任务类型
quantity
:
null
,
//数量
taskRequire
:
""
,
//任务接点要求
demandStartDate
:
""
,
//开始时间
demandFinishDate
:
""
,
//完成时间
remark
:
""
,
//备注
projectNumber
:
""
,
//项目号
batchNumber
:
""
,
//批次号
urgencyLevel
:
null
//紧急程度
},
list
:
[],
//data测试数据
dataT
:
[],
dataTemp
:
[],
data1
:
[],
selectdata
:
[],
//以下为手写死数据集:
orderCatList
:
[],
//订单类型下拉
outerCodeList
:
[],
//型号外部代码下拉
missionCodeList
:
[],
//任务号下拉
stageList
:
[],
//阶段下拉
materailList
:
[],
//材料下拉
routingAccessList
:
[],
//工艺方法下拉
drawNumberList
:
[],
//图号下拉
docNameList
:
[],
//文档名称下拉
ownerGustList
:
[],
//甲方客户下拉
mainDeptList
:
[],
//厂内主体部门下拉
taskTypeList
:
[],
//任务类型
statusList
:
[],
//状态类型
rowData
:
{},
//编辑、查看的当前行数据
rowDataArry
:
[],
ModalInfoStaut
:
""
,
sendList
:
[],
metCodesStrTxt
:
""
,
actIds
:
[],
//批量处理时ids
actMescodes
:
[],
delNum
:
0
,
//判断是否可以进行修改
arrayIds
:
[],
//选择列表后的ids
delMsg
:
""
,
//删除提示信息
dataListRetrunNew
:
{
schemaId
:
"123327da-42b3-41f6-b785-cf933f137a95"
,
//订单送审的schemaId
idList
:
[],
//订单id List
codeList
:
[],
//订单编号List
operatorIdList
:
[]
//操作员id
},
//确定后返回数据
wfstatu
:
1
//流程是否启用1 禁用 0启用
};
},
created
()
{
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
this
.
initTree
();
let
params
=
{
id
:
"123327da-42b3-41f6-b785-cf933f137a95"
};
this
.
$api
.
get
(
`
${
workflowUrl
}
/schema/getbyid`
,
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
let
wfStatus
=
res
.
result
.
status
;
if
(
wfStatus
==
0
)
{
this
.
wfstatu
=
1
;
}
else
{
this
.
wfstatu
=
3
;
}
}
});
//this.dataformat();//data传数据转为tree类型
this
.
tableHeight
=
window
.
innerHeight
-
220
;
//this.$refs.CustomTable.getTableHeight(this.tableHeight);
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
treeHeight
=
window
.
screenHeight
-
150
;
this
.
tableHeight
=
window
.
screenHeight
-
220
;
//this.$refs.CustomTable.getTableHeight(this.tableHeight);
})();
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
await
store
.
dispatch
(
'loadDepartments'
);
//加载部门
},
computed
:
{
searchList
()
{
let
nodeList
=
this
.
treeData
;
var
text
=
this
.
treeInputSearch
;
var
newNodeList
=
[];
function
searchTree
(
nodeLists
,
value
)
{
for
(
let
i
=
0
;
i
<
nodeLists
.
length
;
i
++
)
{
if
(
nodeLists
[
i
].
title
.
indexOf
(
value
)
!=
-
1
)
{
newNodeList
.
push
(
nodeLists
[
i
]);
}
else
if
(
nodeLists
[
i
].
children
.
length
>
0
)
{
searchTree
(
nodeLists
[
i
].
children
,
value
);
}
}
}
if
(
text
!=
""
)
{
searchTree
(
nodeList
,
text
);
}
else
{
return
nodeList
;
}
return
newNodeList
;
}
},
methods
:
{
addOk
()
{
this
.
$refs
.
grid
.
load
();
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
curId
=
0
;
},
{
key
:
"taskType"
,
title
:
this
.
l
(
"taskType"
),
align
:
"center"
,
high
:
true
,
code
:
"plan.order.taskType"
,
width
:
100
search
()
{
this
.
easySearch
.
keys
.
value
=
this
.
easySearch
.
keys
.
value
.
trim
();
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
{
key
:
"quantity"
,
title
:
this
.
l
(
"quantity"
),
align
:
"right"
,
high
:
true
,
width
:
80
detail
(
row
)
{
this
.
detailModal
=
true
;
this
.
rowData
=
row
;
},
{
key
:
"taskRequire"
,
title
:
this
.
l
(
"taskRequire"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
edit
(
row
)
{
this
.
editModal
=
true
;
this
.
rowData
=
row
;
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"center"
,
high
:
true
,
code
:
"plan.order.status"
,
width
:
100
split
(
row
)
{
if
(
row
.
quantity
>
1
)
{
this
.
splitModal
=
true
;
this
.
rowData
=
row
;
}
else
{
this
.
$Message
.
error
(
"数量为1,不能进行分解"
);
}
},
{
key
:
"productCode"
,
title
:
this
.
l
(
"productCode"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
},
{
key
:
"productName"
,
title
:
this
.
l
(
"productName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
},
{
key
:
"drawnNumber"
,
title
:
this
.
l
(
"drawnNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
productSearch
(
id
,
item
,
productIds
,
ids
)
{
let
where
=
{
bomId
:
{
op
:
"In"
,
value
:
ids
}
};
this
.
$refs
.
grid
.
reload
(
where
);
},
{
key
:
"batchNumber"
,
title
:
this
.
l
(
"batchNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
//确定分解
orderSplitOk
()
{
let
returnDatalist
=
this
.
$refs
.
orderSplit
.
returnDataList
();
let
orderQuantity
=
returnDatalist
.
quantity
;
let
orderListQuantity
=
0
;
let
quantyStatu
=
false
;
//子订单计划数是否为0或空
let
dateStatu
=
false
;
//子订单开始完成时间是否为空
if
(
returnDatalist
.
items
.
length
>
0
)
{
returnDatalist
.
items
.
forEach
(
data
=>
{
orderListQuantity
=
orderListQuantity
+
parseFloat
(
data
.
quantity
);
if
(
parseFloat
(
data
.
quantity
)
==
0
||
data
.
quantity
==
""
)
{
quantyStatu
=
true
;
}
if
(
data
.
demandDate
[
0
]
==
""
||
data
.
demandDate
[
1
]
==
""
)
{
dateStatu
=
true
;
}
});
if
(
dateStatu
)
{
this
.
$Message
.
error
(
"子订单开始完成时间不能为空,请重新输入时间!"
);
return
false
;
}
if
(
quantyStatu
)
{
this
.
$Message
.
error
(
"子订单计划数量不能为0,请重新输入计划数量!"
);
}
else
if
(
returnDatalist
.
quantity
!=
orderListQuantity
)
{
this
.
$Message
.
error
(
"计划总数量与订单数量不一致,请重新输入计划数量!"
);
}
else
{
this
.
ModalInfo
=
true
;
this
.
ModalInfoStaut
=
"split"
;
this
.
dataListRetrun
=
returnDatalist
;
this
.
metCodesStrTxt
=
"确定分解订单 "
+
returnDatalist
.
mesCode
+
"?"
;
}
}
else
{
this
.
$Message
.
error
(
"请确定计划数量!"
);
}
},
{
key
:
"projectNumber"
,
title
:
this
.
l
(
"projectNumber"
),
align
:
"left"
,
easy
:
true
,
high
:
true
modalInfoOk
()
{
let
itemsTemp
=
[];
this
.
dataListRetrun
.
items
.
forEach
(
ele
=>
{
let
objTemp
=
{};
objTemp
.
mesCode
=
ele
.
mesCode
;
objTemp
.
quantity
=
Number
(
ele
.
quantity
);
objTemp
.
demandStartDate
=
ele
.
demandStartDate
+
" 00:00:01"
;
objTemp
.
demandFinishDate
=
ele
.
demandFinishDate
+
" 23:59:59"
;
itemsTemp
.
push
(
objTemp
);
});
let
params
=
{
id
:
this
.
dataListRetrun
.
id
,
items
:
itemsTemp
};
Api
.
mesorderdivide
(
params
).
then
(
res
=>
{
if
(
res
.
result
)
{
this
.
$Message
.
success
(
"订单分解成功!"
);
this
.
$refs
.
grid
.
load
();
}
else
{
this
.
$Message
.
error
(
"订单分解失败!"
);
}
});
this
.
splitModal
=
false
;
this
.
ModalInfo
=
false
;
},
{
key
:
"urgencyLevel"
,
title
:
this
.
l
(
"urgencyLevel"
),
align
:
"center"
,
high
:
true
,
code
:
"plan.order.urgencyLevel"
,
width
:
100
//打开送审modal
openSendViewModal
()
{
this
.
actIds
=
[];
this
.
delNum
=
0
;
if
(
this
.
rowDataArry
.
length
>
0
)
{
this
.
rowDataArry
.
forEach
(
data
=>
{
this
.
actIds
.
push
(
data
.
id
);
if
(
data
.
status
!=
1
)
{
//判断非新建状态的订单
this
.
delNum
+=
1
;
}
});
setTimeout
(()
=>
{
if
(
this
.
delNum
>
0
)
{
this
.
$Message
.
error
(
"所选的订单中有不可送审的订单!"
);
this
.
actIds
=
[];
this
.
sendViewModal
=
false
;
}
else
{
this
.
sendViewModal
=
true
;
}
},
400
);
}
else
{
this
.
$Message
.
error
(
"请选择订单"
);
}
},
//确定送审
sendViewOk
()
{
this
.
dataListRetrunNew
.
idList
=
[];
this
.
dataListRetrunNew
.
codeList
=
[];
this
.
dataListRetrunNew
.
operatorIdList
=
[];
this
.
rowDataArry
.
forEach
(
item
=>
{
this
.
dataListRetrunNew
.
idList
.
push
(
item
.
id
);
this
.
dataListRetrunNew
.
codeList
.
push
(
item
.
mesCode
);
});
let
ues
=
this
.
$refs
.
userProcess
;
this
.
dataListRetrunNew
.
operatorIdList
=
this
.
$refs
.
orderSendView
.
getUsers
();
//返回审批数据
//alert(JSON.stringify(this.dataListRetrunNew));
this
.
$http
.
order
.
batchstart
(
this
.
dataListRetrunNew
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"订单送审成功!"
);
this
.
$refs
.
grid
.
load
();
}
else
{
this
.
$Message
.
error
(
"订单送审失败!"
);
}
});
},
{
key
:
"productingPreparationPeople"
,
title
:
this
.
l
(
"productingPreparationPeople"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
'workShopName'
//打开派发
openSendModal
()
{
this
.
actIds
=
[];
this
.
delNum
=
0
;
if
(
this
.
rowDataArry
.
length
>
0
)
{
this
.
rowDataArry
.
forEach
(
data
=>
{
this
.
actIds
.
push
(
data
.
id
);
if
(
data
.
status
!=
3
)
{
//判断非新建状态的订单
this
.
delNum
+=
1
;
}
});
setTimeout
(()
=>
{
if
(
this
.
delNum
>
0
)
{
this
.
$Message
.
error
(
"所选的订单中有不可派发的订单!"
);
this
.
actIds
=
[];
this
.
sendModal
=
false
;
}
else
{
this
.
sendModal
=
true
;
}
},
400
);
}
else
{
this
.
$Message
.
error
(
"请选择订单"
);
}
},
{
key
:
"productingPreparationFinishDate"
,
title
:
this
.
l
(
"productingPreparationFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
//确定派发
sendOk
()
{
this
.
$refs
.
orderSend
.
$refs
[
"formValidate"
].
validate
(
valid
=>
{
if
(
valid
)
{
let
ids
=
this
.
arrayIds
;
let
objInfoTem
=
this
.
$refs
.
orderSend
.
returnData
();
let
parms
=
[];
ids
.
forEach
(
e
=>
{
let
objInfo
=
this
.
$u
.
clone
(
objInfoTem
);
objInfo
.
id
=
e
;
parms
.
push
(
objInfo
);
});
Api
.
mesorderdistribute
(
parms
)
.
then
(
r
=>
{
if
(
r
.
success
)
{
if
(
r
.
result
)
{
this
.
$refs
.
grid
.
load
();
this
.
sendModal
=
false
;
this
.
$Message
.
success
(
"派发成功"
);
}
else
{
this
.
sendModal
=
false
;
this
.
$Message
.
error
(
"派发失败"
);
}
}
else
{
this
.
sendModal
=
false
;
this
.
$Message
.
error
(
"派发失败"
);
}
})
.
catch
(
err
=>
{
this
.
sendModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
});
}
});
},
{
key
:
"quotationPeople"
,
title
:
this
.
l
(
"quotationPeople"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"user"
//单条删除
remove
(
row
)
{
let
metCodesSingle
=
[];
//没有子订单的订单
let
metCodesFather
=
[];
//有子订单的原始订单
this
.
delMsg
=
""
;
this
.
delNum
=
0
;
this
.
actIds
=
[];
this
.
$refs
.
grid
.
cancelFooterToolbar
();
this
.
actIds
.
push
(
row
.
id
);
if
(
row
.
id
!=
row
.
rootId
)
{
this
.
sondeletecheck
(
row
.
rootId
);
metCodesFather
.
push
(
row
.
rootCode
);
}
else
{
metCodesSingle
.
push
(
row
.
mesCode
);
}
setTimeout
(()
=>
{
if
(
this
.
delNum
>
0
)
{
this
.
$Message
.
error
(
"删除的原始订单中有非新建状态的子订单!"
);
this
.
actIds
=
[];
return
false
;
}
else
{
let
metCodesSingleStr
=
JSON
.
stringify
(
metCodesSingle
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
let
metCodesFatherStr
=
JSON
.
stringify
(
metCodesFather
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
if
(
row
.
id
==
row
.
rootId
)
{
this
.
delMsg
=
metCodesSingleStr
;
}
else
{
this
.
delMsg
=
metCodesFatherStr
+
" 的子订单"
;
}
this
.
deletelModal
=
true
;
}
},
400
);
},
{
key
:
"quotationFinishDate"
,
title
:
this
.
l
(
"quotationFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
//批量删除
removeList
()
{
let
metCodesSingle
=
[];
//没有子订单的订单
let
metCodesFather
=
[];
//有子订单的原始订单
this
.
actIds
=
[];
this
.
delNum
=
0
;
if
(
this
.
rowDataArry
.
length
>
0
)
{
this
.
rowDataArry
.
forEach
(
data
=>
{
this
.
actIds
.
push
(
data
.
id
);
if
(
data
.
status
!=
1
)
{
//判断非新建状态的订单
this
.
delNum
+=
1
;
}
else
if
(
data
.
id
!=
data
.
rootId
)
{
//判断子订单是否可以删除
this
.
sondeletecheck
(
data
.
rootId
);
if
(
data
.
id
!=
data
.
rootId
&&
data
.
status
==
1
)
{
metCodesFather
.
push
(
data
.
rootCode
);
}
}
else
{
if
(
data
.
id
==
data
.
rootId
&&
data
.
status
==
1
)
{
metCodesSingle
.
push
(
data
.
mesCode
);
}
}
});
setTimeout
(()
=>
{
if
(
this
.
delNum
>
0
)
{
this
.
$Message
.
error
(
"所选的订单中有不可删除的订单!"
);
this
.
actIds
=
[];
this
.
deletelModal
=
false
;
}
else
{
this
.
delMsg
=
""
;
let
metCodesFatherNew
=
Array
.
from
(
new
Set
(
metCodesFather
));
let
metCodesSingleStr
=
JSON
.
stringify
(
metCodesSingle
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
let
metCodesFatherStr
=
JSON
.
stringify
(
metCodesFatherNew
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
if
(
metCodesSingle
.
length
>
0
&&
metCodesFather
.
length
==
0
)
{
this
.
delMsg
=
metCodesSingleStr
;
}
else
if
(
metCodesSingle
.
length
==
0
&&
metCodesFather
.
length
>
0
)
{
this
.
delMsg
=
metCodesFatherStr
+
" 的子订单"
;
}
else
if
(
metCodesSingle
.
length
>
0
&&
metCodesFather
.
length
>
0
)
{
this
.
delMsg
=
metCodesSingleStr
+
" 以及 订单:"
+
metCodesFatherStr
+
" 的子订单"
;
}
this
.
deletelModal
=
true
;
}
},
400
);
}
else
{
this
.
$Message
.
error
(
"请选择订单"
);
}
},
{
key
:
"demandStartDate"
,
title
:
this
.
l
(
"demandStartDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"date"
//删除前判断子订单是否能删除
sondeletecheck
(
code
)
{
let
param
=
{
id
:
code
};
Api
.
sondeletecheck
(
param
).
then
(
res
=>
{
if
(
res
.
result
==
1
)
{
this
.
delNum
+=
0
;
}
else
{
this
.
delNum
+=
1
;
}
});
},
{
key
:
"demandFinishDate"
,
title
:
this
.
l
(
"demandFinishDate"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"date"
//删除前判断子订单
sondeletecheck1
(
code
)
{
let
param
=
{
id
:
code
};
let
delStaut
=
0
;
Api
.
sondeletecheck
(
param
).
then
(
res
=>
{
if
(
res
.
result
==
1
)
{
//可以删除
delStaut
=
0
;
}
else
{
delStaut
=
1
;
}
});
return
delStaut
;
},
{
key
:
"creatorUserId"
,
title
:
this
.
$t
(
"creatorUserId"
),
align
:
"left"
,
high
:
true
,
type
:
"user"
//删除确定
removeOk
()
{
let
params
=
{
ids
:
this
.
actIds
};
Api
.
mesorderdelete
(
params
)
.
then
(
r
=>
{
if
(
r
.
success
)
{
if
(
r
.
result
)
{
this
.
$refs
.
grid
.
load
();
this
.
deletelModal
=
false
;
this
.
$Message
.
success
(
"删除成功"
);
}
else
{
this
.
deletelModal
=
false
;
this
.
$Message
.
error
(
"删除失败"
);
}
}
else
{
this
.
deletelModal
=
false
;
this
.
$Message
.
error
(
"删除失败"
);
}
})
.
catch
(
err
=>
{
this
.
deletelModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
});
},
{
key
:
"creationTime"
,
title
:
this
.
$t
(
"creationTime"
),
align
:
"center"
,
high
:
true
,
width
:
180
removeCancel
()
{
this
.
deletelModal
=
false
;
},
{
key
:
"lastModifierUserId"
,
title
:
this
.
$t
(
"lastModifierUserId"
),
hide
:
true
,
align
:
"left"
,
high
:
true
,
type
:
"user"
cancel
()
{
this
.
curId
=
0
;
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
deletedlModal
=
false
;
},
{
key
:
"lastModificationTime"
,
title
:
this
.
$t
(
"lastModificationTime"
),
hide
:
true
,
align
:
"center"
,
high
:
true
,
width
:
180
l
(
key
)
{
let
vkey
=
"mes_plan"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
180
,
align
:
"left"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
detail
(
params
.
row
)
}
},
"查看"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
)
},
style
:
this
.
wfstatu
==
1
?
(
(
params
.
row
.
status
==
1
&&
params
.
row
.
id
==
params
.
row
.
rootId
&&
params
.
row
.
divideMark
!=
0
)
||
params
.
row
.
id
!=
params
.
row
.
rootId
||
params
.
row
.
status
!=
1
?
"display:none"
:
""
)
:
(
(
params
.
row
.
status
==
3
&&
params
.
row
.
id
==
params
.
row
.
rootId
&&
params
.
row
.
divideMark
!=
0
)
||
params
.
row
.
id
!=
params
.
row
.
rootId
||
params
.
row
.
status
!=
3
?
"display:none"
:
""
)
},
"编辑"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"remove"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
)
},
style
:
this
.
wfstatu
==
1
?
(
(
params
.
row
.
status
==
1
&&
params
.
row
.
id
==
params
.
row
.
rootId
&&
params
.
row
.
divideMark
!=
0
)
||
params
.
row
.
id
!=
params
.
row
.
rootId
||
params
.
row
.
status
!=
1
?
"display:none"
:
""
)
:
(
(
params
.
row
.
status
==
3
&&
params
.
row
.
id
==
params
.
row
.
rootId
&&
params
.
row
.
divideMark
!=
0
)
||
params
.
row
.
id
!=
params
.
row
.
rootId
||
params
.
row
.
status
!=
3
?
"display:none"
:
""
)
},
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
},
on
:
{
click
:
()
=>
this
.
split
(
params
.
row
)
},
style
:
this
.
wfstatu
==
1
?
(
(
params
.
row
.
divideMark
!=
0
&&
params
.
row
.
id
==
params
.
row
.
rootId
)
||
params
.
row
.
status
!=
1
||
params
.
row
.
quantity
<=
1
?
"display:none"
:
""
)
:
(
(
params
.
row
.
divideMark
!=
0
&&
params
.
row
.
id
==
params
.
row
.
rootId
)
||
params
.
row
.
status
!=
3
||
params
.
row
.
quantity
<=
1
?
"display:none"
:
""
)
},
"分解"
)
]);
}
}
],
treeData
:
[],
treeInputSearch
:
""
,
ocolumn
:
[],
treeHeight
:
""
,
tableHeight
:
""
,
ids
:
[],
orderSearchForm
:
{
productId
:
""
,
//产品id
productName
:
""
,
//产品名称
taskType
:
""
,
//任务类型
quantity
:
null
,
//数量
taskRequire
:
""
,
//任务接点要求
demandStartDate
:
""
,
//开始时间
demandFinishDate
:
""
,
//完成时间
remark
:
""
,
//备注
projectNumber
:
""
,
//项目号
batchNumber
:
""
,
//批次号
urgencyLevel
:
null
//紧急程度
},
list
:
[],
//data测试数据
dataT
:
[],
dataTemp
:
[],
data1
:
[],
selectdata
:
[],
//以下为手写死数据集:
orderCatList
:
[],
//订单类型下拉
outerCodeList
:
[],
//型号外部代码下拉
missionCodeList
:
[],
//任务号下拉
stageList
:
[],
//阶段下拉
materailList
:
[],
//材料下拉
routingAccessList
:
[],
//工艺方法下拉
drawNumberList
:
[],
//图号下拉
docNameList
:
[],
//文档名称下拉
ownerGustList
:
[],
//甲方客户下拉
mainDeptList
:
[],
//厂内主体部门下拉
taskTypeList
:
[],
//任务类型
statusList
:
[],
//状态类型
rowData
:
{},
//编辑、查看的当前行数据
rowDataArry
:
[],
ModalInfoStaut
:
""
,
sendList
:
[],
metCodesStrTxt
:
""
,
actIds
:
[],
//批量处理时ids
actMescodes
:
[],
delNum
:
0
,
//判断是否可以进行修改
arrayIds
:
[],
//选择列表后的ids
delMsg
:
""
,
//删除提示信息
dataListRetrunNew
:
{
schemaId
:
"123327da-42b3-41f6-b785-cf933f137a95"
,
//订单送审的schemaId
idList
:
[],
//订单id List
codeList
:
[],
//订单编号List
operatorIdList
:
[]
//操作员id
},
//确定后返回数据
wfstatu
:
1
//流程是否启用1 禁用 0启用
};
},
created
()
{
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
this
.
initTree
();
let
params
=
{
id
:
"123327da-42b3-41f6-b785-cf933f137a95"
};
this
.
$api
.
get
(
`
${
workflowUrl
}
/schema/getbyid`
,
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
let
wfStatus
=
res
.
result
.
status
;
if
(
wfStatus
==
0
)
{
this
.
wfstatu
=
1
;
}
else
{
this
.
wfstatu
=
3
;
}
}
});
//this.dataformat();//data传数据转为tree类型
this
.
tableHeight
=
window
.
innerHeight
-
220
;
//this.$refs.CustomTable.getTableHeight(this.tableHeight);
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
treeHeight
=
window
.
screenHeight
-
150
;
this
.
tableHeight
=
window
.
screenHeight
-
220
;
//this.$refs.CustomTable.getTableHeight(this.tableHeight);
})();
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
await
store
.
dispatch
(
'loadDepartments'
);
//加载部门
},
computed
:
{
searchList
()
{
let
nodeList
=
this
.
treeData
;
var
text
=
this
.
treeInputSearch
;
var
newNodeList
=
[];
function
searchTree
(
nodeLists
,
value
)
{
for
(
let
i
=
0
;
i
<
nodeLists
.
length
;
i
++
)
{
if
(
nodeLists
[
i
].
title
.
indexOf
(
value
)
!=
-
1
)
{
newNodeList
.
push
(
nodeLists
[
i
]);
}
else
if
(
nodeLists
[
i
].
children
.
length
>
0
)
{
searchTree
(
nodeLists
[
i
].
children
,
value
);
}
}
}
if
(
text
!=
""
)
{
searchTree
(
nodeList
,
text
);
}
else
{
return
nodeList
;
}
return
newNodeList
;
}
},
methods
:
{
addOk
()
{
this
.
$refs
.
grid
.
load
();
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
curId
=
0
;
},
search
()
{
this
.
easySearch
.
keys
.
value
=
this
.
easySearch
.
keys
.
value
.
trim
();
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
detail
(
row
)
{
this
.
detailModal
=
true
;
this
.
rowData
=
row
;
},
edit
(
row
)
{
this
.
editModal
=
true
;
this
.
rowData
=
row
;
},
split
(
row
)
{
if
(
row
.
quantity
>
1
)
{
this
.
splitModal
=
true
;
this
.
rowData
=
row
;
}
else
{
this
.
$Message
.
error
(
"数量为1,不能进行分解"
);
}
},
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
},
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
},
productSearch
(
id
,
item
,
productIds
,
ids
)
{
let
where
=
{
bomId
:
{
op
:
"In"
,
value
:
ids
}
};
this
.
$refs
.
grid
.
reload
(
where
);
},
//确定分解
orderSplitOk
()
{
let
returnDatalist
=
this
.
$refs
.
orderSplit
.
returnDataList
();
let
orderQuantity
=
returnDatalist
.
quantity
;
let
orderListQuantity
=
0
;
let
quantyStatu
=
false
;
//子订单计划数是否为0或空
let
dateStatu
=
false
;
//子订单开始完成时间是否为空
if
(
returnDatalist
.
items
.
length
>
0
)
{
returnDatalist
.
items
.
forEach
(
data
=>
{
orderListQuantity
=
orderListQuantity
+
parseFloat
(
data
.
quantity
);
if
(
parseFloat
(
data
.
quantity
)
==
0
||
data
.
quantity
==
""
)
{
quantyStatu
=
true
;
}
if
(
data
.
demandDate
[
0
]
==
""
||
data
.
demandDate
[
1
]
==
""
)
{
dateStatu
=
true
;
}
});
if
(
dateStatu
)
{
this
.
$Message
.
error
(
"子订单开始完成时间不能为空,请重新输入时间!"
);
return
false
;
}
if
(
quantyStatu
)
{
this
.
$Message
.
error
(
"子订单计划数量不能为0,请重新输入计划数量!"
);
}
else
if
(
returnDatalist
.
quantity
!=
orderListQuantity
)
{
this
.
$Message
.
error
(
"计划总数量与订单数量不一致,请重新输入计划数量!"
);
}
else
{
this
.
ModalInfo
=
true
;
this
.
ModalInfoStaut
=
"split"
;
this
.
dataListRetrun
=
returnDatalist
;
this
.
metCodesStrTxt
=
"确定分解订单 "
+
returnDatalist
.
mesCode
+
"?"
;
}
}
else
{
this
.
$Message
.
error
(
"请确定计划数量!"
);
}
},
modalInfoOk
()
{
let
itemsTemp
=
[];
this
.
dataListRetrun
.
items
.
forEach
(
ele
=>
{
let
objTemp
=
{};
objTemp
.
mesCode
=
ele
.
mesCode
;
objTemp
.
quantity
=
Number
(
ele
.
quantity
);
objTemp
.
demandStartDate
=
ele
.
demandStartDate
+
" 00:00:01"
;
objTemp
.
demandFinishDate
=
ele
.
demandFinishDate
+
" 23:59:59"
;
itemsTemp
.
push
(
objTemp
);
});
let
params
=
{
id
:
this
.
dataListRetrun
.
id
,
items
:
itemsTemp
};
Api
.
mesorderdivide
(
params
).
then
(
res
=>
{
if
(
res
.
result
)
{
this
.
$Message
.
success
(
"订单分解成功!"
);
this
.
$refs
.
grid
.
load
();
}
else
{
this
.
$Message
.
error
(
"订单分解失败!"
);
}
});
this
.
splitModal
=
false
;
this
.
ModalInfo
=
false
;
},
//打开送审modal
openSendViewModal
()
{
this
.
actIds
=
[];
this
.
delNum
=
0
;
if
(
this
.
rowDataArry
.
length
>
0
)
{
this
.
rowDataArry
.
forEach
(
data
=>
{
this
.
actIds
.
push
(
data
.
id
);
if
(
data
.
status
!=
1
)
{
//判断非新建状态的订单
this
.
delNum
+=
1
;
}
});
setTimeout
(()
=>
{
if
(
this
.
delNum
>
0
)
{
this
.
$Message
.
error
(
"所选的订单中有不可送审的订单!"
);
this
.
actIds
=
[];
this
.
sendViewModal
=
false
;
}
else
{
this
.
sendViewModal
=
true
;
}
},
400
);
}
else
{
this
.
$Message
.
error
(
"请选择订单"
);
}
},
//确定送审
sendViewOk
()
{
this
.
dataListRetrunNew
.
idList
=
[];
this
.
dataListRetrunNew
.
codeList
=
[];
this
.
dataListRetrunNew
.
operatorIdList
=
[];
this
.
rowDataArry
.
forEach
(
item
=>
{
this
.
dataListRetrunNew
.
idList
.
push
(
item
.
id
);
this
.
dataListRetrunNew
.
codeList
.
push
(
item
.
mesCode
);
});
let
ues
=
this
.
$refs
.
userProcess
;
this
.
dataListRetrunNew
.
operatorIdList
=
this
.
$refs
.
orderSendView
.
getUsers
();
//返回审批数据
//alert(JSON.stringify(this.dataListRetrunNew));
this
.
$http
.
order
.
batchstart
(
this
.
dataListRetrunNew
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"订单送审成功!"
);
this
.
$refs
.
grid
.
load
();
}
else
{
this
.
$Message
.
error
(
"订单送审失败!"
);
}
});
},
//打开派发
openSendModal
()
{
this
.
actIds
=
[];
this
.
delNum
=
0
;
if
(
this
.
rowDataArry
.
length
>
0
)
{
this
.
rowDataArry
.
forEach
(
data
=>
{
this
.
actIds
.
push
(
data
.
id
);
if
(
data
.
status
!=
3
)
{
//判断非新建状态的订单
this
.
delNum
+=
1
;
}
});
setTimeout
(()
=>
{
if
(
this
.
delNum
>
0
)
{
this
.
$Message
.
error
(
"所选的订单中有不可派发的订单!"
);
this
.
actIds
=
[];
this
.
sendModal
=
false
;
}
else
{
this
.
sendModal
=
true
;
}
},
400
);
}
else
{
this
.
$Message
.
error
(
"请选择订单"
);
}
},
//确定派发
sendOk
()
{
this
.
$refs
.
orderSend
.
$refs
[
"formValidate"
].
validate
(
valid
=>
{
if
(
valid
)
{
let
ids
=
this
.
arrayIds
;
let
objInfoTem
=
this
.
$refs
.
orderSend
.
returnData
();
let
parms
=
[];
ids
.
forEach
(
e
=>
{
let
objInfo
=
this
.
$u
.
clone
(
objInfoTem
);
objInfo
.
id
=
e
;
parms
.
push
(
objInfo
);
});
Api
.
mesorderdistribute
(
parms
)
.
then
(
r
=>
{
if
(
r
.
success
)
{
if
(
r
.
result
)
{
this
.
$refs
.
grid
.
load
();
this
.
sendModal
=
false
;
this
.
$Message
.
success
(
"派发成功"
);
//new tree start
initTree
()
{
var
sumData
=
[];
this
.
$http
.
order
.
getallselecttree
().
then
(
res
=>
{
//alert(JSON.stringify(res))
if
(
res
.
result
)
{
for
(
var
i
=
0
;
i
<
res
.
result
.
length
;
i
++
)
{
sumData
=
sumData
.
concat
(
res
.
result
[
i
]);
}
this
.
treeData
=
sumData
;
this
.
data1
=
JSON
.
parse
(
JSON
.
stringify
(
sumData
));
}
else
{
this
.
sendModal
=
false
;
this
.
$Message
.
error
(
"派发失败"
);
this
.
$Message
.
error
(
"加载产品树失败!"
);
}
}
else
{
this
.
sendModal
=
false
;
this
.
$Message
.
error
(
"派发失败"
);
}
})
.
catch
(
err
=>
{
this
.
sendModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
});
}
});
},
//单条删除
remove
(
row
)
{
let
metCodesSingle
=
[];
//没有子订单的订单
let
metCodesFather
=
[];
//有子订单的原始订单
this
.
delMsg
=
""
;
this
.
delNum
=
0
;
this
.
actIds
=
[];
this
.
$refs
.
grid
.
cancelFooterToolbar
();
this
.
actIds
.
push
(
row
.
id
);
if
(
row
.
id
!=
row
.
rootId
)
{
this
.
sondeletecheck
(
row
.
rootId
);
metCodesFather
.
push
(
row
.
rootCode
);
}
else
{
metCodesSingle
.
push
(
row
.
mesCode
);
}
setTimeout
(()
=>
{
if
(
this
.
delNum
>
0
)
{
this
.
$Message
.
error
(
"删除的原始订单中有非新建状态的子订单!"
);
this
.
actIds
=
[];
return
false
;
}
else
{
let
metCodesSingleStr
=
JSON
.
stringify
(
metCodesSingle
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
let
metCodesFatherStr
=
JSON
.
stringify
(
metCodesFather
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
if
(
row
.
id
==
row
.
rootId
)
{
this
.
delMsg
=
metCodesSingleStr
;
}
else
{
this
.
delMsg
=
metCodesFatherStr
+
" 的子订单"
;
}
this
.
deletelModal
=
true
;
}
},
400
);
},
//批量删除
removeList
()
{
let
metCodesSingle
=
[];
//没有子订单的订单
let
metCodesFather
=
[];
//有子订单的原始订单
this
.
actIds
=
[];
this
.
delNum
=
0
;
if
(
this
.
rowDataArry
.
length
>
0
)
{
this
.
rowDataArry
.
forEach
(
data
=>
{
this
.
actIds
.
push
(
data
.
id
);
if
(
data
.
status
!=
1
)
{
//判断非新建状态的订单
this
.
delNum
+=
1
;
}
else
if
(
data
.
id
!=
data
.
rootId
)
{
//判断子订单是否可以删除
this
.
sondeletecheck
(
data
.
rootId
);
if
(
data
.
id
!=
data
.
rootId
&&
data
.
status
==
1
)
{
metCodesFather
.
push
(
data
.
rootCode
);
}
}
else
{
if
(
data
.
id
==
data
.
rootId
&&
data
.
status
==
1
)
{
metCodesSingle
.
push
(
data
.
mesCode
);
}
}
});
setTimeout
(()
=>
{
if
(
this
.
delNum
>
0
)
{
this
.
$Message
.
error
(
"所选的订单中有不可删除的订单!"
);
this
.
actIds
=
[];
this
.
deletelModal
=
false
;
}
else
{
this
.
delMsg
=
""
;
let
metCodesFatherNew
=
Array
.
from
(
new
Set
(
metCodesFather
));
let
metCodesSingleStr
=
JSON
.
stringify
(
metCodesSingle
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
let
metCodesFatherStr
=
JSON
.
stringify
(
metCodesFatherNew
)
.
replace
(
"["
,
""
)
.
replace
(
"]"
,
""
)
.
replace
(
/
\"
/g
,
""
);
if
(
metCodesSingle
.
length
>
0
&&
metCodesFather
.
length
==
0
)
{
this
.
delMsg
=
metCodesSingleStr
;
}
else
if
(
metCodesSingle
.
length
==
0
&&
metCodesFather
.
length
>
0
)
{
this
.
delMsg
=
metCodesFatherStr
+
" 的子订单"
;
}
else
if
(
metCodesSingle
.
length
>
0
&&
metCodesFather
.
length
>
0
)
{
this
.
delMsg
=
metCodesSingleStr
+
" 以及 订单:"
+
metCodesFatherStr
+
" 的子订单"
;
}
this
.
deletelModal
=
true
;
}
},
400
);
}
else
{
this
.
$Message
.
error
(
"请选择订单"
);
}
},
//删除前判断子订单是否能删除
sondeletecheck
(
code
)
{
let
param
=
{
id
:
code
};
Api
.
sondeletecheck
(
param
).
then
(
res
=>
{
if
(
res
.
result
==
1
)
{
this
.
delNum
+=
0
;
}
else
{
this
.
delNum
+=
1
;
}
});
},
//删除前判断子订单
sondeletecheck1
(
code
)
{
let
param
=
{
id
:
code
};
let
delStaut
=
0
;
Api
.
sondeletecheck
(
param
).
then
(
res
=>
{
if
(
res
.
result
==
1
)
{
//可以删除
delStaut
=
0
;
}
else
{
delStaut
=
1
;
}
});
return
delStaut
;
},
//删除确定
removeOk
()
{
let
params
=
{
ids
:
this
.
actIds
};
Api
.
mesorderdelete
(
params
)
.
then
(
r
=>
{
if
(
r
.
success
)
{
if
(
r
.
result
)
{
this
.
$refs
.
grid
.
load
();
this
.
deletelModal
=
false
;
this
.
$Message
.
success
(
"删除成功"
);
},
selectTreeNode
(
value
)
{
if
(
value
.
length
>
0
)
{
this
.
ids
=
[];
this
.
getAllIds
(
value
);
if
(
this
.
ids
.
length
>
0
)
{
this
.
orderSearchForm
.
productId
=
this
.
ids
;
}
else
{
this
.
orderSearchForm
.
productId
=
[];
}
this
.
easySearch
.
productId
.
value
=
this
.
orderSearchForm
.
productId
;
this
.
$refs
.
grid
.
easySearch
();
}
else
{
this
.
deletelModal
=
false
;
this
.
$Message
.
error
(
"删除失败"
);
this
.
easySearch
.
productId
.
value
=
[]
;
this
.
$refs
.
grid
.
easySearch
(
);
}
}
else
{
this
.
deletelModal
=
false
;
this
.
$Message
.
error
(
"删除失败"
);
}
})
.
catch
(
err
=>
{
this
.
deletelModal
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
});
},
removeCancel
()
{
this
.
deletelModal
=
false
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
deletedlModal
=
false
;
},
l
(
key
)
{
let
vkey
=
"mes_plan"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
//new tree start
initTree
()
{
var
sumData
=
[];
this
.
$http
.
order
.
getallselecttree
().
then
(
res
=>
{
//alert(JSON.stringify(res))
if
(
res
.
result
)
{
for
(
var
i
=
0
;
i
<
res
.
result
.
length
;
i
++
)
{
sumData
=
sumData
.
concat
(
res
.
result
[
i
]);
}
this
.
treeData
=
sumData
;
this
.
data1
=
JSON
.
parse
(
JSON
.
stringify
(
sumData
));
}
else
{
this
.
$Message
.
error
(
"加载产品树失败!"
);
}
});
},
selectTreeNode
(
value
)
{
if
(
value
.
length
>
0
)
{
this
.
ids
=
[];
this
.
getAllIds
(
value
);
if
(
this
.
ids
.
length
>
0
)
{
this
.
orderSearchForm
.
productId
=
this
.
ids
;
}
else
{
this
.
orderSearchForm
.
productId
=
[];
}
this
.
easySearch
.
productId
.
value
=
this
.
orderSearchForm
.
productId
;
this
.
$refs
.
grid
.
easySearch
();
}
else
{
this
.
easySearch
.
productId
.
value
=
[];
this
.
$refs
.
grid
.
easySearch
();
}
},
//得到此树节点下所有是产品的productId
getAllIds
(
trees
)
{
trees
.
forEach
((
data
,
index
)
=>
{
var
that
=
this
;
if
(
data
.
isProduct
)
{
this
.
ids
.
push
(
data
.
productId
);
}
if
(
data
.
children
.
length
>
0
)
{
this
.
getAllIds
(
data
.
children
);
}
});
},
handleSelect
(
data
)
{
if
(
data
.
length
>
0
)
{
this
.
selectdata
=
[];
this
.
selectdata
=
data
;
this
.
list
=
[];
this
.
list
.
push
({
label
:
data
[
0
].
title
,
value
:
data
[
0
].
id
});
//this.formValidate.classType=data[0].id;
if
(
data
[
0
].
isProduct
==
"1"
)
{
this
.
orderSearchForm
.
productName
=
data
[
0
].
id
;
this
.
orderSearchForm
.
productId
=
data
[
0
].
productId
;
}
else
{
this
.
$Message
.
error
(
"此节点不是产品,请选择产品节点!"
);
}
}
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
//渲染树的样式
return
h
(
"span"
,
{
style
:
{
color
:
data
.
isProduct
!=
"1"
?
"#249E91"
:
"#333"
,
//根据选中状态设置样式
cursor
:
"pointer"
},
on
:
{
click
:
()
=>
{
let
arrTree
=
[];
arrTree
.
push
(
data
);
this
.
handleSelect
(
arrTree
);
//手动选择树节点
},
//得到此树节点下所有是产品的productId
getAllIds
(
trees
)
{
trees
.
forEach
((
data
,
index
)
=>
{
var
that
=
this
;
if
(
data
.
isProduct
)
{
this
.
ids
.
push
(
data
.
productId
);
}
if
(
data
.
children
.
length
>
0
)
{
this
.
getAllIds
(
data
.
children
);
}
});
},
handleSelect
(
data
)
{
if
(
data
.
length
>
0
)
{
this
.
selectdata
=
[];
this
.
selectdata
=
data
;
this
.
list
=
[];
this
.
list
.
push
({
label
:
data
[
0
].
title
,
value
:
data
[
0
].
id
});
//this.formValidate.classType=data[0].id;
if
(
data
[
0
].
isProduct
==
"1"
)
{
this
.
orderSearchForm
.
productName
=
data
[
0
].
id
;
this
.
orderSearchForm
.
productId
=
data
[
0
].
productId
;
}
else
{
this
.
$Message
.
error
(
"此节点不是产品,请选择产品节点!"
);
}
}
}
},
data
.
title
);
},
//new tree end
//list start
onSelect
(
a
,
b
)
{
//alert(JSON.stringify(a));
//批量选择
let
selectRows
=
a
;
this
.
arrayIds
=
[];
this
.
rowDataArry
=
a
;
selectRows
.
forEach
(
e
=>
{
this
.
arrayIds
.
push
(
e
.
id
);
});
},
//list end
//将数组数据转为tree
dataformat
()
{
this
.
dataT
=
this
.
$u
.
toTree
(
this
.
dataTemp
,
0
,
u
=>
{
if
(
u
.
divideMark
==
1
)
{
u
.
_disabled
=
true
;
}
u
.
_showChildren
=
true
;
renderContent
(
h
,
{
root
,
node
,
data
})
{
//渲染树的样式
return
h
(
"span"
,
{
style
:
{
color
:
data
.
isProduct
!=
"1"
?
"#249E91"
:
"#333"
,
//根据选中状态设置样式
cursor
:
"pointer"
},
on
:
{
click
:
()
=>
{
let
arrTree
=
[];
arrTree
.
push
(
data
);
this
.
handleSelect
(
arrTree
);
//手动选择树节点
}
}
},
data
.
title
);
},
"rootId"
);
this
.
dataT
=
this
.
$u
.
clone
(
this
.
dataT
);
//new tree end
//list start
onSelect
(
a
,
b
)
{
//alert(JSON.stringify(a));
//批量选择
let
selectRows
=
a
;
this
.
arrayIds
=
[];
this
.
rowDataArry
=
a
;
selectRows
.
forEach
(
e
=>
{
this
.
arrayIds
.
push
(
e
.
id
);
});
},
//list end
//将数组数据转为tree
dataformat
()
{
this
.
dataT
=
this
.
$u
.
toTree
(
this
.
dataTemp
,
0
,
u
=>
{
if
(
u
.
divideMark
==
1
)
{
u
.
_disabled
=
true
;
}
u
.
_showChildren
=
true
;
},
"rootId"
);
this
.
dataT
=
this
.
$u
.
clone
(
this
.
dataT
);
},
//批量导入start
//批量导入end
}
}
};
</
script
>
<
style
lang=
"less"
>
.full {
margin-top: 0;
.content {
margin-top: 10px;
.ivu-icon-ios-add:before {
content: "\f341";
}
.ivu-icon-ios-remove:before {
content: "\f33d";
margin-top: 0;
.content {
margin-top: 10px;
.ivu-icon-ios-add:before {
content: "\f341";
}
.ivu-icon-ios-remove:before {
content: "\f33d";
}
}
}
}
</
style
>
\ No newline at end of file
</
style
>
pages/resource/resource/api.js
View file @
66fdd543
...
...
@@ -44,5 +44,9 @@ export default {
getmaterialdefinitionproperty
(
params
){
return
Api
.
get
(
`
${
material
}
/custompropertydefinition/getmaterialdefinitionproperty`
,
params
);
},
//批量导入
import
(
params
)
{
return
Api
.
post
(
`
${
resourceUrl
}
/resourceimportservice/import`
,
params
);
},
}
\ No newline at end of file
pages/resource/resource/index.vue
View file @
66fdd543
<
template
>
<Layout
class=
"full"
>
<Layout
class=
"full"
>
<Sider
hide-trigger
v-if=
"showMenu"
class=
"menu_side"
width=
"300"
>
<StoreTree
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
<StoreTree
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
</Sider>
<div
v-if=
"!showMenu"
class=
"show_menu"
>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
</div>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:batch=
"true"
:format=
"checkData"
@
all-change=
"allchange"
@
on-selection-change=
"onSelect"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
clearable
placeholder=
"请输入资源名称/资源编码/编码"
v-model
.
trim=
"easySearch.keys.value"
v-width=
"260"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
<FormItem>
<a
href=
"#"
@
click=
"lendingRecord"
class=
"ml20"
>
借出记录
</a>
</FormItem>
</Form>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
入库
</Button>
<!--
<Button
type=
"primary"
@
click=
"returnModel=true"
>
归还
</Button>
-->
<Badge
:count=
"this.$store.state.count"
overflow-count=
"99"
style=
"margin-right:5px;"
>
<Button
icon=
"md-cart"
@
click=
"showCart"
>
借出车
</Button>
</Badge>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"addCart"
>
加入借出车
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
:fullscreen=
"fscreeen"
>
<component
:is=
"detail"
:eid=
"curId"
:rootName=
"rootName"
:storeTitle=
"storeTitle"
:materialType=
"materialType"
:storeId=
"storeId"
:mcode=
"mCode"
:cartList=
"this.$u.clone(this.$store.state.cart)"
@
on-close=
"cancel"
@
on-ok=
"ok"
@
substr=
"substr"
/>
</Modal>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:batch=
"true"
:format=
"checkData"
@
all-change=
"allchange"
@
on-selection-change=
"onSelect"
exportTitle=
"制造资源"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
clearable
placeholder=
"请输入资源名称/资源编码/编码"
v-model
.
trim=
"easySearch.keys.value"
v-width=
"260"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
<FormItem>
<a
href=
"#"
@
click=
"lendingRecord"
class=
"ml20"
>
借出记录
</a>
</FormItem>
</Form>
</
template
>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
入库
</Button>
<!--
<Button
type=
"primary"
@
click=
"returnModel=true"
>
归还
</Button>
-->
<Badge
:count=
"this.$store.state.count"
overflow-count=
"99"
style=
"margin-right:5px;"
>
<Button
icon=
"md-cart"
@
click=
"showCart"
>
借出车
</Button>
</Badge>
<Button
@
click=
"openModalIm"
>
导入
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"addCart"
>
加入借出车
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
footer-hide
:fullscreen=
"fscreeen"
>
<component
:is=
"detail"
:eid=
"curId"
:rootName=
"rootName"
:storeTitle=
"storeTitle"
:materialType=
"materialType"
:storeId=
"storeId"
:mcode=
"mCode"
:cartList=
"this.$u.clone(this.$store.state.cart)"
@
on-close=
"cancel"
@
on-ok=
"ok"
@
substr=
"substr"
/>
</Modal>
<ImportExcel
ref=
"importExcel"
@
on-get-data=
"getData"
:columns=
"columns"
:open=
"ModalIm"
@
on-cancel=
"ModalImCancel"
@
on-ok=
"ok"
/>
</Content>
</Layout>
</Layout>
</template>
<
script
>
import
Api
from
"./api"
;
import
Search
from
"./search"
;
export
default
{
name
:
"list"
,
components
:
{
Search
,
},
// head: {
// title: "库存表",
// author: "henq",
// description: "stock 7/13/2020 11:48:09 AM",
// },
data
()
{
return
{
action
:
Api
.
index
,
showMenu
:
true
,
easySearch
:
{
keys
:
{
op
:
"nameOfResource,code,resourceCode"
,
value
:
null
},
},
fscreeen
:
false
,
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
storeId
:
null
,
rootName
:
""
,
storeTitle
:
""
,
materialType
:
""
,
mCode
:
""
,
columns
:
[
{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
,
},
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
,
sortable
:
true
,
},
name
:
"list"
,
components
:
{
Search
,
},
// head: {
// title: "库存表",
// author: "henq",
// description: "stock 7/13/2020 11:48:09 AM",
// },
data
()
{
return
{
action
:
Api
.
index
,
showMenu
:
true
,
easySearch
:
{
keys
:
{
op
:
"nameOfResource,code,resourceCode"
,
value
:
null
},
},
fscreeen
:
false
,
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
0
,
storeId
:
null
,
rootName
:
""
,
storeTitle
:
""
,
materialType
:
""
,
mCode
:
""
,
columns
:
[{
key
:
"selection"
,
type
:
"selection"
,
width
:
50
,
align
:
"center"
,
},
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
,
sortable
:
true
,
},
{
key
:
"ico"
,
title
:
" "
,
align
:
"center"
,
easy
:
true
,
high
:
true
,
width
:
60
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
params
.
row
.
numberAvailable
>
0
?
"op"
:
""
,
{
attrs
:
{
icon
:
"ios-cart-outline"
,
type
:
"icon"
,
},
on
:
{
click
:
()
=>
this
.
addCart
(
params
.
row
)
},
}),
]);
},
},
{
key
:
"resourceCode"
,
title
:
this
.
l
(
"resourceId"
),
align
:
"left"
,
easy
:
true
,
},
{
key
:
"nameOfResource"
,
title
:
this
.
l
(
"nameOfResource"
),
align
:
"left"
,
easy
:
true
,
tooltip
:
true
,
},
{
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
,
},
// {
// key: "creationTime",
// title: this.l("creationTime"),
// sortable: true,
// hide: true,
// align: "left",
// },
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
hide
:
false
,
type
:
"user"
,
align
:
"left"
,
},
{
key
:
"lastModificationTime"
,
title
:
this
.
l
(
"lastModificationTime"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"lastModifierUserId"
,
title
:
this
.
l
(
"lastModifierUserId"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"isDeleted"
,
title
:
this
.
l
(
"isDeleted"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"deletionTime"
,
title
:
this
.
l
(
"deletionTime"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"deleterUserId"
,
title
:
this
.
l
(
"deleterUserId"
),
hide
:
true
,
align
:
"left"
,
},
{
key
:
"ico"
,
title
:
" "
,
align
:
"center"
,
easy
:
true
,
high
:
true
,
width
:
60
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
params
.
row
.
numberAvailable
>
0
?
"op"
:
""
,
{
attrs
:
{
icon
:
"ios-cart-outline"
,
type
:
"icon"
,
// {
// key: "specifications",
// title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
{
key
:
"totalNum"
,
title
:
this
.
l
(
"totalNum"
),
align
:
"right"
,
easy
:
true
,
},
{
key
:
"numberAvailable"
,
title
:
this
.
l
(
"numberAvailable"
),
align
:
"right"
,
easy
:
true
,
},
{
key
:
"measuringUnit"
,
title
:
this
.
l
(
"measuringUnit"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"qualityCharacteristics"
,
title
:
this
.
l
(
"qualityCharacteristics"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
on
:
{
click
:
()
=>
this
.
addCart
(
params
.
row
)
},
}),
]);
},
{
key
:
"batchNo"
,
title
:
this
.
l
(
"batchNo"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"storeId"
,
title
:
this
.
l
(
"storeId"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
{
key
:
"storeTitle"
,
title
:
this
.
l
(
"storeTitle"
),
align
:
"left"
,
},
{
key
:
"state"
,
title
:
this
.
l
(
"state"
),
align
:
"center"
,
code
:
"mes_xingchi_resource.resource.state"
,
},
// {
// key: "resourceType",
// title: this.l("resourceType"),
// align: "left",
// high: true,
// code: "mes_xingchi_resource.resource.resource_type",
// },
{
title
:
"操作"
,
width
:
190
,
align
:
"center"
,
key
:
"action"
,
hide
:
false
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
,
title
:
"删除"
,
},
class
:
params
.
row
.
totalNum
===
params
.
row
.
numberAvailable
?
"remove"
:
"disable"
,
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
)
},
},
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
"查看日志"
,
},
on
:
{
click
:
()
=>
this
.
logDetail
(
params
.
row
.
id
)
},
},
"查看日志"
),
]);
},
},
],
treeData
:
[],
ocolumn
:
[],
treeHeight
:
""
,
ids
:
[],
list
:
[],
cartList
:
[],
cartListCount
:
0
,
selectRows
:
[],
//导入
ModalIm
:
false
,
};
},
created
()
{
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
treeHeight
=
window
.
screenHeight
-
150
;
})();
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
computed
:
{},
methods
:
{
checkData
(
items
)
{
// console.warn("items", items);
return
items
.
map
((
u
)
=>
{
u
.
_disabled
=
u
.
numberAvailable
<=
0
;
u
.
_checked
=
false
;
return
u
;
});
},
{
key
:
"resourceCode"
,
title
:
this
.
l
(
"resourceId"
),
align
:
"left"
,
easy
:
true
,
allchange
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
{
key
:
"nameOfResource"
,
title
:
this
.
l
(
"nameOfResource"
),
align
:
"left"
,
easy
:
true
,
tooltip
:
true
,
onSelect
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
//加入借出车
addCart
(
arr
)
{
this
.
cartListCount
=
this
.
$store
.
state
.
count
;
this
.
cartList
=
this
.
$store
.
state
.
cart
;
// console.log(this.cartListCount);
// console.log(this.cartList);
// console.log(this.selectRows);
if
(
arr
.
id
)
{
let
id
=
arr
.
id
;
if
(
arr
.
numberAvailable
>
0
)
{
const
index
=
this
.
$store
.
state
.
cart
.
findIndex
(
function
(
item
)
{
return
item
.
id
===
id
;
});
// console.log(index);
if
(
index
==
-
1
)
{
arr
.
numberAvailable1
=
arr
.
numberAvailable
;
//用于最大借出数量
this
.
cartList
.
push
(
arr
);
this
.
cartListCount
+=
1
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$Message
.
success
(
"加入借出车成功"
);
}
else
{
this
.
$Message
.
error
(
"已加入借出车"
);
}
}
else
{
this
.
$Message
.
error
(
"资源无库存"
);
}
}
else
{
// this.$Message.success("已加入借出车,请在借出车查看");
let
arr
=
this
.
selectRows
.
concat
(
this
.
cartList
);
//两个数组对象合并
let
newArr
=
[];
//盛放去重后数据的新数组
arr
.
forEach
(
function
(
item
)
{
let
hasPush
=
false
;
newArr
.
forEach
((
item2
,
index
,
thisArr
)
=>
{
if
(
item
.
id
==
item2
.
id
)
{
hasPush
=
true
;
thisArr
[
index
]
=
{
...
item
,
...
item2
};
return
;
}
});
!
hasPush
&&
newArr
.
push
(
item
);
});
this
.
cartList
=
newArr
;
this
.
cartListCount
=
newArr
.
length
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$refs
.
grid
.
load
();
this
.
$refs
.
grid
.
footerToolbar
=
false
;
}
},
{
key
:
"code"
,
title
:
"编码"
,
align
:
"left"
,
//移除借出车
substr
(
value
,
index
)
{
// console.log(value);
// console.log(index);
if
(
index
>
-
1
)
{
this
.
cartListCount
-=
value
;
this
.
cartList
.
splice
(
index
,
1
);
if
(
value
==
0
||
this
.
cartList
.
length
==
0
)
{
this
.
cartListCount
=
0
;
}
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
else
{
this
.
cartListCount
=
0
;
this
.
cartList
=
[];
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
// console.log(this.$store.state.count);
// console.log(this.$store.state.cart);
},
// {
// key: "creationTime",
// title: this.l("creationTime"),
// sortable: true,
// hide: true,
// align: "left",
// },
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
hide
:
false
,
type
:
"user"
,
align
:
"left"
,
showCart
()
{
if
(
this
.
$store
.
state
.
count
>
0
)
{
this
.
title
=
"借出车"
;
this
.
detail
=
()
=>
import
(
"./cart"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请将资源加入借出车"
);
}
},
{
key
:
"lastModificationTime"
,
title
:
this
.
l
(
"lastModificationTime"
),
hide
:
true
,
align
:
"left"
,
lendingRecord
()
{
// window.open("/resource/resource/record", "_blank");
this
.
$router
.
push
(
"/resource/resource/record"
);
},
{
key
:
"lastModifierUserId"
,
title
:
this
.
l
(
"lastModifierUserId"
),
hide
:
true
,
align
:
"left"
,
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
fscreeen
=
false
;
this
.
cartList
=
[];
// this.curId = 0;
},
{
key
:
"isDeleted"
,
title
:
this
.
l
(
"isDeleted"
),
hide
:
true
,
align
:
"left"
,
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
{
key
:
"deletionTime"
,
title
:
this
.
l
(
"deletionTime"
),
hide
:
true
,
align
:
"left"
,
add
()
{
if
(
this
.
curId
)
{
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请先选择库房库位"
);
}
},
{
key
:
"deleterUserId"
,
title
:
this
.
l
(
"deleterUserId"
),
hide
:
true
,
align
:
"left"
,
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
// {
// key: "specifications",
// title: this.l("specifications"),
// align: "left",
// easy: true,
// high: true,
// },
{
key
:
"totalNum"
,
title
:
this
.
l
(
"totalNum"
),
align
:
"left"
,
easy
:
true
,
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
{
key
:
"numberAvailable"
,
title
:
this
.
l
(
"numberAvailable"
),
align
:
"left"
,
easy
:
true
,
logDetail
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看日志"
;
this
.
detail
=
()
=>
import
(
"./log"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
{
key
:
"measuringUnit"
,
title
:
this
.
l
(
"measuringUnit"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
{
key
:
"qualityCharacteristics"
,
title
:
this
.
l
(
"qualityCharacteristics"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
},
{
key
:
"batchNo"
,
title
:
this
.
l
(
"batchNo"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
},
{
key
:
"storeId"
,
title
:
this
.
l
(
"storeId"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
productSearch
(
item
,
ids
,
rootName
)
{
// console.log(item);
this
.
curId
=
item
.
id
;
this
.
storeTitle
=
item
.
title
;
this
.
rootName
=
rootName
.
join
(
" / "
);
this
.
materialType
=
item
.
materialType
;
let
where
=
{
storeId
:
{
op
:
"In"
,
value
:
ids
}
};
this
.
$refs
.
grid
.
reload
(
where
);
},
{
key
:
"storeTitle"
,
title
:
this
.
l
(
"storeTitle"
),
align
:
"left"
,
setNum
(
row
)
{
this
.
curId
=
row
.
id
;
this
.
title
=
"预警"
;
// this.detail = () => import("./setNum");
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
{
key
:
"state"
,
title
:
this
.
l
(
"state"
),
align
:
"left"
,
code
:
"mes_xingchi_resource.resource.state"
,
//批量导入start
//导入功能
openModalIm
()
{
this
.
ModalIm
=
true
},
// {
// key: "resourceType",
// title: this.l("resourceType"),
// align: "left",
// high: true,
// code: "mes_xingchi_resource.resource.resource_type",
// },
{
title
:
"操作"
,
width
:
190
,
align
:
"center"
,
hide
:
false
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"delete"
,
title
:
"删除"
,
},
class
:
params
.
row
.
totalNum
===
params
.
row
.
numberAvailable
?
"remove"
:
"disable"
,
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
)
},
},
"删除"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"detail"
,
title
:
"查看日志"
,
},
on
:
{
click
:
()
=>
this
.
logDetail
(
params
.
row
.
id
)
},
},
"查看日志"
),
]);
},
ModalImCancel
()
{
this
.
ModalIm
=
false
},
],
treeData
:
[],
ocolumn
:
[],
treeHeight
:
""
,
ids
:
[],
list
:
[],
cartList
:
[],
cartListCount
:
0
,
selectRows
:
[],
};
},
created
()
{
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
treeHeight
=
window
.
screenHeight
-
150
;
})();
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
computed
:
{},
methods
:
{
checkData
(
items
)
{
// console.warn("items", items);
return
items
.
map
((
u
)
=>
{
u
.
_disabled
=
u
.
numberAvailable
<=
0
;
u
.
_checked
=
false
;
return
u
;
});
},
allchange
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
onSelect
(
item
)
{
this
.
selectRows
=
[];
this
.
selectRows
=
item
;
},
getData
(
val
)
{
let
url
=
`
${
resourceUrl
}
/resourceimportservice/import`
;
this
.
$refs
.
importExcel
.
deelData
(
url
,
this
.
columns
,
this
.
formatMethod
(
val
))
},
//根据页面二次处理数据
formatMethod
(
val
)
{
let
tempData
=
this
.
$u
.
clone
(
val
);
let
tempList
=
[];
tempData
.
forEach
((
ele
)
=>
{
let
obj
=
{
nameOfResource
:
ele
.
nameOfResource
?
ele
.
nameOfResource
:
''
,
resourceCode
:
ele
.
resourceCode
?
ele
.
resourceCode
:
''
,
code
:
ele
.
code
?
ele
.
code
:
''
,
totalNum
:
ele
.
totalNum
?
ele
.
nameOfResource
:
0
,
storeTitle
:
ele
.
storeTitle
?
ele
.
storeTitle
:
''
,
storeId
:
ele
.
storeId
?
ele
.
nameOfResource
:
null
,
state
:
1
,
numberAvailable
:
ele
.
numberAvailable
?
ele
.
nameOfResource
:
0
,
json
:
{}
};
if
(
ele
.
nameOfResource
&&
ele
.
nameOfResource
!=
''
&&
ele
.
code
&&
ele
.
code
!=
''
&&
ele
.
resourceCode
&&
ele
.
resourceCode
!=
''
)
{
obj
.
ico
=
false
}
else
{
obj
.
ico
=
true
}
tempList
.
push
(
obj
);
//加入借出车
addCart
(
arr
)
{
this
.
cartListCount
=
this
.
$store
.
state
.
count
;
this
.
cartList
=
this
.
$store
.
state
.
cart
;
// console.log(this.cartListCount);
// console.log(this.cartList);
// console.log(this.selectRows);
if
(
arr
.
id
)
{
let
id
=
arr
.
id
;
if
(
arr
.
numberAvailable
>
0
)
{
const
index
=
this
.
$store
.
state
.
cart
.
findIndex
(
function
(
item
)
{
return
item
.
id
===
id
;
});
// console.log(index);
if
(
index
==
-
1
)
{
arr
.
numberAvailable1
=
arr
.
numberAvailable
;
//用于最大借出数量
this
.
cartList
.
push
(
arr
);
this
.
cartListCount
+=
1
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$Message
.
success
(
"加入借出车成功"
);
}
else
{
this
.
$Message
.
error
(
"已加入借出车"
);
}
}
else
{
this
.
$Message
.
error
(
"资源无库存"
);
}
}
else
{
// this.$Message.success("已加入借出车,请在借出车查看");
let
arr
=
this
.
selectRows
.
concat
(
this
.
cartList
);
//两个数组对象合并
let
newArr
=
[];
//盛放去重后数据的新数组
arr
.
forEach
(
function
(
item
)
{
let
hasPush
=
false
;
newArr
.
forEach
((
item2
,
index
,
thisArr
)
=>
{
if
(
item
.
id
==
item2
.
id
)
{
hasPush
=
true
;
thisArr
[
index
]
=
{
...
item
,
...
item2
};
return
;
}
});
!
hasPush
&&
newArr
.
push
(
item
);
});
this
.
cartList
=
newArr
;
this
.
cartListCount
=
newArr
.
length
;
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
this
.
$refs
.
grid
.
load
();
this
.
$refs
.
grid
.
footerToolbar
=
false
;
}
},
//移除借出车
substr
(
value
,
index
)
{
// console.log(value);
// console.log(index);
if
(
index
>
-
1
)
{
this
.
cartListCount
-=
value
;
this
.
cartList
.
splice
(
index
,
1
);
if
(
value
==
0
||
this
.
cartList
.
length
==
0
)
{
this
.
cartListCount
=
0
;
}
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
else
{
this
.
cartListCount
=
0
;
this
.
cartList
=
[];
this
.
$store
.
commit
(
"setCart"
,
this
.
cartList
);
this
.
$store
.
commit
(
"setCartCount"
,
this
.
cartListCount
);
}
// console.log(this.$store.state.count);
// console.log(this.$store.state.cart);
},
showCart
()
{
if
(
this
.
$store
.
state
.
count
>
0
)
{
this
.
title
=
"借出车"
;
this
.
detail
=
()
=>
import
(
"./cart"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请将资源加入借出车"
);
}
},
lendingRecord
()
{
// window.open("/resource/resource/record", "_blank");
this
.
$router
.
push
(
"/resource/resource/record"
);
},
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
fscreeen
=
false
;
this
.
cartList
=
[];
// this.curId = 0;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
add
()
{
if
(
this
.
curId
)
{
this
.
title
=
"新增"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
}
else
{
this
.
$Message
.
error
(
"请先选择库房库位"
);
}
},
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
});
return
tempList
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
logDetail
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看日志"
;
this
.
detail
=
()
=>
import
(
"./log"
);
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
},
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
},
productSearch
(
item
,
ids
,
rootName
)
{
// console.log(item);
this
.
curId
=
item
.
id
;
this
.
storeTitle
=
item
.
title
;
this
.
rootName
=
rootName
.
join
(
" / "
);
this
.
materialType
=
item
.
materialType
;
let
where
=
{
storeId
:
{
op
:
"In"
,
value
:
ids
}
};
this
.
$refs
.
grid
.
reload
(
where
);
},
setNum
(
row
)
{
this
.
curId
=
row
.
id
;
this
.
title
=
"预警"
;
// this.detail = () => import("./setNum");
this
.
fscreeen
=
false
;
this
.
modal
=
true
;
},
l
(
key
)
{
let
vkey
=
"resource"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
//批量导入end
l
(
key
)
{
let
vkey
=
"resource"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
},
};
</
script
>
<
style
lang=
"less"
>
.full {
margin-top: 0;
.content {
margin-top: 10px;
padding-top: 10px;
.ivu-icon-ios-add:before {
content: "\f341";
}
.ivu-icon-ios-remove:before {
content: "\f33d";
margin-top: 0;
.content {
margin-top: 10px;
padding-top: 10px;
.ivu-icon-ios-add:before {
content: "\f341";
}
.ivu-icon-ios-remove:before {
content: "\f33d";
}
}
}
}
</
style
>
\ No newline at end of file
</
style
>
plugins/iview.js
View file @
66fdd543
...
...
@@ -61,6 +61,7 @@ import DTSearch from '@/components/page/dtSearch.vue'
import
InputTime
from
'@/components/page/inputTime.vue'
import
OutputTime
from
'@/components/page/outputTime.vue'
import
ViewerImg
from
'@/components/page/viewer.vue'
import
ImportExcel
from
'@/components/page/import/process.vue'
// import FormMaking from 'form-making'
// import 'form-making/dist/FormMaking.css'
...
...
@@ -127,6 +128,7 @@ Vue.component("OutputTime", OutputTime)
Vue
.
component
(
"ViewerImg"
,
ViewerImg
)
Vue
.
component
(
"StoreTree"
,
StoreTree
)
Vue
.
component
(
"StoreSelect"
,
StoreSelect
)
Vue
.
component
(
"ImportExcel"
,
ImportExcel
)
...
...
plugins/route.js
View file @
66fdd543
...
...
@@ -27,7 +27,7 @@ export default ({
next
({
name
:
'login'
,
query
:
{
redirect
:
to
.
fullPath
redirect
:
"/account/login?tenant="
+
util
.
cookies
.
get
(
'tenantCode'
)
}
});
}
...
...
static/config.js
View file @
66fdd543
...
...
@@ -27,7 +27,7 @@ window.apsUrl = `http://${systemApi.aps}:10111/api/services/app`;//aps排产(61)
window
.
technologyUrl
=
`http://
${
address
}
:10000/technology/`
;
//新工艺规程接口
window
.
iconImg
=
`/imgicon/`
;
window
.
mncImg
=
`/images/mnc/`
;
//mnc图片
window
.
material
=
`http://
${
address
}
:10000/material`
;
//物料管理
window
.
material
=
`http://
${
address
}
:10000/material`
;
//物料管理
10032
window
.
Platform
=
`http://
${
address
}
:10000/platform`
;
//计划管理10131
/* window.systemUrl = `http://${address}:10020/api/services/app`; //System-api 系统管理(基础数据)
...
...
store/admin/account.js
View file @
66fdd543
...
...
@@ -40,7 +40,7 @@ export const actions = {
if
(
res
.
result
)
{
util
.
cookies
.
set
(
'uuid'
,
res
.
result
.
userId
);
util
.
cookies
.
set
(
'tenantCode'
,
res
.
result
.
tenantCode
);
util
.
cookies
.
set
(
'tenantCode'
,
res
.
result
.
tenantCode
||
res
.
result
.
tanantCode
);
util
.
cookies
.
set
(
'token'
,
res
.
result
.
accessToken
);
sessionStorage
.
setItem
(
'token'
,
res
.
result
.
accessToken
)
...
...
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