index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="仓库名称" prop="fpid">
  5. <el-input
  6. v-model="queryParams.fPid"
  7. placeholder="请输入仓库名称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="计划日期" prop="fPid">
  14. <el-input
  15. v-model="queryParams.fPid"
  16. placeholder="请输入计划日期"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="巡检人" prop="fPid">
  23. <el-input
  24. v-model="queryParams.fPid"
  25. placeholder="请输入巡检人"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item label="巡检备注" prop="fPid">
  32. <el-input
  33. v-model="queryParams.fPid"
  34. placeholder="请输入巡检备注"
  35. clearable
  36. size="small"
  37. @keyup.enter.native="handleQuery"
  38. />
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  42. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  43. </el-form-item>
  44. </el-form>
  45. <el-row :gutter="10" class="mb8">
  46. <el-col :span="1.5">
  47. <el-button
  48. type="primary"
  49. icon="el-icon-plus"
  50. size="mini"
  51. @click="handleAdd"
  52. v-hasPermi="['warehouse:log:add']"
  53. >新增</el-button>
  54. </el-col>
  55. <el-col :span="1.5">
  56. <el-button
  57. type="success"
  58. icon="el-icon-edit"
  59. size="mini"
  60. :disabled="single"
  61. @click="handleUpdate"
  62. v-hasPermi="['warehouse:log:edit']"
  63. >修改</el-button>
  64. </el-col>
  65. <el-col :span="1.5">
  66. <el-button
  67. type="danger"
  68. icon="el-icon-delete"
  69. size="mini"
  70. :disabled="multiple"
  71. @click="handleDelete"
  72. v-hasPermi="['warehouse:log:remove']"
  73. >删除</el-button>
  74. </el-col>
  75. <el-col :span="1.5">
  76. <el-button
  77. type="warning"
  78. icon="el-icon-download"
  79. size="mini"
  80. @click="handleExport"
  81. v-hasPermi="['warehouse:log:export']"
  82. >导出</el-button>
  83. </el-col>
  84. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  85. </el-row>
  86. <el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
  87. <el-table-column type="selection" width="55" align="center" index="index" />
  88. <el-table-column label="仓库名称" align="center" prop="warehouse" />
  89. <el-table-column label="计划日期" align="center" prop="planned" />
  90. <el-table-column label="巡检日期" align="center" prop="planned" />
  91. <el-table-column label="巡检人" align="center" prop="people" />
  92. <el-table-column label="巡检备注" align="center" prop="remarks" />
  93. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  94. <template slot-scope="scope">
  95. <el-button
  96. size="mini"
  97. type="text"
  98. icon="el-icon-edit"
  99. @click="handleUpdate(scope.row)"
  100. v-hasPermi="['warehouse:log:edit']"
  101. >修改</el-button>
  102. <el-button
  103. size="mini"
  104. type="text"
  105. icon="el-icon-delete"
  106. @click="handleDelete(scope.row)"
  107. v-hasPermi="['warehouse:log:remove']"
  108. >删除</el-button>
  109. </template>
  110. </el-table-column>
  111. </el-table>
  112. <pagination
  113. v-show="total>0"
  114. :total="total"
  115. :page.sync="queryParams.pageNum"
  116. :limit.sync="queryParams.pageSize"
  117. @pagination="getList"
  118. />
  119. <!-- 添加或修改入出库状态对话框 -->
  120. <el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
  121. <el-form ref="form" :model="form" :rules="rules" label-width="80px" style="display:flex;flex-wrap: wrap;justify-content: space-between">
  122. <el-form-item label="仓库名称" prop="fPid">
  123. <el-input v-model="form.fPid" style="width: 250px;" placeholder="请输入仓库名称" />
  124. </el-form-item>
  125. <el-form-item label="巡检日期" prop="fPid">
  126. <el-input v-model="form.fPid" style="width: 250px;" placeholder="请输入巡检日期" />
  127. </el-form-item>
  128. <el-form-item label="巡检人" prop="fPid">
  129. <el-input v-model="form.fPid" style="width: 250px;" placeholder="请输入仓库名称" />
  130. </el-form-item>
  131. </el-form>
  132. <el-form ref="form" :model="form" :rules="rules" label-width="50px">
  133. <el-form-item label="备注" prop="remark">
  134. <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  135. </el-form-item>
  136. </el-form>
  137. <el-card class="box-card">
  138. <div slot="header" class="clearfix">
  139. <span>巡检照片</span>
  140. <!-- <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
  141. </div>
  142. <div class="text item" style="display: flex;justify-content: space-between">
  143. <img src="https://www.dmu.com.cn/images/banner/banner41.jpg?v=2" style="width: 20%;" alt="">
  144. <img src="https://www.dmu.com.cn/images/banner/banner41.jpg?v=2" style="width: 20%;" alt="">
  145. <img src="https://www.dmu.com.cn/images/banner/banner41.jpg?v=2" style="width: 20%;" alt="">
  146. <img src="https://www.dmu.com.cn/images/banner/banner41.jpg?v=2" style="width: 20%;" alt="">
  147. </div>
  148. </el-card>
  149. <div slot="footer" class="dialog-footer">
  150. <el-button type="primary" @click="submitForm">确 定</el-button>
  151. <el-button @click="cancel">取 消</el-button>
  152. </div>
  153. </el-dialog>
  154. </div>
  155. </template>
  156. <script>
  157. export default {
  158. name: "Log",
  159. components: {
  160. },
  161. data() {
  162. return {
  163. // 遮罩层
  164. loading: true,
  165. // 选中数组
  166. ids: [],
  167. // 非单个禁用
  168. single: true,
  169. // 非多个禁用
  170. multiple: true,
  171. // 显示搜索条件
  172. showSearch: true,
  173. // 总条数
  174. total: 0,
  175. // 入出库状态表格数据
  176. logList: [
  177. {
  178. warehouse:'途宝仓库-A1',
  179. planned:'2021-04-07',
  180. people:'张三',
  181. remarks:'无异常'
  182. },{
  183. warehouse:'途宝仓库-A2',
  184. planned:'2021-04-07',
  185. people:'张三',
  186. remarks:'无异常'
  187. }
  188. ],
  189. // 弹出层标题
  190. title: "",
  191. // 是否显示弹出层
  192. open: false,
  193. // 查询参数
  194. queryParams: {
  195. pageNum: 1,
  196. pageSize: 10,
  197. fPid: null,
  198. fItmeid: null,
  199. fItmestatus: null,
  200. fBillstatus: null,
  201. },
  202. // 表单参数
  203. form: {},
  204. // 表单校验
  205. rules: {
  206. }
  207. };
  208. },
  209. created() {
  210. this.getList();
  211. },
  212. methods: {
  213. /** 查询入出库状态列表 */
  214. getList() {
  215. this.loading = false;
  216. },
  217. // 取消按钮
  218. cancel() {
  219. this.open = false;
  220. this.reset();
  221. },
  222. // 表单重置
  223. reset() {
  224. this.form = {
  225. fId: null,
  226. fPid: null,
  227. fItmeid: null,
  228. fItmestatus: 0,
  229. fBillstatus: "0",
  230. createTime: null,
  231. createBy: null,
  232. updateBy: null,
  233. updateTime: null,
  234. remark: null
  235. };
  236. this.resetForm("form");
  237. },
  238. /** 搜索按钮操作 */
  239. handleQuery() {
  240. this.queryParams.pageNum = 1;
  241. this.getList();
  242. },
  243. /** 重置按钮操作 */
  244. resetQuery() {
  245. this.resetForm("queryForm");
  246. this.handleQuery();
  247. },
  248. // 多选框选中数据
  249. handleSelectionChange(selection) {
  250. this.ids = selection.map(item => item.fId)
  251. this.single = selection.length!==1
  252. this.multiple = !selection.length
  253. },
  254. /** 新增按钮操作 */
  255. handleAdd() {
  256. this.reset();
  257. this.open = true;
  258. this.title = "添加巡检详情";
  259. },
  260. /** 修改按钮操作 */
  261. handleUpdate(row) {
  262. this.reset();
  263. const fId = row.fId || this.ids
  264. },
  265. /** 提交按钮 */
  266. submitForm() {
  267. this.$refs["form"].validate(valid => {
  268. if (valid) {
  269. if (this.form.fId != null) {
  270. updateLog(this.form).then(response => {
  271. this.msgSuccess("修改成功");
  272. this.open = false;
  273. this.getList();
  274. });
  275. } else {
  276. addLog(this.form).then(response => {
  277. this.msgSuccess("新增成功");
  278. this.open = false;
  279. this.getList();
  280. });
  281. }
  282. }
  283. });
  284. },
  285. /** 删除按钮操作 */
  286. handleDelete(row) {
  287. const fIds = row.fId || this.ids;
  288. this.$confirm('是否确认删除入出库状态编号为"' + fIds + '"的数据项?', "警告", {
  289. confirmButtonText: "确定",
  290. cancelButtonText: "取消",
  291. type: "warning"
  292. }).then(function() {
  293. return delLog(fIds);
  294. }).then(() => {
  295. this.getList();
  296. this.msgSuccess("删除成功");
  297. })
  298. },
  299. /** 导出按钮操作 */
  300. handleExport() {
  301. const queryParams = this.queryParams;
  302. this.$confirm('是否确认导出所有入出库状态数据项?', "警告", {
  303. confirmButtonText: "确定",
  304. cancelButtonText: "取消",
  305. type: "warning"
  306. }).then(function() {
  307. return exportLog(queryParams);
  308. }).then(response => {
  309. this.download(response.msg);
  310. })
  311. }
  312. }
  313. };
  314. </script>