Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-web-back-soil
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangweidong
patzn-cloud-web-back-soil
Commits
d502a55c
Commit
d502a55c
authored
Jun 13, 2020
by
wangweidong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
74b9f725
0c028b19
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
420 additions
and
2 deletions
+420
-2
MeterOutTaskAlloca.vue
pages/meter-out/task-distribute/MeterOutTaskAlloca.vue
+410
-0
MeterOutTaskDistribute.vue
pages/meter-out/task-distribute/MeterOutTaskDistribute.vue
+10
-2
No files found.
pages/meter-out/task-distribute/MeterOutTaskAlloca.vue
0 → 100644
View file @
d502a55c
<
template
>
<div>
<Modal
v-model=
"showModal"
width=
"1200"
class=
"modal-footer-none"
>
<p
slot=
"header"
>
{{
modalTitle
}}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"formId"
:label-width=
"80"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
label=
"样品名称:"
class=
"search-item"
>
<Input
v-model=
"formObj.name"
@
on-enter=
"_formSearch"
placeholder=
"请输入样品名称"
clearable
/>
</Form-item>
<Form-item
label=
"样品编号:"
class=
"search-item"
>
<Input
v-model=
"formObj.code"
@
on-enter=
"_formSearch"
placeholder=
"请输入样品编号"
clearable
/>
</Form-item>
<Form-item
class=
"search-btn"
style=
"margin-left: -10px"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
:open=
"searchOpen"
:show-search-btn=
"true"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<Col
span=
"24"
>
<PTVXETable
ref=
"pageTable"
:table-height=
"tableHeight"
:form-id=
"formId"
:get-page=
"getPage"
:icon-msg=
"iconMsg"
@
on-result-change=
"_tableResultChange"
select-data
>
<vxe-table-column
v-for=
"item in pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:min-width=
"item.width?item.width:200"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<div
v-if=
"item.detail"
><a
@
click
.
stop=
"_detailModal(scope.row.id)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a></div>
<div
v-else-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</div>
<div
v-else-if=
"item.key==='jobOut'"
>
{{
scope
.
row
[
item
.
key
]
===
1
?
'是'
:
'否'
}}
</div>
<div
v-else-if=
"item.key==='type'"
>
<Select
v-model=
"scope.row.type"
>
<Option
v-for=
"(item,index) in options"
:key=
"item.name"
:value=
"index"
>
{{
item
.
name
}}
</Option>
</Select>
</div>
<div
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</div>
</
template
>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<
script
>
import
{
meterSample
}
from
'../../../api'
export
default
{
components
:
{
// FoodSampleGovernDetail,
// CopyModal,
// FoodSampleGovernLYEdits
},
data
()
{
return
{
currentComponent
:
''
,
// btn: [
// {type: 'success', id: '', name: '添加', componentName: 'FoodSampleGovernEdit'},
// {id: 'food-gov-sample-batch-add', name: '批量添加', componentName: 'FoodSampleGovernBatchAdd'},
// {id: '', name: '导入样品', componentName: 'FoodImportSample'},
// {id: '', name: '导入检测项目', componentName: 'RelItem'},
// {id: '', name: '导入检测项目包', componentName: 'RelItemPackage'},
// {id: '', name: '复制历史样品检测项目', componentName: 'CopyHisItem'},
// {id: '', name: '删除'},
// ],
iconMsg
:
[
{
type
:
'compose'
,
id
:
''
,
name
:
'编辑'
},
{
type
:
'ios-copy'
,
id
:
''
,
name
:
'复制'
,
componentName
:
'CopyModal'
},
{
type
:
'trash-a'
,
id
:
''
,
name
:
'删除'
}
],
btn
:
[
{
// meter-review-entrust-pass-btn
type
:
'success'
,
id
:
''
,
name
:
'分包'
},
// meter-review-entrust-back-btn
{
type
:
'success'
,
id
:
''
,
name
:
'取消分包'
}
],
searchOpen
:
false
,
options
:
[
{
name
:
'检定'
},
{
name
:
'校准'
},
{
name
:
'外观检查'
}
],
formId
:
'meterReviewSampleManageFormId'
,
showModal
:
false
,
modalTitle
:
'管理样品'
,
selectIds
:
[],
selectData
:
[],
getPage
:
{},
pageColumns
:
[
{
title
:
'样品编号'
,
key
:
'code'
,
detail
:
true
,
width
:
120
},
{
title
:
'样品名称'
,
key
:
'name'
,
width
:
140
},
{
title
:
'型号规格'
,
key
:
'spec'
,
width
:
140
},
{
title
:
'出厂编号'
,
key
:
'factoryNumber'
,
width
:
140
},
{
title
:
'是否分包'
,
key
:
'jobOut'
,
width
:
110
},
{
title
:
'检测类型'
,
key
:
'type'
,
width
:
140
},
{
title
:
'数量'
,
key
:
'quantity'
,
width
:
140
}
],
dateList
:
[],
formObj
:
{
entrustId
:
undefined
,
name
:
undefined
,
code
:
undefined
,
type
:
undefined
}
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tableModal'
)
}
},
methods
:
{
_modalResult
(
data1
,
data2
)
{
switch
(
this
.
currentComponent
)
{
case
'CopyModal'
:
if
(
data1
===
0
)
{
this
.
_copySample
(
data2
)
}
else
{
this
.
_copyAll
(
data2
)
}
break
default
:
this
.
_search
()
}
},
_dateChange
(
data
)
{
this
.
formObj
.
ctimeBegin
=
data
[
0
]
this
.
formObj
.
ctimeEnd
=
data
[
1
]
},
_btnClick
(
msg
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
msg
)
{
case
'添加'
:
this
.
_editModal
(
false
)
break
case
'导入检测项目'
:
this
.
_importItem
()
break
case
'导入检测项目包'
:
this
.
_importItemPackage
()
break
case
'复制历史样品检测项目'
:
this
.
_copyHisItem
()
break
case
'删除'
:
this
.
_deleteSelected
()
break
}
})
},
_iconClick
(
res
,
data
,
componentName
)
{
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
switch
(
res
)
{
case
'编辑'
:
localStorage
.
setItem
(
'type'
,
data
.
type
)
if
(
data
.
type
===
2
)
{
this
.
_editLY
(
data
.
id
)
// 粮油的编辑页
}
else
{
this
.
_editModal
(
true
,
data
.
id
)
}
break
case
'复制'
:
this
.
_copy
(
data
.
id
,
data
.
type
)
break
case
'删除'
:
this
.
_deleteById
(
data
.
id
)
break
case
'检测项目'
:
this
.
_itemDetail
(
data
.
id
)
break
}
})
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'selectData'
:
const
selectIds
=
[]
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
selectIds
.
push
(
data
[
i
].
id
)
}
this
.
selectIds
=
selectIds
this
.
selectData
=
data
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
,
data
.
componentName
)
break
case
'changeSize'
:
this
.
_page
()
break
}
},
_open
(
id
)
{
console
.
log
(
id
)
this
.
formObj
.
entrustId
=
id
this
.
showModal
=
true
this
.
_page
()
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_page
:
async
function
(
id
)
{
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
console
.
log
(
'this.formObj'
,
this
.
formObj
)
const
result
=
await
meterSample
.
page
(
this
.
formObj
)
if
(
result
)
{
this
.
getPage
=
result
this
.
$refs
.
pageTable
.
_hideLoading
()
}
},
_deleteByIds
(
ids
,
content
)
{
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
content
||
'确定删除该记录?'
,
onOk
:
()
=>
{
this
.
$store
.
dispatch
(
'FoodSample/deleteByIds'
,
ids
).
then
(()
=>
{
this
.
_resultChange
(
'删除成功!'
)
})
}
})
},
_deleteById
(
id
)
{
// 删除一条记录
this
.
_deleteByIds
([
id
])
},
_deleteSelected
()
{
// 批量删除
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请选择一条或多条数据!'
)
}
else
{
this
.
_deleteByIds
(
ids
,
'确定删除 '
+
ids
.
length
+
' 条记录?'
)
}
},
_detailModal
(
id
)
{
this
.
currentComponent
=
'FoodSampleGovernDetail'
this
.
$nextTick
(
function
()
{
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
id
).
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
})
},
_editModal
(
edit
,
id
)
{
this
.
currentComponent
=
'FoodSampleGovernEdit'
this
.
$nextTick
(
function
()
{
if
(
edit
)
{
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
id
).
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
,
this
.
contractId
)
})
}
else
{
this
.
$refs
.
refModal
.
_open
(
''
,
this
.
contractId
)
}
})
},
_editLY
(
id
)
{
// 粮油的编辑
this
.
currentComponent
=
'FoodSampleGovernLYEdit'
this
.
$nextTick
(
function
()
{
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
id
).
then
(()
=>
{
this
.
$refs
.
refModal
.
_open
(
this
.
$store
.
state
.
FoodSample
.
governModel
,
this
.
contractId
)
})
})
},
_search
()
{
this
.
_page
()
},
_searchParams
()
{
const
data
=
this
.
$serialize
(
'search-sample-govern'
)
return
this
.
$extend
(
data
,
this
.
pageParams
)
},
_resultChange
(
msg
)
{
if
(
this
.
$store
.
state
.
FoodSample
.
success
)
{
this
.
_page
()
this
.
$Message
.
success
(
msg
)
}
},
_copy
(
sampleId
,
type
)
{
this
.
$refs
.
refModal
.
_open
(
sampleId
,
type
)
},
// 复制样品
_copySample
(
data
)
{
if
(
data
.
type
===
2
)
{
// 粮油的编辑页
this
.
currentComponent
=
'FoodSampleGovernLYEdit'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openCopySample
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
})
}
else
{
this
.
currentComponent
=
'FoodSampleGovernEdit'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openCopySample
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
})
}
},
_copyAll
(
data
)
{
if
(
data
.
type
===
2
)
{
// 粮油的编辑页
this
.
currentComponent
=
'FoodSampleGovernLYEdit'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openCopyAll
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
})
}
else
{
this
.
currentComponent
=
'FoodSampleGovernEdit'
this
.
$store
.
dispatch
(
'FoodSample/getByGovernId'
,
data
.
sampleId
)
.
then
(()
=>
{
this
.
$nextTick
(
function
()
{
this
.
$refs
.
refModal
.
_openCopyAll
(
this
.
$store
.
state
.
FoodSample
.
governModel
)
})
})
}
},
// 导入样品
_importSample
()
{
const
data
=
{
importUrl
:
'/food/v1/sample/government/import_'
+
this
.
contractId
,
downloadUrl
:
'/food/v1/excel/template/FoodSampleGovernment'
,
title
:
'导入'
}
this
.
$refs
.
refModal
.
_open
(
data
)
},
// 导入检测项目
_importItem
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选中一条样品数据!'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
,
this
.
selectData
[
0
])
}
},
_importItemPackage
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选中一条样品数据!'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
,
'batch-rel-package-item'
)
}
},
_copyHisItem
()
{
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请至少选中一条样品数据!'
)
}
else
{
this
.
$refs
.
refModal
.
_open
(
this
.
selectIds
)
}
},
_itemDetail
(
id
)
{
this
.
$refs
.
foodItem
.
_open
(
id
)
},
_operationRecord
(
id
)
{
// 操作日志
this
.
$refs
.
recordModal
.
_open
(
id
)
}
}
}
</
script
>
pages/meter-out/task-distribute/MeterOutTaskDistribute.vue
View file @
d502a55c
...
@@ -45,15 +45,16 @@
...
@@ -45,15 +45,16 @@
</Row>
</Row>
</div>
</div>
</div>
</div>
<MeterOutTaskAlloca
ref=
"taskAllocaModal"
></MeterOutTaskAlloca>
<MeterSubcontractorEdit
ref=
"editSubcontractorModal"
@
on-result-change=
"_formSearch"
></MeterSubcontractorEdit>
<MeterSubcontractorEdit
ref=
"editSubcontractorModal"
@
on-result-change=
"_formSearch"
></MeterSubcontractorEdit>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
meterEntrust
}
from
'../../../api'
import
{
meterEntrust
}
from
'../../../api'
import
MeterSubcontractorEdit
from
'./MeterGoOutTestEdit'
import
MeterSubcontractorEdit
from
'./MeterGoOutTestEdit'
import
MeterOutTaskAlloca
from
'./MeterOutTaskAlloca'
export
default
{
export
default
{
components
:
{
MeterSubcontractorEdit
},
components
:
{
MeterSubcontractorEdit
,
MeterOutTaskAlloca
},
data
()
{
data
()
{
return
{
return
{
currentComponent
:
''
,
currentComponent
:
''
,
...
@@ -169,6 +170,9 @@ export default {
...
@@ -169,6 +170,9 @@ export default {
this
.
currentComponent
=
componentName
this
.
currentComponent
=
componentName
this
.
$nextTick
(
function
()
{
this
.
$nextTick
(
function
()
{
switch
(
res
)
{
switch
(
res
)
{
case
'任务分配'
:
this
.
_taskAllocaModal
(
data
)
break
case
'编辑'
:
case
'编辑'
:
this
.
_editModal
(
true
,
data
.
id
)
this
.
_editModal
(
true
,
data
.
id
)
break
break
...
@@ -187,6 +191,10 @@ export default {
...
@@ -187,6 +191,10 @@ export default {
}
}
})
})
},
},
_taskAllocaModal
(
data
)
{
// 管理样品
this
.
$refs
.
taskAllocaModal
.
_open
(
data
.
id
)
},
_record
(
id
)
{
_record
(
id
)
{
this
.
$refs
.
refModal
.
_open
(
id
)
this
.
$refs
.
refModal
.
_open
(
id
)
},
},
...
...
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