|
|
@@ -31,7 +31,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
|
|
|
{checkbox: true},
|
|
|
// {field: 'id', title: __('Id')},
|
|
|
{field: 'material', title: __('Material'), operate: 'LIKE'},
|
|
|
- {field: 'height', title: __('Height'),operate: 'LIKE'},
|
|
|
+ {field: 'weight', title: __('Weight'),operate: 'LIKE'},
|
|
|
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.normal},
|
|
|
{field: 'time', title: __('Time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
|
|
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
|
|
@@ -56,6 +56,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
|
|
|
bach:$("#c-batch").val()
|
|
|
},
|
|
|
success(res){
|
|
|
+ $("#c-batch").val($("#c-batch").val()+';');
|
|
|
$("#c-time").val(res.create);
|
|
|
$("#c-audit").val(res.examine_name);
|
|
|
$("#c-pname").val(res.name);
|
|
|
@@ -75,17 +76,23 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
|
|
|
formula: $("#wuliao").val(),
|
|
|
},
|
|
|
success(res) {
|
|
|
- str += "<tr><td><input class='form-control' type='text' name='row[material][]' readonly value='"+res.material+"'></td>";
|
|
|
- str += "<td><input class='form-control' type='number' name='row[height][]' data-rule='required' value=''></td>";
|
|
|
+ str += "<tr><td><input class='form-control' type='text' name='row[batch][]' readonly value='"+res.bach+"'></td>";
|
|
|
+ str += "<td><input class='form-control' type='text' name='row[pname][]' readonly value='"+res.pname+"'></td>";
|
|
|
+ str += "<td><input class='form-control' type='text' name='row[material][]' readonly value='"+res.material+"'></td>";
|
|
|
+ str += "<td><input class='form-control' type='text' name='row[specifications][]' value='"+ (res.specifications?res.specifications:'')+"'></td>";
|
|
|
+ str += "<td><input class='form-control' type='number' name='row[weight][]' data-rule='required' value=''></td>";
|
|
|
+ str += "<td><input class='form-control' type='text' name='row[unit][]' value=''></td>";
|
|
|
str += "<td><input class='form-control' type='text' name='row[time][]' readonly value='"+res.time+"'></td>";
|
|
|
str += '<td><button type="button" class="btn btn-danger del">删除</button></td></tr>';
|
|
|
$("#table").append(str);
|
|
|
$("#wuliao").val('');
|
|
|
- if(res.error === 1){
|
|
|
- Layer.confirm("此物料不在配方中,请确认!");
|
|
|
- //语音播报
|
|
|
- var msg = new SpeechSynthesisUtterance("此物料不在配方中,请确认!");
|
|
|
- window.speechSynthesis.speak(msg);
|
|
|
+ if($("#status").val()==1){
|
|
|
+ if(res.error === 1){
|
|
|
+ Layer.confirm("此物料不在配方中,请确认!");
|
|
|
+ //语音播报
|
|
|
+ var msg = new SpeechSynthesisUtterance("此物料不在配方中,请确认!");
|
|
|
+ window.speechSynthesis.speak(msg);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -101,36 +108,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','editable'], function
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
- /**
|
|
|
- * 播报
|
|
|
- * @param {Object} text 播放内容
|
|
|
- */
|
|
|
- startSpeech = (text)=>{
|
|
|
- const speech = new SpeechSynthesisUtterance()
|
|
|
- // 设置播放内容
|
|
|
- speech.text = text
|
|
|
- // 设置话语的音调(0-2 默认1,值越大越尖锐,越低越低沉)
|
|
|
- speech.pitch = 0.8
|
|
|
- // 设置说话的速度(0.1-10 默认1,值越大语速越快,越小语速越慢)
|
|
|
- speech.rate = 1
|
|
|
- // 设置说话的音量
|
|
|
- speech.volume = 10
|
|
|
- // 设置播放语言
|
|
|
- speech.lang = 'zh-CN'
|
|
|
-
|
|
|
- // 播放结束后调用
|
|
|
- speech.onend = (event)=>{
|
|
|
-
|
|
|
- }
|
|
|
- // 加入播放队列
|
|
|
- window.speechSynthesis.speak(speech);
|
|
|
- };
|
|
|
- /**
|
|
|
- * 停止播报,停止所有播报队列里面的语音
|
|
|
- */
|
|
|
- stopSpeech = () => {
|
|
|
- window.speechSynthesis.cancel();
|
|
|
- };
|
|
|
Controller.api.bindevent();
|
|
|
},
|
|
|
edit: function () {
|