Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
f104a484
Commit
f104a484
authored
May 11, 2021
by
李超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
type:update
scope: self body: 完工项 工艺、材料功能
parent
9d53f76b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
381 additions
and
225 deletions
+381
-225
order.js
src/common/api/order.js
+8
-2
XhServiceMore.vue
src/components/createCom/XhServiceMore.vue
+81
-0
complete.vue
src/pages/order/complete.vue
+16
-2
material.vue
src/pages/order/material.vue
+276
-221
No files found.
src/common/api/order.js
View file @
f104a484
...
@@ -115,6 +115,11 @@ let orderApiFun = function(vm){
...
@@ -115,6 +115,11 @@ let orderApiFun = function(vm){
*/
*/
let
getMeasure
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'wxh-worker-rest/rest/service/'
+
vm
.
vuex_token
+
'/measure/queryMeasureItems'
,
params
);
let
getMeasure
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'wxh-worker-rest/rest/service/'
+
vm
.
vuex_token
+
'/measure/queryMeasureItems'
,
params
);
/**
* 查询工单材信息
*/
let
getOrderMaterial
=
async
(
orderId
)
=>
await
vm
.
$u
.
get
(
'/wxh-cloud-rest/rest/thirdparty/shzhida/material/'
+
orderId
);
/**
/**
* 保存售后记录
* 保存售后记录
*/
*/
...
@@ -161,6 +166,7 @@ let orderApiFun = function(vm){
...
@@ -161,6 +166,7 @@ let orderApiFun = function(vm){
getSignDistance
,
getSignDistance
,
getCompleteConfigAndData
,
getCompleteConfigAndData
,
getMeasure
,
getMeasure
,
getOrderMaterial
,
saveCompleteData
,
saveCompleteData
,
inOrderFinish
,
inOrderFinish
,
outOrderFinish
,
outOrderFinish
,
...
...
src/components/createCom/XhServiceMore.vue
0 → 100644
View file @
f104a484
<!-- ******************* 输入框 ******************* -->
<
template
>
<view>
<view
class=
"list u-flex u-row-between"
>
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
<view
class=
"u-m-r-20"
>
{{
item
.
fieldsTitle
}}
</view>
<view
class=
"u-flex-1 location-name"
@
click=
"toMaterialPage"
>
<u-icon
name=
"map"
color=
"#2979ff"
size=
"30"
></u-icon>
请选择
</view>
</view>
<!--
<view
class=
"u-flex-1 location"
>
{{
valueTxt
||
'正在获取中...'
}}
</view>
-->
</view>
</
template
>
<
script
>
import
arrMixin
from
'./arrMixin'
export
default
{
name
:
'XhInput'
,
// 新建 input
components
:
{},
mixins
:
[
arrMixin
],
props
:
{
placeholder
:
{
type
:
String
,
default
:
'请输入'
},
orderId
:
{
type
:
String
,
default
:
'请输入'
},
},
data
()
{
return
{
maxlength
:
140
,
}
},
computed
:
{
mixingImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'mixing.png'
}
},
watch
:
{},
mounted
()
{},
methods
:
{
toMaterialPage
(){
let
self
=
this
uni
.
navigateTo
({
url
:
'pages/order/material?orderId='
+
this
.
orderId
+
'&fieldName='
+
this
.
item
.
fieldsName
,
// 接口调用成功的回调函数,即跳转到B页面 test.vue 后的回调函数
success
:
function
(
res
)
{
// 通过eventChannel向被打开页面传送数据
res
.
eventChannel
.
emit
(
'showMaterialData'
,
self
.
dataValue
);
}
})
},
}
}
</
script
>
<
style
scoped
>
.required
{
padding-right
:
10
rpx
;
font-size
:
28
rpx
;
line-height
:
40
rpx
;
color
:
#fa3534
;
}
.item-image
{
width
:
24
rpx
;
height
:
24
rpx
;
margin-right
:
10
rpx
;
}
.location-name
{
color
:
#2272FF
;
text-align
:
right
;
}
.location
{
background
:
#F4F5F7
;
padding
:
10
rpx
20
rpx
;
border-radius
:
12
rpx
;
}
</
style
>
src/pages/order/complete.vue
View file @
f104a484
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<view
class=
"class-bd"
>
<view
class=
"class-bd"
>
<u-form-item
v-for=
"(item,itemIndex) in groupItem.items"
:key=
"itemIndex"
label-position=
"top"
<u-form-item
v-for=
"(item,itemIndex) in groupItem.items"
:key=
"itemIndex"
label-position=
"top"
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"item.fieldsId != 200 || show200"
>
:prop=
"item.fieldsName"
:border-bottom=
"false"
v-show=
"item.fieldsId != 200 || show200"
>
<view
:class=
"[
{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="typeToComponentType(item.fieldsType)!=='location'">
<view
:class=
"[
{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="typeToComponentType(item.fieldsType)!=='location'
&&
typeToComponentType(item.fieldsType)!=='form'
">
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
<image
class=
"item-image"
:src=
"mixingImage"
v-if=
"item.required"
></image>
{{
item
.
fieldsTitle
}}
{{
item
.
fieldsTitle
}}
</view>
</view>
...
@@ -73,6 +73,10 @@
...
@@ -73,6 +73,10 @@
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
@
value-change=
"fieldValueChange"
>
</xh-time>
</xh-time>
<xh-service-more
v-else-if=
"typeToComponentType(item.fieldsType)==='form'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:order-id=
"orderId"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-service-more>
</
template
>
</
template
>
</u-form-item>
</u-form-item>
</view>
</view>
...
@@ -114,6 +118,7 @@
...
@@ -114,6 +118,7 @@
import
XhPicker
from
'@/components/createCom/XhPicker.vue'
import
XhPicker
from
'@/components/createCom/XhPicker.vue'
import
XhTime
from
'@/components/createCom/XhTime.vue'
import
XhTime
from
'@/components/createCom/XhTime.vue'
import
XhServiceMeasure
from
'@/components/createCom/XhServiceMeasure.vue'
import
XhServiceMeasure
from
'@/components/createCom/XhServiceMeasure.vue'
import
XhServiceMore
from
"../../components/createCom/XhServiceMore"
;
// import XhRadio from '@/components/createCom/XhRadio.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue'
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -185,7 +190,8 @@
...
@@ -185,7 +190,8 @@
XhScan
,
XhScan
,
XhPicker
,
XhPicker
,
XhTime
,
XhTime
,
XhServiceMeasure
XhServiceMeasure
,
XhServiceMore
},
},
created
()
{
created
()
{
// console.log(allComponents,'allComponents')
// console.log(allComponents,'allComponents')
...
@@ -409,6 +415,11 @@
...
@@ -409,6 +415,11 @@
this
.
getMenuItemTop
()
this
.
getMenuItemTop
()
})
})
},
},
setData
(
data
){
// 通过页面设置数据
Object
.
keys
(
data
).
forEach
(
key
=>
{
this
.
$set
(
this
.
form
,
key
,
data
[
key
])
})
},
// 字段的值更新
// 字段的值更新
fieldValueChange
(
data
)
{
fieldValueChange
(
data
)
{
const
groupItem
=
this
.
list
[
this
.
tabIndex
].
items
[
data
.
groupIndex
]
const
groupItem
=
this
.
list
[
this
.
tabIndex
].
items
[
data
.
groupIndex
]
...
@@ -496,6 +507,9 @@
...
@@ -496,6 +507,9 @@
case
'date'
:
case
'date'
:
formType
=
'time'
formType
=
'time'
break
break
case
'form'
:
formType
=
'form'
break
}
}
return
formType
return
formType
},
},
...
...
src/pages/order/material.vue
View file @
f104a484
...
@@ -31,13 +31,13 @@
...
@@ -31,13 +31,13 @@
<view
class=
"other-space"
>
<view
class=
"other-space"
>
<text
class=
"input-title"
>
说明:
</text>
<text
class=
"input-title"
>
说明:
</text>
<view
class=
"input-content"
>
<view
class=
"input-content"
>
<u-input
v-model=
"item.
title"
:clearable=
"false"
placeholder-style=
"color:#999999;font-size:26rpx"
/>
<u-input
v-model=
"item.
otherExplain"
:clearable=
"false"
placeholder-style=
"color:#999999;font-size:26rpx"
/>
</view>
</view>
</view>
</view>
<view
class=
"other-space"
>
<view
class=
"other-space"
>
<text
class=
"input-title"
>
金额:
</text>
<text
class=
"input-title"
>
金额:
</text>
<view
class=
"input-content"
>
<view
class=
"input-content"
>
<u-input
v-model=
"item.
value"
type=
"number"
:clearable=
"false"
placeholder-style=
"color:#999999;font-size:26rpx"
/>
<u-input
v-model=
"item.
extraAmt"
type=
"number"
:clearable=
"false"
placeholder-style=
"color:#999999;font-size:26rpx"
/>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -64,6 +64,8 @@
...
@@ -64,6 +64,8 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
orderId
:
''
,
fieldName
:
'materialList'
,
list
:
[],
// 材料列表
list
:
[],
// 材料列表
other
:
[],
// 其他列表
other
:
[],
// 其他列表
};
};
...
@@ -78,12 +80,22 @@
...
@@ -78,12 +80,22 @@
};
};
},
},
titles
()
{
titles
()
{
if
(
this
.
isMaterial
){
return
{
return
{
name
:
'材料名称'
,
matName
:
'材料名称'
,
unit
:
'单位'
,
matUnit
:
'单位'
,
freeAmount
:
'免费量'
,
freeLength
:
'免费量'
,
price
:
'单价/元'
,
unitAmt
:
'单价/元'
,
consumption
:
'预计用量'
useLength
:
'用量'
}
}
else
{
return
{
matName
:
'工艺名称'
,
matUnit
:
'单位'
,
freeLength
:
'免费量'
,
unitAmt
:
'单价/元'
,
useLength
:
'用量'
}
}
}
},
},
thStyle
()
{
thStyle
()
{
...
@@ -103,38 +115,76 @@
...
@@ -103,38 +115,76 @@
money
()
{
// 总额
money
()
{
// 总额
var
amount
=
0
var
amount
=
0
for
(
var
item
of
this
.
list
)
{
for
(
var
item
of
this
.
list
)
{
if
(
Number
(
item
.
consumption
)
&&
Number
(
item
.
freeAmount
)
&&
Number
(
item
.
price
))
{
if
(
Number
(
item
.
useLength
)
&&
Number
(
item
.
freeLength
)
&&
Number
(
item
.
unitAmt
))
{
amount
+=
Math
.
max
(
Number
(
item
.
consumption
)
-
Number
(
item
.
freeAmount
),
0
)
*
Number
(
item
.
price
)
amount
+=
Math
.
max
(
Number
(
item
.
useLength
)
-
Number
(
item
.
freeLength
),
0
)
*
Number
(
item
.
unitAmt
)
}
}
}
}
for
(
var
item
of
this
.
other
)
{
for
(
var
item
of
this
.
other
)
{
if
(
item
.
value
&&
Number
(
item
.
value
))
{
if
(
item
.
freeMount
&&
Number
(
item
.
freeMount
))
{
amount
+=
Number
(
item
.
value
)
amount
+=
Number
(
item
.
freeMount
)
}
}
}
}
return
amount
return
amount
},
isMaterial
(){
return
this
.
fieldName
===
'materialList'
},
isCraft
(){
return
this
.
fieldName
===
'craftList'
},
priceType
(){
return
this
.
isMaterial
?
"01"
:
"02"
},
},
onLoad
(
option
)
{
this
.
orderId
=
option
.
orderId
this
.
fieldName
=
option
.
fieldName
const
eventChannel
=
this
.
getOpenerEventChannel
();
let
self
=
this
eventChannel
.
on
(
'showMaterialData'
,
function
(
data
)
{
if
(
!
data
||
data
.
length
===
0
){
self
.
getMaterialData
()
}
else
{
self
.
formatServiceMoreList
(
data
)
}
}
});
},
},
created
()
{
created
()
{
// 测试数据
},
console
.
log
(
'0000'
)
mounted
()
{
for
(
var
i
=
0
;
i
<
20
;
i
++
)
{
},
this
.
list
.
push
({
methods
:
{
name
:
'开关发大法师放大范德萨发大水'
,
getMaterialData
(){
unit
:
'个'
,
let
self
=
this
freeAmount
:
'1'
,
self
.
$u
.
api
.
getCompleteConfigAndData
(
self
.
orderId
).
then
((
res
)
=>
{
price
:
'45.0'
,
if
(
res
.
code
!==
200
)
{
consumption
:
'4'
,
console
.
log
(
result
.
data
.
message
)
return
}
self
.
formatServiceMoreList
(
res
.
data
)
})
})
// let testData = [{"freeLength":30,"priceTypeName":"","priceType":"01","lastModifiedWhen":"2021-05-11 11:10:27","matNo":"MAT1594085500303","createdWhen":"2021-05-11 11:10:27","extraAmt":0,"matName":"φ32镀锌管","studErp":"","isDel":"N","orderNo":"D20210424296591GQF","createdByName":"李小平","matUnit":"米","useLength":0,"orderMaterialId":"32BDDH67P5BBJGBKQBVXYCoJAA","lastModifiedByName":"李小平","unitAmt":0,"otherExplain":"","matType":"01"},{"freeLength":1,"priceTypeName":"","priceType":"01","lastModifiedWhen":"2021-05-11 11:10:27","matNo":"MAT1594714122500","createdWhen":"2021-05-11 11:10:27","extraAmt":0,"matName":"无标准电表箱","studErp":"","isDel":"N","orderNo":"D20210424296591GQF","createdByName":"李小平","matUnit":"个","useLength":0,"orderMaterialId":"6GXHJEJIZ5FZ7oFESHB26EAYWY","lastModifiedByName":"李小平","unitAmt":0,"otherExplain":"","matType":"01"}]
// self.formatServiceMoreList(testData)
},
formatServiceMoreList
(
materialCraftsData
){
let
self
=
this
materialCraftsData
.
map
(
item
=>
{
if
(
item
.
priceType
===
self
.
priceType
)
{
item
.
matType
===
'04'
?
self
.
other
.
push
(
item
)
:
self
.
list
.
push
(
item
)
}
}
})
},
},
methods
:
{
/* 其他添加新的 */
/* 其他添加新的 */
handleAdd
()
{
handleAdd
()
{
this
.
other
.
push
({
this
.
other
.
push
({
title
:
''
,
//orderNo:this.formInfo.orderNo,
value
:
''
isDel
:
'N'
,
isWebAdd
:
true
,
matName
:
'其他'
,
extraAmt
:
0
,
priceType
:
this
.
priceType
,
matType
:
'04'
,
otherExplain
:
''
})
})
},
},
/* 其他删除某个 */
/* 其他删除某个 */
...
@@ -142,7 +192,12 @@
...
@@ -142,7 +192,12 @@
this
.
other
.
splice
(
index
,
1
)
this
.
other
.
splice
(
index
,
1
)
},
},
handleSure
()
{
handleSure
()
{
// 返回总额money
let
pages
=
getCurrentPages
();
let
prevPage
=
pages
[
pages
.
length
-
2
];
//上一个页面
let
data
=
{}
data
[
this
.
fieldName
]
=
this
.
list
.
concat
(
this
.
other
)
// 将list合并给上以页面
prevPage
.
$vm
.
setData
(
data
)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
uni
.
navigateBack
();
}
}
}
}
}
}
...
...
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