balanceMxAdd.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <div>
  3. <Card style="width:100%" :bordered="false" :dis-hover="true">
  4. <p slot="title">新增结算明细</p>
  5. <div slot="extra">
  6. <Button @click="$emit('return')">返回</Button>
  7. </div>
  8. <Row :gutter="10" style="margin-bottom: 10px">
  9. <Col span="4">
  10. <Select v-model="addForm.ssxm" placeholder="项目名称" style="width: 95%">
  11. <Option
  12. disabled
  13. v-for="item in ssxmList"
  14. :value="item.areaId"
  15. :key="item.areaId"
  16. >{{ item.areaName }}</Option>
  17. </Select>
  18. </Col>
  19. <Col span="4">
  20. <DatePicker
  21. format="yyyy-MM-dd"
  22. :value="addForm.xdsj"
  23. @on-change="addForm.xdsj=$event"
  24. type="daterange"
  25. placeholder="下单时间"
  26. ></DatePicker>
  27. </Col>
  28. <Col span="4">
  29. <DatePicker
  30. format="yyyy-MM-dd"
  31. :value="addForm.rksj"
  32. @on-change="addForm.rksj=$event"
  33. type="daterange"
  34. placeholder="入库时间"
  35. ></DatePicker>
  36. </Col>
  37. <Col span="4">
  38. <Input v-model="addForm.rkd" placeholder="入库单" style="width: 95%" />
  39. </Col>
  40. <Col span="8">
  41. <Button type="primary" style="width: 80px" @click="getTableData">查询</Button>
  42. <Button type="primary" style="width: 80px" @click="addMx">添加</Button>
  43. </Col>
  44. </Row>
  45. <Table
  46. :columns="tableColumn"
  47. style="width: 100%"
  48. :data="tableData"
  49. :loading="tableLoading"
  50. @on-select="tableOnSelect"
  51. @on-select-cancel="tableOnCancel"
  52. @on-select-all="tableOnSelect"
  53. @on-select-all-cancel="tableOnCancel"
  54. >
  55. <template slot-scope="{ row, index }" slot="action">
  56. <div>
  57. <a href="javascript:;">编辑</a>
  58. <a href="javascript:;">复制</a>
  59. <a href="javascript:;">删除</a>
  60. <a href="javascript:;">打印</a>
  61. </div>
  62. </template>
  63. </Table>
  64. </Card>
  65. </div>
  66. </template>
  67. <script>
  68. import { hajwySettlementList } from "@/service/getData";
  69. export default {
  70. props: ["ssxmList"],
  71. data() {
  72. return {
  73. gysId: "",
  74. xmId: "",
  75. //新增结算明细表单
  76. addForm: {
  77. ssxm: "", //项目名称
  78. xdsj: ["", ""], //下单时间
  79. rksj: ["", ""], //入库时间
  80. rkd: "" //入库单
  81. },
  82. //表格查询内容
  83. searchForm: {
  84. yjfl: "", //一级分类
  85. ejfl: "", // 二级分类
  86. wlmc: "" //物料编码或名称
  87. },
  88. yjflList: [
  89. { label: "1", value: "1" },
  90. { label: "2", value: "2" },
  91. { label: "3", value: "3" }
  92. ],
  93. ejflList: [
  94. { label: "1", value: "1" },
  95. { label: "2", value: "2" },
  96. { label: "3", value: "3" }
  97. ],
  98. jldwList: [],
  99. wllxList: [],
  100. // 表格参数
  101. tableLoading: false,
  102. tableColumn: [
  103. {
  104. type: "selection",
  105. width: 60,
  106. align: "center"
  107. },
  108. {
  109. title: "入库单",
  110. key: "warehouseEntry",
  111. tooltip: "true"
  112. },
  113. {
  114. title: "物料名称",
  115. key: "sgNames",
  116. tooltip: "true"
  117. },
  118. {
  119. title: "总价(元)",
  120. key: "totalPrice",
  121. tooltip: "true"
  122. },
  123. {
  124. title: "采购人",
  125. key: "purchaserName",
  126. tooltip: "true"
  127. },
  128. {
  129. title: "采购人联系方式",
  130. key: "purchaserTel",
  131. tooltip: "true"
  132. },
  133. {
  134. title: "下单时间",
  135. key: "orderTime",
  136. tooltip: "true"
  137. },
  138. {
  139. title: "入库时间",
  140. key: "storehouseTime",
  141. tooltip: "true"
  142. },
  143. {
  144. title: "入库仓库",
  145. key: "storehouseName",
  146. tooltip: "true"
  147. },
  148. {
  149. title: "仓管员",
  150. key: "warehouseKeeper",
  151. tooltip: "true"
  152. }
  153. ],
  154. tableData: [],
  155. tableSelect: []
  156. };
  157. },
  158. methods: {
  159. //列表方法
  160. getTableData() {
  161. let postData = {
  162. // projectId: this.addForm.ssxm,
  163. projectId: 10,
  164. orderTimeStart: this.addForm.xdsj[0],
  165. orderTimeEnd: this.addForm.xdsj[1],
  166. storehouseTimeStart: this.addForm.rksj[0],
  167. storehouseTimeEnd: this.addForm.rksj[1],
  168. warehouseEntry: this.addForm.rkd,
  169. supplierId: this.gysId
  170. };
  171. let postStr = "";
  172. for (let item in postData) {
  173. if (postData[item] == "") {
  174. } else {
  175. postStr += `${item}=${postData[item]}&`;
  176. }
  177. }
  178. postStr = postStr.replace(/\&$/, "");
  179. this.tableLoading = true;
  180. hajwySettlementList(postStr).then(res => {
  181. this.tableLoading = false;
  182. if (res.status == 200) {
  183. this.tableData = res.data;
  184. }
  185. });
  186. },
  187. tableOnSelect(selection, row) {
  188. this.tableSelect = selection;
  189. },
  190. tableOnCancel(selection, row) {
  191. this.tableSelect = selection;
  192. },
  193. //添加明细
  194. addMx() {
  195. this.$emit("addMx", this.tableSelect);
  196. this.$emit("return");
  197. }
  198. }
  199. };
  200. </script>
  201. <style lang="scss" scoped>
  202. ivu-card-head-inner,
  203. .ivu-card-head p {
  204. display: inline-block;
  205. width: 100%;
  206. height: 20px;
  207. line-height: 20px;
  208. font-size: 14px;
  209. color: #17233d;
  210. font-weight: 700;
  211. overflow: hidden;
  212. text-overflow: ellipsis;
  213. white-space: nowrap;
  214. font-weight: normal;
  215. }
  216. .mainCont .tables {
  217. height: 50px;
  218. border-right: 1px solid #e4e4e4;
  219. border-bottom: 1px solid #e4e4e4;
  220. line-height: 50px;
  221. text-align: center;
  222. &:nth-child(2n + 1) {
  223. background: #f8f9fb;
  224. }
  225. }
  226. .mainCont {
  227. border-left: 1px solid #e4e4e4;
  228. border-top: 1px solid #e4e4e4;
  229. }
  230. </style>