6 Star 7 Fork 2

haok2 / DevicesMS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
sbdak.py 3.22 KB
一键复制 编辑 原始数据 按行查看 历史
haok2 提交于 2014-01-07 09:05 . first commit
#coding:utf8
import cherrypy
import datetime
from ConnectMSSQL import ms
from head import print_head
from end import print_end
from utf8code import *
_top = """
<form>
<div id="div_operate">
<table width="auto">
<tr>
<td class="class_td">设备编号:</td>
<td><font>%s</font></td>
<td class="class_td">固定资产编号:</td>
<td><font>%s</font></td>
<td class="class_td">购买日期:</td>
<td>%s</td>
</tr>
<tr>
<td class="class_td">设备类型:</td>
<td>%s</td>
<td class="class_td">品牌及型号:</td>
<td>%s</td>
<td class="class_td">设备名称:</td>
<td>%s</td>
</tr>
<tr>
<td class="class_td">基本配置:</td>
<td colspan="5">%s</td>
</tr>
<tr>
<td class="class_td">网络配置:</td>
<td colspan="5">%s</td>
</tr>
<tr>
<td class="class_td">随机附件:</td>
<td colspan="5">%s</td>
</tr>
<tr>
<td class="class_td" colspan="6">设备备注:</td>
</tr>
<tr>
<td height="120" colspan="6">%s</td>
</tr>
</table>
</div>
<div>
<table width="auto">
<tr>
<th class="class_th" scope="col">#</th>
<th class="class_th" scope="col">部门</th>
<th class="class_th" scope="col">使用人</th>
<th class="class_th" scope="col">变更日期</th>
<th class="class_th" scope="col">经手人</th>
<th class="class_th" scope="col">备注</th>
</tr>
"""
_end = """
</table>
</div>
</form>
"""
class SBDAK:
@cherrypy.expose
def index(self,sbbh):
sql_sbxx = """
SELECT SBBH
,GDZCBH
,GMRQ
,SBLX
,PPXH
,SBMC
,JBPZ
,WLPZ
,SJFJ
,BZ
FROM T_SB
WHERE SBBH = '%s'
"""
dataList_1 = ms.ExecQuery(sql_sbxx % sbbh)
_mid_1 = ''
for sbxx in dataList_1:
_mid_1 = _top % (sbxx[0],sbxx[1],datetime.datetime.strftime(sbxx[2],'%Y-%m-%d'),sbxx[3],sbxx[4],sbxx[5],sbxx[6],sbxx[7],sbxx[8],sbxx[9])
_mid_tmp = """
<tr>
<td width="5%%">%s</td>
<td width="15%%"></td>
<td width="15%%"></td>
<td width="15%%"></td>
<td width="15%%"></td>
<td width="35%%"></td>
</tr>
"""
_mid_2 = ''
for i in range(23)[1:]:
_mid_2 += _mid_tmp % i
return utf8code(print_head % ('设备管理卡打印','计算机设备档案卡') + _mid_1 + _mid_2 + _end + print_end)
Python
1
https://gitee.com/bobo2cj/DevicesMS.git
git@gitee.com:bobo2cj/DevicesMS.git
bobo2cj
DevicesMS
DevicesMS
master

搜索帮助