index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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="lotnum">-->
  5. <!-- <el-input-->
  6. <!-- v-model="queryParams.lotnum"-->
  7. <!-- placeholder="请输入批次"-->
  8. <!-- clearable-->
  9. <!-- size="small"-->
  10. <!-- @keyup.enter.native="handleQuery"-->
  11. <!-- />-->
  12. <!-- </el-form-item>-->
  13. <el-form-item label="产品" prop="lotatt02">
  14. <el-input
  15. v-model="queryParams.lotatt02"
  16. placeholder="请输入产品"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="生产批号" prop="lotatt01">
  23. <el-input
  24. v-model="queryParams.lotatt01"
  25. placeholder="请输入生产批号"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item label="班" prop="lotatt09">
  32. <el-input
  33. v-model="queryParams.lotatt09"
  34. placeholder="请输入班"
  35. clearable
  36. size="small"
  37. @keyup.enter.native="handleQuery"
  38. />
  39. </el-form-item>
  40. <el-form-item label="包装工" prop="lotatt06">
  41. <el-input
  42. v-model="queryParams.lotatt06"
  43. placeholder="请输入包装工"
  44. clearable
  45. size="small"
  46. @keyup.enter.native="handleQuery"
  47. />
  48. </el-form-item>
  49. <el-form-item label="托盘号" prop="lotatt07">
  50. <el-input
  51. v-model="queryParams.lotatt07"
  52. placeholder="请输入托盘号"
  53. clearable
  54. size="small"
  55. @keyup.enter.native="handleQuery"
  56. />
  57. </el-form-item>
  58. <!-- <el-form-item label="${comment}" prop="lotatt05">-->
  59. <!-- <el-input-->
  60. <!-- v-model="queryParams.ext4"-->
  61. <!-- placeholder="请输入${comment}"-->
  62. <!-- clearable-->
  63. <!-- size="small"-->
  64. <!-- @keyup.enter.native="handleQuery"-->
  65. <!-- />-->
  66. <!-- </el-form-item>-->
  67. <!-- <el-form-item label="${comment}" prop="lotatt06">-->
  68. <!-- <el-input-->
  69. <!-- v-model="queryParams.ext5"-->
  70. <!-- placeholder="请输入${comment}"-->
  71. <!-- clearable-->
  72. <!-- size="small"-->
  73. <!-- @keyup.enter.native="handleQuery"-->
  74. <!-- />-->
  75. <!-- </el-form-item>-->
  76. <!-- <el-form-item label="${comment}" prop="lotatt07">-->
  77. <!-- <el-input-->
  78. <!-- v-model="queryParams.ext6"-->
  79. <!-- placeholder="请输入${comment}"-->
  80. <!-- clearable-->
  81. <!-- size="small"-->
  82. <!-- @keyup.enter.native="handleQuery"-->
  83. <!-- />-->
  84. <!-- </el-form-item>-->
  85. <!-- <el-form-item label="${comment}" prop="ext7">-->
  86. <!-- <el-input-->
  87. <!-- v-model="queryParams.ext7"-->
  88. <!-- placeholder="请输入${comment}"-->
  89. <!-- clearable-->
  90. <!-- size="small"-->
  91. <!-- @keyup.enter.native="handleQuery"-->
  92. <!-- />-->
  93. <!-- </el-form-item>-->
  94. <!-- <el-form-item label="${comment}" prop="lotatt08">-->
  95. <!-- <el-input-->
  96. <!-- v-model="queryParams.ext8"-->
  97. <!-- placeholder="请输入${comment}"-->
  98. <!-- clearable-->
  99. <!-- size="small"-->
  100. <!-- @keyup.enter.native="handleQuery"-->
  101. <!-- />-->
  102. <!-- </el-form-item>-->
  103. <el-form-item>
  104. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  105. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  106. </el-form-item>
  107. </el-form>
  108. <!-- <el-row :gutter="10" class="mb8">-->
  109. <!-- <el-col :span="1.5">-->
  110. <!-- <el-button-->
  111. <!-- type="primary"-->
  112. <!-- plain-->
  113. <!-- icon="el-icon-plus"-->
  114. <!-- size="mini"-->
  115. <!-- @click="handleAdd"-->
  116. <!-- v-hasPermi="['system:data:add']"-->
  117. <!-- >新增</el-button>-->
  118. <!-- </el-col>-->
  119. <!-- <el-col :span="1.5">-->
  120. <!-- <el-button-->
  121. <!-- type="success"-->
  122. <!-- plain-->
  123. <!-- icon="el-icon-edit"-->
  124. <!-- size="mini"-->
  125. <!-- :disabled="single"-->
  126. <!-- @click="handleUpdate"-->
  127. <!-- v-hasPermi="['system:data:edit']"-->
  128. <!-- >修改</el-button>-->
  129. <!-- </el-col>-->
  130. <!-- <el-col :span="1.5">-->
  131. <!-- <el-button-->
  132. <!-- type="danger"-->
  133. <!-- plain-->
  134. <!-- icon="el-icon-delete"-->
  135. <!-- size="mini"-->
  136. <!-- :disabled="multiple"-->
  137. <!-- @click="handleDelete"-->
  138. <!-- v-hasPermi="['system:data:remove']"-->
  139. <!-- >删除</el-button>-->
  140. <!-- </el-col>-->
  141. <!-- <el-col :span="1.5">-->
  142. <!-- <el-button-->
  143. <!-- type="warning"-->
  144. <!-- plain-->
  145. <!-- icon="el-icon-download"-->
  146. <!-- size="mini"-->
  147. <!-- @click="handleExport"-->
  148. <!-- v-hasPermi="['system:data:export']"-->
  149. <!-- >导出</el-button>-->
  150. <!-- </el-col>-->
  151. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
  152. <!-- </el-row>-->
  153. <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
  154. <el-table-column type="selection" width="55" align="center" />
  155. <el-table-column label="包装时间" align="center" prop="lotatt03" />
  156. <el-table-column label="包装工" align="center" prop="lotatt06" />
  157. <el-table-column label="班" align="center" prop="lotatt09" />
  158. <el-table-column label="托盘号" align="center" prop="lotatt07" />
  159. <el-table-column label="生产批号" align="center" prop="lotatt01" />
  160. <el-table-column label="产品" align="center" prop="lotatt02" />
  161. <el-table-column label="包数" align="center" prop="num" />
  162. <el-table-column label="净重" align="center" prop="lotatt10" />
  163. <el-table-column label="毛重" align="center" prop="lotatt11" />
  164. <el-table-column label="复称重量(公斤)" align="center" prop="lotatt14" />
  165. <!-- <el-table-column label="${comment}" align="center" prop="lotatt04" />-->
  166. <!-- <el-table-column label="${comment}" align="center" prop="lotatt05" />-->
  167. <!-- <el-table-column label="${comment}" align="center" prop="lotatt08" />-->
  168. <!-- <el-table-column label="${comment}" align="center" prop="lotatt12" />-->
  169. <!-- <el-table-column label="${comment}" align="center" prop="lotatt13" />-->
  170. <!-- <el-table-column label="${comment}" align="center" prop="lotatt15" />-->
  171. <!-- <el-table-column label="${comment}" align="center" prop="lotatt16" />-->
  172. <!-- <el-table-column label="${comment}" align="center" prop="lotatt17" />-->
  173. <!-- <el-table-column label="${comment}" align="center" prop="lotatt18" />-->
  174. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
  175. <!-- <template slot-scope="scope">-->
  176. <!-- <el-button-->
  177. <!-- size="mini"-->
  178. <!-- type="text"-->
  179. <!-- icon="el-icon-edit"-->
  180. <!-- @click="handleUpdate(scope.row)"-->
  181. <!-- v-hasPermi="['system:data:edit']"-->
  182. <!-- >修改</el-button>-->
  183. <!-- <el-button-->
  184. <!-- size="mini"-->
  185. <!-- type="text"-->
  186. <!-- icon="el-icon-delete"-->
  187. <!-- @click="handleDelete(scope.row)"-->
  188. <!-- v-hasPermi="['system:data:remove']"-->
  189. <!-- >删除</el-button>-->
  190. <!-- </template>-->
  191. <!-- </el-table-column>-->
  192. </el-table>
  193. <pagination
  194. v-show="total>0"
  195. :total="total"
  196. :page.sync="queryParams.pageNum"
  197. :limit.sync="queryParams.pageSize"
  198. @pagination="getList"
  199. />
  200. <!-- 添加或修改【请填写功能名称】对话框 -->
  201. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  202. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  203. <el-form-item label="批次" prop="lotnum">
  204. <el-input v-model="form.lotnum" placeholder="请输入批次" />
  205. </el-form-item>
  206. <el-form-item label="${comment}" prop="num">
  207. <el-input v-model="form.num" placeholder="请输入${comment}" />
  208. </el-form-item>
  209. <el-form-item label="${comment}" prop="ext1">
  210. <el-input v-model="form.ext1" placeholder="请输入${comment}" />
  211. </el-form-item>
  212. <el-form-item label="${comment}" prop="ext2">
  213. <el-input v-model="form.ext2" placeholder="请输入${comment}" />
  214. </el-form-item>
  215. <el-form-item label="${comment}" prop="ext3">
  216. <el-input v-model="form.ext3" placeholder="请输入${comment}" />
  217. </el-form-item>
  218. <el-form-item label="${comment}" prop="ext4">
  219. <el-input v-model="form.ext4" placeholder="请输入${comment}" />
  220. </el-form-item>
  221. <el-form-item label="${comment}" prop="ext5">
  222. <el-input v-model="form.ext5" placeholder="请输入${comment}" />
  223. </el-form-item>
  224. <el-form-item label="${comment}" prop="ext6">
  225. <el-input v-model="form.ext6" placeholder="请输入${comment}" />
  226. </el-form-item>
  227. <el-form-item label="${comment}" prop="ext7">
  228. <el-input v-model="form.ext7" placeholder="请输入${comment}" />
  229. </el-form-item>
  230. <el-form-item label="${comment}" prop="ext8">
  231. <el-input v-model="form.ext8" placeholder="请输入${comment}" />
  232. </el-form-item>
  233. </el-form>
  234. <div slot="footer" class="dialog-footer">
  235. <el-button type="primary" @click="submitForm">确 定</el-button>
  236. <el-button @click="cancel">取 消</el-button>
  237. </div>
  238. </el-dialog>
  239. </div>
  240. </template>
  241. <script>
  242. import { listData, getData, delData, addData, updateData } from "@/api/weighData/data";
  243. export default {
  244. name: "Data",
  245. data() {
  246. return {
  247. // 遮罩层
  248. loading: true,
  249. // 选中数组
  250. ids: [],
  251. // 非单个禁用
  252. single: true,
  253. // 非多个禁用
  254. multiple: true,
  255. // 显示搜索条件
  256. showSearch: true,
  257. // 总条数
  258. total: 0,
  259. // 【请填写功能名称】表格数据
  260. dataList: [],
  261. // 弹出层标题
  262. title: "",
  263. // 是否显示弹出层
  264. open: false,
  265. // 查询参数
  266. queryParams: {
  267. pageNum: 1,
  268. pageSize: 10,
  269. lotatt01:null,
  270. lotatt02:null,
  271. lotatt03:null,
  272. lotatt04:null,
  273. lotatt05:null,
  274. lotatt06:null,
  275. lotatt07:null,
  276. lotatt08:null,
  277. lotatt09:null,
  278. lotatt10:null,
  279. lotatt11:null,
  280. lotatt12:null,
  281. lotatt13:null,
  282. lotatt14:null,
  283. lotatt15:null,
  284. lotatt16:null,
  285. lotatt17:null,
  286. lotatt18:null
  287. },
  288. // 表单参数
  289. form: {},
  290. // 表单校验
  291. rules: {
  292. }
  293. };
  294. },
  295. created() {
  296. this.getList();
  297. },
  298. methods: {
  299. /** 查询【请填写功能名称】列表 */
  300. getList() {
  301. this.loading = true;
  302. listData(this.queryParams).then(response => {
  303. this.dataList = response.rows;
  304. this.total = response.total;
  305. this.loading = false;
  306. });
  307. },
  308. // 取消按钮
  309. cancel() {
  310. this.open = false;
  311. this.reset();
  312. },
  313. // 表单重置
  314. reset() {
  315. this.form = {
  316. id: null,
  317. lotnum: null,
  318. num: null,
  319. ext1: null,
  320. ext2: null,
  321. ext3: null,
  322. ext4: null,
  323. ext5: null,
  324. ext6: null,
  325. ext7: null,
  326. ext8: null,
  327. createBy: null,
  328. createTime: null,
  329. updateBy: null,
  330. updateTime: null
  331. };
  332. this.resetForm("form");
  333. },
  334. /** 搜索按钮操作 */
  335. handleQuery() {
  336. this.queryParams.pageNum = 1;
  337. this.getList();
  338. },
  339. /** 重置按钮操作 */
  340. resetQuery() {
  341. this.resetForm("queryForm");
  342. this.handleQuery();
  343. },
  344. // 多选框选中数据
  345. handleSelectionChange(selection) {
  346. this.ids = selection.map(item => item.id)
  347. this.single = selection.length!==1
  348. this.multiple = !selection.length
  349. },
  350. /** 新增按钮操作 */
  351. handleAdd() {
  352. this.reset();
  353. this.open = true;
  354. this.title = "添加【请填写功能名称】";
  355. },
  356. /** 修改按钮操作 */
  357. handleUpdate(row) {
  358. this.reset();
  359. const id = row.id || this.ids
  360. getData(id).then(response => {
  361. this.form = response.data;
  362. this.open = true;
  363. this.title = "修改【请填写功能名称】";
  364. });
  365. },
  366. /** 提交按钮 */
  367. submitForm() {
  368. this.$refs["form"].validate(valid => {
  369. if (valid) {
  370. if (this.form.id != null) {
  371. updateData(this.form).then(response => {
  372. this.$modal.msgSuccess("修改成功");
  373. this.open = false;
  374. this.getList();
  375. });
  376. } else {
  377. addData(this.form).then(response => {
  378. this.$modal.msgSuccess("新增成功");
  379. this.open = false;
  380. this.getList();
  381. });
  382. }
  383. }
  384. });
  385. },
  386. /** 删除按钮操作 */
  387. handleDelete(row) {
  388. const ids = row.id || this.ids;
  389. this.$modal.confirm('是否确认删除【请填写功能名称】编号为"' + ids + '"的数据项?').then(function() {
  390. return delData(ids);
  391. }).then(() => {
  392. this.getList();
  393. this.$modal.msgSuccess("删除成功");
  394. }).catch(() => {});
  395. },
  396. /** 导出按钮操作 */
  397. handleExport() {
  398. this.download('system/data/export', {
  399. ...this.queryParams
  400. }, `data_${new Date().getTime()}.xlsx`)
  401. }
  402. }
  403. };
  404. </script>