Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
20d90f45
authored
Nov 30, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
审单添加合同备注
parent
c6dd57e3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
132 additions
and
0 deletions
public/js/change_order.js
public/js/details.js
public/js/goods.js
resources/views/changeOrder/content.blade.php
public/js/change_order.js
View file @
20d90f45
...
...
@@ -364,6 +364,67 @@
}
})
// 合同备注
$
(
document
).
delegate
(
'.change_contract_remark'
,
'keyup'
,
function
(){
var
val
=
$
(
this
).
val
();
if
(
!
val
)
return
false
;
var
len
=
getByteLen
(
val
);
if
(
len
>
8
)
{
layer
.
tips
(
'限制8个字符'
,
$
(
this
));
$
(
this
).
val
(
getSubStr
(
val
,
0
,
8
));
return
false
;
}
})
// 获取字符长度
function
getByteLen
(
val
)
{
var
len
=
0
;
for
(
var
i
=
0
;
i
<
val
.
length
;
i
++
)
{
var
a
=
val
.
charAt
(
i
);
if
(
a
.
match
(
/
[^\x
00-
\x
ff
]
/ig
)
!=
null
)
{
// 中文长度为两字节,这里只作为一个字节处理
len
+=
1
;
}
else
{
len
+=
1
;
}
}
return
len
;
}
/**
* 截取字符
* @param {[type]} str [字符串]
* @param {[type]} start [起始位置]
* @param {[type]} n [截取长度]
* @return {[type]} [description]
*/
function
getSubStr
(
str
,
start
,
n
)
{
// eslint-disable-line
if
(
str
.
replace
(
/
[\u
4e00-
\u
9fa5
]
/g
,
'*'
).
length
<=
n
)
{
// 中文长度为两字节,这里只作为一个字节处理
return
str
;
}
let
len
=
0
;
let
tmpStr
=
''
;
for
(
let
i
=
start
;
i
<
str
.
length
;
i
++
)
{
// 遍历字符串
if
(
/
[\u
4e00-
\u
9fa5
]
/
.
test
(
str
[
i
]))
{
// 中文长度为两字节,这里只作为一个字节处理
len
+=
1
;
}
else
{
len
+=
1
;
}
if
(
len
>
n
)
{
break
;
}
else
{
tmpStr
+=
str
[
i
];
}
}
return
tmpStr
;
}
// 提交表单
$
(
'.checkOrder'
).
click
(
function
(){
var
is_newClient
=
$
(
'input[name=is_newClient]:checked'
).
val
();
...
...
public/js/details.js
View file @
20d90f45
...
...
@@ -412,6 +412,67 @@
form
.
find
(
'input[type="file"]'
).
trigger
(
'click'
);
})
// 合同备注
$
(
'.edit_contract_remark'
).
keyup
(
function
(){
var
val
=
$
(
this
).
val
();
if
(
!
val
)
return
false
;
var
len
=
getByteLen
(
val
);
if
(
len
>
8
)
{
layer
.
tips
(
'限制8个字符'
,
$
(
this
));
$
(
this
).
val
(
getSubStr
(
val
,
0
,
8
));
return
false
;
}
})
// 获取字符长度
function
getByteLen
(
val
)
{
var
len
=
0
;
for
(
var
i
=
0
;
i
<
val
.
length
;
i
++
)
{
var
a
=
val
.
charAt
(
i
);
if
(
a
.
match
(
/
[^\x
00-
\x
ff
]
/ig
)
!=
null
)
{
// 中文长度为两字节,这里只作为一个字节处理
len
+=
1
;
}
else
{
len
+=
1
;
}
}
return
len
;
}
/**
* 截取字符
* @param {[type]} str [字符串]
* @param {[type]} start [起始位置]
* @param {[type]} n [截取长度]
* @return {[type]} [description]
*/
function
getSubStr
(
str
,
start
,
n
)
{
// eslint-disable-line
if
(
str
.
replace
(
/
[\u
4e00-
\u
9fa5
]
/g
,
'*'
).
length
<=
n
)
{
// 中文长度为两字节,这里只作为一个字节处理
return
str
;
}
let
len
=
0
;
let
tmpStr
=
''
;
for
(
let
i
=
start
;
i
<
str
.
length
;
i
++
)
{
// 遍历字符串
if
(
/
[\u
4e00-
\u
9fa5
]
/
.
test
(
str
[
i
]))
{
// 中文长度为两字节,这里只作为一个字节处理
len
+=
1
;
}
else
{
len
+=
1
;
}
if
(
len
>
n
)
{
break
;
}
else
{
tmpStr
+=
str
[
i
];
}
}
return
tmpStr
;
}
// 编辑商品明细
$
(
'.edit-item'
).
click
(
function
()
{
layer
.
open
({
...
...
public/js/goods.js
View file @
20d90f45
...
...
@@ -162,6 +162,9 @@
<input type="text" class="form-control change_batch" name="change_info['
+
curr_no
+
'][batch]" value="">\
</td>\
<td>\
<input type="text" class="form-control change_contract_remark" name="change_info['
+
curr_no
+
'][contract_remark]" value="" placeholder="限制8个字符">\
</td>\
<td>\
<input class="change_status" type="hidden" name="change_info['
+
curr_no
+
'][status]" value="1">\
<span class="change_status_val">正常<i style="color:green;">(新增)</i></span>\
</td>\
...
...
@@ -365,6 +368,9 @@
<input type="text" class="form-control change_batch" name="change_info['
+
curr_no
+
'][batch]" value="'
+
add_batch
+
'">\
</td>\
<td>\
<input type="text" class="form-control change_contract_remark" name="change_info['
+
curr_no
+
'][contract_remark]" value="" placeholder="限制8个字符">\
</td>\
<td>\
<input class="change_status" type="hidden" name="change_info['
+
curr_no
+
'][status]" value="1">\
<span class="change_status_val">正常<i style="color:green;">(新增)</i></span>\
</td>\
...
...
resources/views/changeOrder/content.blade.php
View file @
20d90f45
...
...
@@ -165,6 +165,7 @@
<th
width=
"5%"
>
批次
</th>
@endif
<th
width=
"3%"
>
合同备注
</th>
<th
width=
"3%"
>
状态
</th>
<th
width=
"3%"
>
操作
</th>
</thead>
...
...
@@ -245,6 +246,9 @@
@endif
<td>
<input
type=
"text"
class=
"form-control change_contract_remark"
name=
"change_info[{{ $v['rec_id'] }}][contract_remark]"
value=
"{{ $v['contract_remark'] }}"
placeholder=
"限制8个字符"
>
</td>
<td>
<input
class=
"change_status"
type=
"hidden"
name=
"change_info[{{$v['rec_id']}}][status]"
value=
"{{$v['status']}}"
>
<span
class=
"change_status_val"
>
<?=
$v
[
'status'
]
==
1
?
'正常'
:
'<i class="error">已取消</i>'
?>
</span>
</td>
...
...
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