综合办公系统
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

checkPrice.vue 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="工作内容" prop="workItem">
  5. <el-input
  6. v-model="queryParams.workItem"
  7. placeholder="请输入工作内容"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item label="内容细项" prop="subItem">
  13. <el-input
  14. v-model="queryParams.subItem"
  15. placeholder="请输入内容细项"
  16. clearable
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  22. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  23. </el-form-item>
  24. </el-form>
  25. <el-row :gutter="10" class="mb8">
  26. <el-col :span="1.5">
  27. <el-button
  28. type="primary"
  29. plain
  30. icon="el-icon-plus"
  31. size="mini"
  32. @click="handleAdd"
  33. v-hasPermi="['oa:price:add']"
  34. >新增</el-button>
  35. </el-col>
  36. <el-col :span="1.5">
  37. <el-button
  38. type="success"
  39. plain
  40. icon="el-icon-edit"
  41. size="mini"
  42. :disabled="single"
  43. @click="handleUpdate"
  44. v-hasPermi="['oa:price:edit']"
  45. >修改</el-button>
  46. </el-col>
  47. <el-col :span="1.5">
  48. <el-button
  49. type="danger"
  50. plain
  51. icon="el-icon-delete"
  52. size="mini"
  53. :disabled="multiple"
  54. @click="handleDelete"
  55. v-hasPermi="['oa:price:remove']"
  56. >删除</el-button>
  57. </el-col>
  58. <el-col :span="1.5">
  59. <el-button
  60. type="warning"
  61. plain
  62. icon="el-icon-download"
  63. size="mini"
  64. @click="handleExport"
  65. v-hasPermi="['oa:price:export']"
  66. >导出</el-button>
  67. </el-col>
  68. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  69. </el-row>
  70. <el-table v-loading="loading" :data="checkPriceList" @selection-change="handleSelectionChange">
  71. <el-table-column type="selection" width="55" align="center" />
  72. <el-table-column label="工作类别" align="center" prop="workType" />
  73. <el-table-column label="工作内容" align="center" prop="workItem" />
  74. <el-table-column label="内容细项" align="center" prop="subItem" />
  75. <el-table-column label="单价比例" align="center" prop="pricePercentage" />
  76. <el-table-column label="等级或比例尺" align="center" prop="scaleGrade" />
  77. <el-table-column label="单位" align="center" prop="unit" />
  78. <el-table-column label="一般地类单价" align="center" prop="commonPrice" />
  79. <el-table-column label="复杂地类单价" align="center" prop="complexPrice" />
  80. <el-table-column label="备注" align="center" prop="remark" />
  81. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  82. <template slot-scope="scope">
  83. <el-button
  84. size="mini"
  85. type="text"
  86. icon="el-icon-edit"
  87. @click="handleUpdate(scope.row)"
  88. v-hasPermi="['oa:price:edit']"
  89. >修改</el-button>
  90. <el-button
  91. size="mini"
  92. type="text"
  93. icon="el-icon-delete"
  94. @click="handleDelete(scope.row)"
  95. v-hasPermi="['oa:price:remove']"
  96. >删除</el-button>
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. <pagination
  101. v-show="total>0"
  102. :total="total"
  103. :page.sync="queryParams.pageNum"
  104. :limit.sync="queryParams.pageSize"
  105. @pagination="getList"
  106. />
  107. <!-- 添加或修改cmc核算单价对话框 -->
  108. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  109. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  110. <el-form-item label="工作内容" prop="workItem">
  111. <el-input v-model="form.workItem" placeholder="请输入工作内容" />
  112. </el-form-item>
  113. <el-form-item label="内容细项" prop="subItem">
  114. <el-input v-model="form.subItem" placeholder="请输入内容细项" />
  115. </el-form-item>
  116. <el-form-item label="单价比例" prop="pricePercentage">
  117. <el-input v-model="form.pricePercentage" placeholder="请输入单价比例" />
  118. </el-form-item>
  119. <el-form-item label="等级或比例尺" prop="scaleGrade">
  120. <el-input v-model="form.scaleGrade" placeholder="请输入等级或比例尺" />
  121. </el-form-item>
  122. <el-form-item label="单位" prop="unit">
  123. <el-input v-model="form.unit" placeholder="请输入单位" />
  124. </el-form-item>
  125. <el-form-item label="一般地类单价" prop="commonPrice">
  126. <el-input v-model="form.commonPrice" placeholder="请输入一般地类单价" />
  127. </el-form-item>
  128. <el-form-item label="复杂地类单价" prop="complexPrice">
  129. <el-input v-model="form.complexPrice" placeholder="请输入复杂地类单价" />
  130. </el-form-item>
  131. <el-form-item label="备注" prop="remark">
  132. <el-input v-model="form.remark" placeholder="请输入备注" />
  133. </el-form-item>
  134. </el-form>
  135. <div slot="footer" class="dialog-footer">
  136. <el-button type="primary" @click="submitForm">确 定</el-button>
  137. <el-button @click="cancel">取 消</el-button>
  138. </div>
  139. </el-dialog>
  140. </div>
  141. </template>
  142. <script>
  143. import { listCheckPrice, getCheckPrice, delCheckPrice, addCheckPrice, updateCheckPrice } from "@/api/oa/price/checkPrice";
  144. export default {
  145. name: "CheckPrice",
  146. data() {
  147. return {
  148. // 遮罩层
  149. loading: true,
  150. // 选中数组
  151. ids: [],
  152. // 非单个禁用
  153. single: true,
  154. // 非多个禁用
  155. multiple: true,
  156. // 显示搜索条件
  157. showSearch: true,
  158. // 总条数
  159. total: 0,
  160. // cmc核算单价表格数据
  161. checkPriceList: [],
  162. // 弹出层标题
  163. title: "",
  164. // 是否显示弹出层
  165. open: false,
  166. // 查询参数
  167. queryParams: {
  168. pageNum: 1,
  169. pageSize: 10,
  170. workType: null,
  171. workItem: null,
  172. subItem: null,
  173. pricePercentage: null,
  174. scaleGrade: null,
  175. unit: null,
  176. commonPrice: null,
  177. complexPrice: null,
  178. },
  179. // 表单参数
  180. form: {},
  181. // 表单校验
  182. rules: {
  183. }
  184. };
  185. },
  186. created() {
  187. this.getList();
  188. },
  189. methods: {
  190. /** 查询cmc核算单价列表 */
  191. getList() {
  192. this.loading = true;
  193. listCheckPrice(this.queryParams).then(response => {
  194. this.checkPriceList = response.rows;
  195. this.total = response.total;
  196. this.loading = false;
  197. });
  198. },
  199. // 取消按钮
  200. cancel() {
  201. this.open = false;
  202. this.reset();
  203. },
  204. // 表单重置
  205. reset() {
  206. this.form = {
  207. id: null,
  208. workType: null,
  209. workItem: null,
  210. subItem: null,
  211. pricePercentage: null,
  212. scaleGrade: null,
  213. unit: null,
  214. commonPrice: null,
  215. complexPrice: null,
  216. remark: null
  217. };
  218. this.resetForm("form");
  219. },
  220. /** 搜索按钮操作 */
  221. handleQuery() {
  222. this.queryParams.pageNum = 1;
  223. this.getList();
  224. },
  225. /** 重置按钮操作 */
  226. resetQuery() {
  227. this.resetForm("queryForm");
  228. this.handleQuery();
  229. },
  230. // 多选框选中数据
  231. handleSelectionChange(selection) {
  232. this.ids = selection.map(item => item.id)
  233. this.single = selection.length!==1
  234. this.multiple = !selection.length
  235. },
  236. /** 新增按钮操作 */
  237. handleAdd() {
  238. this.reset();
  239. this.open = true;
  240. this.title = "添加cmc核算单价";
  241. },
  242. /** 修改按钮操作 */
  243. handleUpdate(row) {
  244. this.reset();
  245. const id = row.id || this.ids
  246. getCheckPrice(id).then(response => {
  247. this.form = response.data;
  248. this.open = true;
  249. this.title = "修改cmc核算单价";
  250. });
  251. },
  252. /** 提交按钮 */
  253. submitForm() {
  254. this.$refs["form"].validate(valid => {
  255. if (valid) {
  256. if (this.form.id != null) {
  257. updateCheckPrice(this.form).then(response => {
  258. this.$modal.msgSuccess("修改成功");
  259. this.open = false;
  260. this.getList();
  261. });
  262. } else {
  263. addCheckPrice(this.form).then(response => {
  264. this.$modal.msgSuccess("新增成功");
  265. this.open = false;
  266. this.getList();
  267. });
  268. }
  269. }
  270. });
  271. },
  272. /** 删除按钮操作 */
  273. handleDelete(row) {
  274. const ids = row.id || this.ids;
  275. this.$modal.confirm('是否确认删除cmc核算单价编号为"' + ids + '"的数据项?').then(function() {
  276. return delCheckPrice(ids);
  277. }).then(() => {
  278. this.getList();
  279. this.$modal.msgSuccess("删除成功");
  280. }).catch(() => {});
  281. },
  282. /** 导出按钮操作 */
  283. handleExport() {
  284. this.download('oa/checkPrice/export', {
  285. ...this.queryParams
  286. }, `checkPrice_${new Date().getTime()}.xlsx`)
  287. }
  288. }
  289. };
  290. </script>