首先,我是javascript的新手,所以如果有更好的方法,请告诉我。
我在一个按时间顺序向设备发放资产标签的地方工作。我希望在我们的内部网页中创建一个小部件,允许用户输入该资产标签号并向他们提供一个结果,该结果给出了购买该设备时的范围(六个月范围),并为此提供结果这个设备多大了“你的设备是在2011年上半年购买的。现在已经有两年了。”
我在Excel中使用巨大的IF语句计算出公式,并且我还使用AutoIt创建了一个独立的.exe文件。但是,如何让这个脚本在网页中运行?
基本上这里是数字和日期的范围。如果有帮助,我可以包含AutoIt脚本......
<45669 - "Seven years or older"
>45670 - "First half of 2007. Purchased 7 years ago."
>43600 - "Second half of 2007. Purchased 6.5 years ago."
>47320 - "First half of 2008. Purchased 6 years ago."
>48000 - "Second half of 2008. Purchased 5.5 years ago."
>48440 - "First half of 2009. Purchased 5 years ago."
>48970 - "Second half of 2009. Purchased 4.5 years ago."
>49800 - "First half of 2010. Purchased 4 years ago."
>50250 - "Second half of 2010. Purchased 3.5 years ago."
>52100 - "First half of 2011. Purchased 3 years ago."
>52950 - "Second half of 2011. Purchased 2.5 years ago."
>53625 - "First half of 2012. Purchased 2 years ago."
>53900 - "Second half of 2012. Purchased 1.5 years ago."
>54220 - "First half of 2013. Purchased 1 year ago."
>54770 - "Second half of 2013. Purchased 6 months ago."
>55680 - "First half of 2014. Purchased less than 6 months ago."