218cd9cac2fed98124c65fd7e4e7e4fc.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:82:"D:\phpstudy_pro\WWW\minongyun\public/../application/admin\view\formula\status.html";i:1709714141;s:72:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\layout\default.html";i:1709714141;s:69:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\meta.html";i:1709714141;s:71:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\script.html";i:1711415624;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  8. <meta name="renderer" content="webkit">
  9. <meta name="referrer" content="never">
  10. <meta name="robots" content="noindex, nofollow">
  11. <link rel="shortcut icon" href="/assets/img/favicon.ico" />
  12. <!-- Loading Bootstrap -->
  13. <link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  14. <?php if(\think\Config::get('fastadmin.adminskin')): ?>
  15. <link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
  16. <?php endif; ?>
  17. <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
  18. <!--[if lt IE 9]>
  19. <script src="/assets/js/html5shiv.js"></script>
  20. <script src="/assets/js/respond.min.js"></script>
  21. <![endif]-->
  22. <script type="text/javascript">
  23. var require = {
  24. config: <?php echo json_encode($config); ?>
  25. };
  26. </script>
  27. </head>
  28. <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
  29. <div id="main" role="main">
  30. <div class="tab-content tab-addtabs">
  31. <div id="content">
  32. <div class="row">
  33. <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
  34. <section class="content-header hide">
  35. <h1>
  36. <?php echo __('Dashboard'); ?>
  37. <small><?php echo __('Control panel'); ?></small>
  38. </h1>
  39. </section>
  40. <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
  41. <!-- RIBBON -->
  42. <div id="ribbon">
  43. <ol class="breadcrumb pull-left">
  44. <?php if($auth->check('dashboard')): ?>
  45. <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
  46. <?php endif; ?>
  47. </ol>
  48. <ol class="breadcrumb pull-right">
  49. <?php foreach($breadcrumb as $vo): ?>
  50. <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
  51. <?php endforeach; ?>
  52. </ol>
  53. </div>
  54. <!-- END RIBBON -->
  55. <?php endif; ?>
  56. <div class="content">
  57. <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="" >
  58. <div class="form-group">
  59. <span id="ids" data-value="<?php echo $ids; ?>"></span>
  60. <label class="control-label col-xs-12 col-sm-1"><?php echo __('Name'); ?>:</label>
  61. <div class="col-xs-12 col-sm-3">
  62. <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="<?php echo $row['name']; ?>">
  63. </div>
  64. <label class="control-label col-xs-12 col-sm-1">编号:</label>
  65. <div class="col-xs-12 col-sm-3">
  66. <input id="c-formula_no" class="form-control" name="row[formula_no]" type="text" value="<?php echo $row['no']; ?>">
  67. </div>
  68. </div>
  69. <div class="form-group">
  70. <label class="control-label col-xs-12 col-sm-1"><?php echo __('Charge_name'); ?>:</label>
  71. <div class="col-xs-12 col-sm-3">
  72. <input id="c-charge_name" data-rule="required" class="form-control" name="row[charge_name]" type="text" value="<?php echo $row['charge_name']; ?>">
  73. </div>
  74. <label class="control-label col-xs-12 col-sm-1"><?php echo __('Examine_name'); ?>:</label>
  75. <div class="col-xs-12 col-sm-3">
  76. <input id="c-examine_name" data-rule="required" class="form-control" name="row[examine_name]" type="text" value="<?php echo $row['examine_name']; ?>">
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="control-label col-xs-12 col-sm-1"><?php echo __('Remark'); ?>:</label>
  81. <div class="col-xs-12 col-sm-7">
  82. <input id="c-remark" class="form-control" name="row[remark]" type="text" value="<?php echo $row['remark']; ?>">
  83. </div>
  84. </div>
  85. <div class="form-group">
  86. <label class="control-label col-xs-12 col-sm-1"><?php echo __('Version'); ?>:</label>
  87. <div class="col-xs-12 col-sm-3">
  88. <input id="c-version" data-rule="required" class="form-control" name="row[version]" type="text" value="<?php echo $row['version']; ?>" readonly>
  89. </div>
  90. <label class="control-label col-xs-12 col-sm-1"><?php echo __('Date'); ?>:</label>
  91. <div class="col-xs-12 col-sm-3">
  92. <input id="c-date" class="form-control datetimepicker" name="row[date]" type="text" data-date-format="YYYY-MM-DD" data-use-current="true" value="<?php echo $row['date']; ?>">
  93. </div>
  94. </div>
  95. <div class="form-group">
  96. <label class="control-label col-xs-12 col-sm-1">可用性:</label>
  97. <div class="col-xs-12 col-sm-7">
  98. <input id="c-usability" data-source="formula/getCustomer"
  99. data-params='{"custom[type]":"bm","isTree":1}' data-multiple="true" data-field="customer_name" class="form-control selectpage" name="usability"
  100. type="text" value="<?php echo htmlentities($row['usability']); ?>" placeholder="配方对应客户,不选默认全部客户可用">
  101. </div>
  102. </div>
  103. <div class="form-group">
  104. <table class="table table-striped table-bordered table-hover table-nowrap" id="gy" >
  105. <tr>
  106. <th class="col-sm-2">原材料</th>
  107. <th class="col-sm-1">百分比(%)</th>
  108. <th class="col-sm-4">操作工艺说明</th>
  109. <!--<th class="col-sm-1">工序号(必填)</th>-->
  110. </tr>
  111. <?php if(is_array($row["gyinfo"]) || $row["gyinfo"] instanceof \think\Collection || $row["gyinfo"] instanceof \think\Paginator): if( count($row["gyinfo"])==0 ) : echo "" ;else: foreach($row["gyinfo"] as $key=>$vo): ?>
  112. <tr>
  113. <td><textarea name="material" style="resize:none;" disabled class="form-control material" cols="15" rows="4"><?php echo $vo['material']; ?></textarea></td>
  114. <td><textarea name="percentage" style="resize:none;" disabled class="form-control percentage" cols="10" rows="4"><?php echo $vo['percentage']; ?></textarea></td>
  115. <td><textarea name="gy_name" style="resize:none;" disabled class="form-control gy_name" cols="50" rows="4"><?php echo $vo['gy_name']; ?></textarea></td>
  116. <!--<td><textarea name="gy_num" style="resize:none;" disabled class="form-control gy_num" cols="6" rows="4"><?php echo $vo['gy_num']; ?></textarea></td>-->
  117. </tr>
  118. <?php endforeach; endif; else: echo "" ;endif; ?>
  119. </table>
  120. </div>
  121. <!--<div class="form-group">-->
  122. <!--<table class="table table-striped table-bordered table-hover table-nowrap" id="gy">-->
  123. <!--<tr>-->
  124. <!--<th class="col-sm-2">原材料</th>-->
  125. <!--<th class="col-sm-1">百分比(%)</th>-->
  126. <!--<th class="col-sm-8">操作工艺说明</th>-->
  127. <!--<th class="col-sm-1">工序号(必填)</th>-->
  128. <!--</tr>-->
  129. <!--<?php if(is_array($row["gyinfo"]) || $row["gyinfo"] instanceof \think\Collection || $row["gyinfo"] instanceof \think\Paginator): if( count($row["gyinfo"])==0 ) : echo "" ;else: foreach($row["gyinfo"] as $key=>$vo): ?>-->
  130. <!--<tr>-->
  131. <!--<td><input class="form-control material" type="text" value="<?php echo $vo['material']; ?>" ></td>-->
  132. <!--<td><input class="form-control percentage" type="text" value="<?php echo $vo['percentage']; ?>"></td>-->
  133. <!--<td><input class="form-control gy_name" type="text" value="<?php echo $vo['gy_name']; ?>"></td>-->
  134. <!--<td><input class="form-control gy_num" type="text" value="<?php echo $vo['gy_num']; ?>"></td>-->
  135. <!--</tr>-->
  136. <!--<?php endforeach; endif; else: echo "" ;endif; ?>-->
  137. <!--</table>-->
  138. <!--</div>-->
  139. <div class="form-group layer-footer">
  140. <label class="control-label col-xs-12 col-sm-2"></label>
  141. <div class="col-xs-12 col-sm-8">
  142. <button type="button" class="btn btn-success btn-embossed examine" data-value="2">审核通过</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  143. <button type="button" class="btn btn-danger btn-embossed examine" data-value="3">审核不通过</button>
  144. </div>
  145. </div>
  146. </form>
  147. </div>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
  154. <input type="hidden" value="<?php echo \think\Session::get('admin.username'); ?>" name="" id="username">
  155. <input type="hidden" value="<?php echo \think\Session::get('admin.company'); ?>" name="" id="company">
  156. <script>
  157. function watermark(element, config) {
  158. // 获取元素的坐标
  159. function getOffset(el) {
  160. if (el.offsetParent) {
  161. return {
  162. x: el.offsetLeft + getOffset(el.offsetParent).x,
  163. y: el.offsetTop + getOffset(el.offsetParent).y,
  164. };
  165. }
  166. return {
  167. x: el.offsetLeft,
  168. y: el.offsetTop,
  169. };
  170. }
  171. if (!element) return;
  172. // 默认配置
  173. const _config = {
  174. text1: '张三', //文本1
  175. text2: '13868686868', // 文本2
  176. start_x: 0, // x轴起始位置
  177. start_y: 0, // y轴起始位置
  178. space_x: 100, // x轴间距
  179. space_y: 50, // y轴间距
  180. width: 210, // 宽度
  181. height: 80, // 长度
  182. fontSize: 14, // 字体
  183. color: '#aaa', // 字色
  184. alpha: 0.4, // 透明度
  185. rotate: 15, // 倾斜度
  186. };
  187. // 替换默认配置
  188. if (arguments.length === 2 && typeof arguments[1] === "object") {
  189. const src = arguments[1] || {};
  190. for (let key in src) {
  191. if (src[key] && _config[key] && src[key] === _config[key]) {
  192. continue;
  193. } else if (src[key]) {
  194. _config[key] = src[key];
  195. }
  196. }
  197. }
  198. // 节点的总宽度
  199. const total_width = element.scrollWidth;
  200. // 节点的总高度
  201. const total_height = element.scrollHeight;
  202. // 创建文本碎片,用于包含所有的插入节点
  203. const mark = document.createDocumentFragment();
  204. // 水印节点的起始坐标
  205. const position = getOffset(element);
  206. let x = position.x + _config.start_x, y = position.y + _config.start_y;
  207. // 先循环y轴插入水印
  208. do {
  209. // 再循环x轴插入水印
  210. do {
  211. // 创建单个水印节点
  212. const item = document.createElement('div');
  213. item.className = 'watermark-item';
  214. // 设置节点的样式
  215. item.style.position = "absolute";
  216. item.style.zIndex = 99999;
  217. item.style.left = `${x}px`;
  218. item.style.top = `${y}px`;
  219. item.style.width = `${_config.width}px`;
  220. item.style.height = `${_config.height}px`;
  221. item.style.fontSize = `${_config.fontSize}px`;
  222. item.style.color = _config.color;
  223. item.style.textAlign = 'center';
  224. item.style.opacity = _config.alpha;
  225. item.style.filter = `alpha(opacity=${_config.alpha * 100})`;
  226. // item.style.filter = `opacity(${_config.alpha * 100}%)`;
  227. item.style.webkitTransform = `rotate(-${_config.rotate}deg)`;
  228. item.style.MozTransform = `rotate(-${_config.rotate}deg)`;
  229. item.style.msTransform = `rotate(-${_config.rotate}deg)`;
  230. item.style.OTransform = `rotate(-${_config.rotate}deg)`;
  231. item.style.transform = `rotate(-${_config.rotate}deg)`;
  232. item.style.pointerEvents = 'none'; //让水印不遮挡页面的点击事件
  233. // 创建text1水印节点
  234. const text1 = document.createElement('div');
  235. text1.appendChild(document.createTextNode(_config.text1));
  236. item.append(text1);
  237. // 创建text2水印节点
  238. const text2 = document.createElement('div');
  239. text2.appendChild(document.createTextNode(_config.text2));
  240. item.append(text2);
  241. // 添加水印节点到文本碎片
  242. mark.append(item);
  243. // x坐标递增
  244. x = x + _config.width + _config.space_x;
  245. // 超出文本右侧坐标停止插入
  246. } while (total_width + position.x > x + _config.width);
  247. // 重置x初始坐标
  248. x = position.x + _config.start_x;
  249. // y坐标递增
  250. y = y + _config.height + _config.space_y;
  251. // 超出文本底部坐标停止插入
  252. } while (total_height + position.y > y + _config.height);
  253. // 插入文档碎片
  254. element.append(mark);
  255. }
  256. var username = document.getElementById('username');
  257. var company = document.getElementById('company');
  258. //找到存放水印的盒子
  259. const element = document.getElementsByTagName('body')[0];
  260. watermark(element,{text1:username.value,text2:company.value});
  261. </script>
  262. </body>
  263. </html>