87,987
社区成员
发帖
与我相关
我的任务
分享想实现一个功能,如:共有三个生产线,可以调节生产线的每日生产量,用于计划生产。请问怎么实现这个功能,怎么开发个小程序或者应用软件,并能前端展示,还能手工调节每日生产量?但是每日生产量有最大限额,调节一个生产线,必须相应减少或增加其他生产线产量。
<div style="border: 2px;height: 340px;width: 242px;border-style: dashed;border-radius: 10px;
position: relative;top: 18px;left: 12px;
">
<br>
<strong>生产线一<span style="float: right;"><strong>总计产量:
</strong><span
id="tatil1"
style="border: 1px;width:42px;height: 24px;
border-style: double;float: right;
">100</span>
</span></strong><br>
<div style="border: 2px;height: 56px;width: 226px;border-style:dotted;
position: relative;top: 20px;left: 5px;"
>
<span>
当前产量:30
剩余未分配:10
<br> <strong>生产线二</strong><br>
<div
style="border: 2px;height: 56px;width: 226px;border-style:dotted;
position: relative;top: 20px;left: 5px;">
当前产量:30
</strong><strong style="float: right;">剩余未分配:
<strong class="qia">10</strong>
</strong></div>
<br> <strong>生产线三</strong><br>
<div style="border: 2px;height: 56px;width: 226px;border-style:dotted;
position: relative;top: 20px;left: 5px;">
当前产量:30剩余未分配:
10
<script>window.onload;
function func1(){
var txt=document.getElementById("txt1");
var c=document.getElementById("count1");
var d=document.getElementsByClassName("qia")
var d1=d[0];
var d2=d[1];
var d3=d[2];
if((txt.value<(d1.firstChild.nodeValue+1))&(txt.value>0)){
c.firstChild.nodeValue=(parseInt(txt.value)+parseInt(c.firstChild.nodeValue))
;var ni1=(parseInt(d1.firstChild.nodeValue)-parseInt(txt.value))
d1.firstChild.nodeValue=ni1;
d2.firstChild.nodeValue=ni1;
d3.firstChild.nodeValue=ni1;
}else{alert("请输入正确范围的数")}
txt.value="";}
function func2(){
var txt=document.getElementById("txt2");
var c=document.getElementById("count2");
var d=document.getElementsByClassName("qia")
var d1=d[0];
var d2=d[1];
var d3=d[2];
if((txt.value<(d2.firstChild.nodeValue+1))&(txt.value>0))
{c.firstChild.nodeValue=(parseInt(txt.value)+parseInt(c.firstChild.nodeValue))
;var ni1=(parseInt(d1.firstChild.nodeValue)-parseInt(txt.value))
d1.firstChild.nodeValue=ni1;
d2.firstChild.nodeValue=ni1;
d3.firstChild.nodeValue=ni1;}else{alert("请输入正确范围的数")}
txt.value="";}
function func3(){var txt=document.getElementById("txt3");
var c=document.getElementById("count3");
var d=document.getElementsByClassName("qia")
var d1=d[0];
var d2=d[1];
var d3=d[2];
if((txt.value<(d3.firstChild.nodeValue+1))&(txt.value>0))
{c.firstChild.nodeValue=(parseInt(txt.value)+parseInt(c.firstChild.nodeValue))
;var ni1=(parseInt(d3.firstChild.nodeValue)-parseInt(txt.value))
d1.firstChild.nodeValue=ni1;
d2.firstChild.nodeValue=ni1;
d3.firstChild.nodeValue=ni1;}else{alert("请输入正确范围的数")}
txt.value="";}
function func4(){var txt=document.getElementById("txt1");
var c=document.getElementById("count1")
var d=document.getElementsByClassName("qia")
var d1=d[0];
var d2=d[1];
var d3=d[2];
if((txt.value<(c.firstChild.nodeValue+1))&(txt.value>0))
{c.firstChild.nodeValue=(parseInt(c.firstChild.nodeValue)-parseInt(txt.value))
;var bn1=(parseInt(txt.value)+parseInt(d2.firstChild.nodeValue))
d1.firstChild.nodeValue=bn1;
d2.firstChild.nodeValue=bn1;
d3.firstChild.nodeValue=bn1;}else{alert("请输入正确范围的数")}
txt.value="";}
function func5(){var txt=document.getElementById("txt2");
var c=document.getElementById("count2")
var d=document.getElementsByClassName("qia")
var d1=d[0];
var d2=d[1];
var d3=d[2];
if((txt.value<(c.firstChild.nodeValue+1))&(txt.value>0))
{c.firstChild.nodeValue=(parseInt(c.firstChild.nodeValue)-parseInt(txt.value))
;var bn1=(parseInt(txt.value)+parseInt(d2.firstChild.nodeValue))
d1.firstChild.nodeValue=bn1;
d2.firstChild.nodeValue=bn1;
d3.firstChild.nodeValue=bn1;}else{alert("请输入正确范围的数")}
txt.value="";}
function func7(){var txt=document.getElementById("txt3");
var c=document.getElementById("count3")
var d=document.getElementsByClassName("qia")
var d1=d[0];
var d2=d[1];
var d3=d[2];
if((txt.value<(c.firstChild.nodeValue+1))&(txt.value>0))
{c.firstChild.nodeValue=(parseInt(c.firstChild.nodeValue)-parseInt(txt.value))
;var bn1=(parseInt(txt.value)+parseInt(d2.firstChild.nodeValue))
d1.firstChild.nodeValue=bn1;
d2.firstChild.nodeValue=bn1;
d3.firstChild.nodeValue=bn1;}else{alert("请输入正确范围的数")}
txt.value="";}