P41.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta name="renderer" content="webkit">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  7. <meta http-equiv="pragma" content="no-cache">
  8. <meta http-equiv="Cache" content="no-cache">
  9. <meta http-equiv="cache-control" content="no-cache, must-revalidate">
  10. <meta http-equiv="expires" content="0">
  11. <meta name="viewport"
  12. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  13. <title>备件列表</title>
  14. <link rel="stylesheet" href="../css/index.css">
  15. <link rel="stylesheet" href="../css/style.css">
  16. <link rel="stylesheet" href="../css/iconfont.css">
  17. <link rel="stylesheet" href="../css/tablema.css">
  18. <script src="../js/vue.min.js"></script>
  19. <script src="../js/index.js"></script>
  20. <script src="../js/jquery.min.js"></script>
  21. <script src="../js/echarts.min.js"></script>
  22. <script type="text/javascript">
  23. document.write('<script src="../assets/init.js?id=' + (new Date().getTime()) +
  24. '" type="text/javascript" charset="utf-8"><\/script>');
  25. document.write('<script src="../assets/ajax.js?id=' + (new Date().getTime()) +
  26. '" type="text/javascript" charset="utf-8"><\/script>');
  27. </script>
  28. <script>
  29. checkLogin();
  30. </script>
  31. <style type="text/css">
  32. .spaclForm .el-form-item__label {
  33. color: #fff;
  34. }
  35. .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
  36. color: #409EFF;
  37. background-color: transparent;
  38. }
  39. .el-input-number__decrease, .el-input-number__increase{
  40. height: 34px;
  41. top: 2px;
  42. }
  43. .el-drawer__body .el-table tr,.el-drawer__body .el-table td,.el-drawer__body .el-table {
  44. color: #606266;
  45. background-color: #fff !important;
  46. }
  47. </style>
  48. </head>
  49. <body>
  50. <div id="app" v-cloak class="padding-lr-xs padding-tb-sm">
  51. <el-row :gutter="10">
  52. <el-col :span="12" :xs="24">
  53. <el-form :model="queryParams" class="spaclForm" ref="queryRef" :inline="true" label-width="90px">
  54. <el-form-item label="备件名称:" prop="sparePartName" class="cerName">
  55. <el-input v-model="queryParams.sparePartName" placeholder="请输入备件名称" clearable
  56. @keyup.enter="handleQuery" />
  57. </el-form-item>
  58. <el-form-item>
  59. <el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">搜索
  60. </el-button>
  61. <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
  62. </el-form-item>
  63. </el-form>
  64. </el-col>
  65. <el-col :span="12" :xs="24" class="text-right">
  66. <el-button type="success" size="small" plain icon="el-icon-plus" @click="handleAdd">新增</el-button>
  67. <!-- <el-button type="warning" size="small" plain icon="el-icon-download">导出</el-button> -->
  68. <el-badge :value="storageOutTotal" :hidden="storageOutTotal == 0" class="margin-right">
  69. <el-button type="warning" size="small" plain icon="el-icon-document-remove" @click="handleStorageOrder(20)">出库列表</el-button>
  70. </el-badge>
  71. <el-badge :value="storageInTotal" :hidden="storageInTotal == 0">
  72. <el-button type="warning" size="small" plain icon="el-icon-document-add" @click="handleStorageOrder(10)">入库列表</el-button>
  73. </el-badge>
  74. </el-col>
  75. </el-row>
  76. <el-table :data="storageList" :header-cell-style="{ color: 'var(--white)',background: '#082041' }">
  77. <el-table-column type="expand" width="30">
  78. <template slot-scope="scope">
  79. <div class="padding text-white">
  80. <el-descriptions :column="3">
  81. <el-descriptions-item label="编号" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  82. {{ scope.row.sparePartNumber }}
  83. </el-descriptions-item>
  84. <el-descriptions-item label="备件名称" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  85. {{scope.row.sparePartName}}
  86. </el-descriptions-item>
  87. <el-descriptions-item label="备件规格" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  88. {{ scope.row.sparePartSpecifications }}
  89. </el-descriptions-item>
  90. <el-descriptions-item label="图片" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  91. <el-image
  92. style="width: 50px; height: 50px"
  93. :preview-src-list="scope.row.filePath | getImgList"
  94. :src="imgUrl + scope.row.filePath" >
  95. </el-image>
  96. </el-descriptions-item>
  97. <el-descriptions-item label="备件品牌" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  98. {{ scope.row.sparePartBrand }}
  99. </el-descriptions-item>
  100. <el-descriptions-item label="存放位置" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  101. {{ scope.row.sparePartStorageLocation }}
  102. </el-descriptions-item>
  103. <el-descriptions-item label="备件类型" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  104. <my-texttag :options="stockTypeList" column="value" label="label"
  105. :value="scope.row.sparePartStockType" text></my-texttag>
  106. </el-descriptions-item>
  107. <el-descriptions-item label="备件单价" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  108. {{ scope.row.sparePartUnitPrice }}
  109. </el-descriptions-item>
  110. <el-descriptions-item label="库存总量" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  111. {{ scope.row.sparePartQuantity }}
  112. </el-descriptions-item>
  113. <el-descriptions-item label="单位" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  114. {{ scope.row.sparePartUnit }}
  115. </el-descriptions-item>
  116. <el-descriptions-item label="备注" :label-style="{color:'#fff'}" :content-style="{color:'#ddd'}">
  117. {{ scope.row.remark }}
  118. </el-descriptions-item>
  119. </el-descriptions>
  120. </div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  124. <el-table-column label="编号" align="center" prop="sparePartNumber" show-overflow-tooltip></el-table-column>
  125. <el-table-column label="图片" align="center" prop="filePath">
  126. <template slot-scope="scope">
  127. <el-image
  128. style="width: 50px; height: 50px"
  129. :preview-src-list="scope.row.filePath | getImgList"
  130. :src="imgUrl+scope.row.filePath" >
  131. </el-image>
  132. </template>
  133. </el-table-column>
  134. <el-table-column label="备件名称" align="center" prop="sparePartName"></el-table-column>
  135. <el-table-column label="备件规格" align="center" prop="sparePartSpecifications"></el-table-column>
  136. <el-table-column label="备件单价" align="center" prop="sparePartUnitPrice"></el-table-column>
  137. <el-table-column label="库存总量" align="center" prop="sparePartQuantity"></el-table-column>
  138. <el-table-column label="操作" align="center" width="200">
  139. <template slot-scope="scope">
  140. <el-button link type="text" class="text-green padding-xs" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
  141. <el-button link type="text" class="text-red padding-xs" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
  142. <el-button link type="text" class="text-orange padding-xs"
  143. icon="el-icon-document-remove" @click="handleStorageOut(scope.row)">出库</el-button>
  144. <el-button link type="text" class="text-orange padding-xs"
  145. icon="el-icon-document-add" @click="handleStorageIn(scope.row)">入库</el-button>
  146. </template>
  147. </el-table-column>
  148. </el-table>
  149. <div class="margin-tb-sm" v-if="storageList.length">
  150. <el-pagination @current-change="handleCurrentChange" :current-page="queryParams.pageNum" background
  151. :page-size="10" layout="total, prev, pager, next, jumper" :total="allTotal">
  152. </el-pagination>
  153. </div>
  154. <!-- 添加或修改证书对话框 -->
  155. <el-dialog :title="title" :visible.sync="drawerDolag" width="1000px" append-to-body>
  156. <el-form ref="storageRef" class="spaclForm" :model="storageForm" :rules="rules" label-width="120px">
  157. <div class="grid col-2">
  158. <el-form-item label="备件编号:" prop="sparePartNumber">
  159. <el-input v-model="storageForm.sparePartNumber" placeholder="请输入备件编号" />
  160. </el-form-item>
  161. <el-form-item label="备件名称:" prop="sparePartName">
  162. <el-input v-model="storageForm.sparePartName" placeholder="请输入备件名称" />
  163. </el-form-item>
  164. <el-form-item label="备件规格:" prop="sparePartSpecifications">
  165. <el-input v-model="storageForm.sparePartSpecifications" placeholder="请输入备件规格" />
  166. </el-form-item>
  167. <el-form-item label="备件品牌:" prop="sparePartBrand">
  168. <el-input v-model="storageForm.sparePartBrand" placeholder="请输入备件品牌" />
  169. </el-form-item>
  170. <el-form-item label="备件单价:" prop="sparePartUnitPrice">
  171. <el-input-number v-model="storageForm.sparePartUnitPrice"
  172. :precision="0" :min="0" :step="1" placeholder="请输入备件单价" />
  173. </el-form-item>
  174. <el-form-item label="库存总量:" prop="sparePartQuantity">
  175. <el-input-number v-model="storageForm.sparePartQuantity" :disabled="storageForm.sparePartId != null"
  176. :precision="0" :min="0" :step="1" placeholder="请输入库存总量" />
  177. </el-form-item>
  178. <el-form-item label="备件类型:" prop="sparePartStockType">
  179. <el-select v-model="storageForm.sparePartStockType" placeholder="请选择备件类型" style="width:100%;display:block">
  180. <el-option v-for="dict in stockTypeList" :key="dict.value" :label="dict.label"
  181. :value="dict.value"></el-option>
  182. </el-select>
  183. </el-form-item>
  184. <el-form-item label="单位:" prop="sparePartUnit">
  185. <el-input v-model="storageForm.sparePartUnit" placeholder="请输入单位" />
  186. </el-form-item>
  187. <el-form-item label="存放位置:" prop="sparePartStorageLocation">
  188. <el-input v-model="storageForm.sparePartStorageLocation" type="textarea" :rows="1" placeholder="请输入存放位置" />
  189. </el-form-item>
  190. <el-form-item label="备注:" prop="remark">
  191. <el-input v-model="storageForm.remark" type="textarea" :rows="1" placeholder="请输入备注" />
  192. </el-form-item>
  193. </div>
  194. <el-form-item label="备件样板:">
  195. <el-upload
  196. :headers="upHeaders"
  197. class="avatar-uploader"
  198. :action="imgUrl+'/common/upload'"
  199. :show-file-list="false"
  200. limit="1"
  201. :on-success="handleAvatarSuccess"
  202. :before-upload="beforeAvatarUpload">
  203. <img v-if="storageForm.filePath" style="width: 200px;" :src="imgUrl + storageForm.filePath" class="avatar">
  204. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  205. </el-upload>
  206. </el-form-item>
  207. <el-form-item>
  208. <el-button size="small" type="primary" @click="handleSubmitForm">确 定</el-button>
  209. <el-button size="small" @click="drawerDolag=false">取 消</el-button>
  210. </el-form-item>
  211. </el-form>
  212. </el-dialog>
  213. <el-drawer
  214. :title="sparePartAccessType == 10?'入库清单':'出库清单'"
  215. size="80vw"
  216. :visible.sync="drawerOutIn"
  217. direction="rtl">
  218. <el-form ref="submitRef" :model="submitForm" :rules="rules" label-width="120px" class="grid col-2">
  219. <el-form-item label="备注:" prop="sparePartAccessExplain" style="color: 'red'">
  220. <el-input v-model="submitForm.sparePartAccessExplain" type="textarea" :rows="1" placeholder="请输入备注" />
  221. </el-form-item>
  222. <el-form-item class="text-right">
  223. <div v-if="sparePartAccessType == 10">
  224. <el-button size="small" v-if="storageInTotal > 0" @click="clrearQuantityIn(true)">清空</el-button>
  225. <el-button size="small" :disabled="storageInTotal == 0" type="primary" @click="submitOrder" v-if="storageInTotal > 0">提交</el-button>
  226. </div>
  227. <div v-if="sparePartAccessType == 20">
  228. <el-button size="small" v-if="storageOutTotal > 0" @click="clrearQuantityOut(true)">清空</el-button>
  229. <el-button size="small" :disabled="storageOutTotal == 0" type="primary" @click="submitOrder" v-if="storageOutTotal > 0">提交</el-button>
  230. </div>
  231. </el-form-item>
  232. </el-form>
  233. <div class="padding-xs" v-if="sparePartAccessType == 10">
  234. <el-table :data="Object.values(srorageQuantityIn)"
  235. stripe
  236. :cell-style="{ color: 'var(--black)' }"
  237. :header-cell-style="{ color: 'var(--white)',background: '#5e5e5e' }">
  238. <el-table-column label="备件编号" align="center" prop="sparePartNumber"></el-table-column>
  239. <el-table-column label="备件名称" align="center" prop="sparePartName"></el-table-column>
  240. <el-table-column label="备件规格" align="center" prop="sparePartSpecifications"></el-table-column>
  241. <el-table-column label="备件品牌" align="center" prop="sparePartBrand"></el-table-column>
  242. <el-table-column label="库存总量" align="center" prop="sparePartQuantity"></el-table-column>
  243. <el-table-column label="数量" align="center" prop="sparePartNumber" width="170">
  244. <template slot-scope="scope">
  245. <el-input-number v-model="scope.row.sparePartRetrievalQuantity" :min="1" :step="1"
  246. @change="updateStorageIn(scope.row)" style="width: 150px;"/>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="操作" align="center" width="100">
  250. <template slot-scope="scope">
  251. <el-button link type="text" class="text-red padding-xs" @click="removeQuantityIn(scope.row)" icon="el-icon-delete">删除</el-button>
  252. </template>
  253. </el-table-column>
  254. </el-table>
  255. </div>
  256. <div class="padding-xs" v-else-if="sparePartAccessType == 20">
  257. <el-table :data="Object.values(srorageQuantityOut)"
  258. stripe
  259. :cell-style="{ color: 'var(--black)' }"
  260. :header-cell-style="{ color: 'var(--white)',background: '#5e5e5e' }">
  261. <el-table-column label="备件编号" align="center" prop="sparePartNumber"></el-table-column>
  262. <el-table-column label="备件名称" align="center" prop="sparePartName"></el-table-column>
  263. <el-table-column label="备件规格" align="center" prop="sparePartSpecifications"></el-table-column>
  264. <el-table-column label="备件品牌" align="center" prop="sparePartBrand"></el-table-column>
  265. <el-table-column label="库存总量" align="center" prop="sparePartQuantity"></el-table-column>
  266. <el-table-column label="数量" align="center" prop="sparePartNumber" width="170">
  267. <template slot-scope="scope">
  268. <el-input-number v-model="scope.row.sparePartRetrievalQuantity" :min="1" :step="1"
  269. @change="updateStorageOut(scope.row)" style="width: 150px;"/>
  270. </template>
  271. </el-table-column>
  272. <el-table-column label="操作" align="center" width="100">
  273. <template slot-scope="scope">
  274. <el-button link type="text" class="text-red padding-xs" @click="removeQuantityOut(scope.row)" icon="el-icon-delete">删除</el-button>
  275. </template>
  276. </el-table-column>
  277. </el-table>
  278. </div>
  279. </el-drawer>
  280. </div>
  281. <script type="text/javascript">
  282. document.write('<script src="../assets/fileApi.js?id=' + (new Date().getTime()) + '" type="text/javascript" charset="utf-8"><\/script>');
  283. document.write('<script src="../components/TextTag.js?id=' + (new Date().getTime()) + '" type="text/javascript" charset="utf-8"><\/script>');
  284. document.write('<script src="../assets/storageList.js?id=' + (new Date().getTime()) + '" type="text/javascript" charset="utf-8"><\/script>');
  285. </script>
  286. </body>
  287. </html>