SupplierInGoods.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :span="6">
  8. <a-form-item label="">
  9. <a-input
  10. placeholder="商品名称"
  11. v-model="queryParam.goodsName"
  12. ></a-input>
  13. </a-form-item>
  14. </a-col>
  15. <a-col :span="3">
  16. <span>
  17. <a-button type="primary" @click="searchQuery" icon="search"
  18. >查询</a-button
  19. >
  20. </span>
  21. </a-col>
  22. <a-col :span="3">
  23. <a-button @click="handleAdd" type="danger" style="margin-left: 8px"
  24. >新增</a-button
  25. ></a-col
  26. >
  27. </a-row>
  28. </a-form>
  29. </div>
  30. <!-- 查询区域-END -->
  31. <!-- table区域-begin -->
  32. <div>
  33. <a-table
  34. ref="table"
  35. size="middle"
  36. :scroll="{ x: true }"
  37. bordered
  38. rowKey="id"
  39. :columns="columns"
  40. :dataSource="dataSource"
  41. :pagination="ipagination"
  42. :loading="loading"
  43. class="j-table-force-nowrap"
  44. @change="handleTableChange"
  45. >
  46. <template slot="avatar" slot-scope="text">
  47. <a-avatar v-if="text" :src="text" />
  48. <a-avatar v-else icon="user" />
  49. </template>
  50. <template slot="imgSlot" slot-scope="text, record">
  51. <span v-if="!text" style="font-size: 12px; font-style: italic"
  52. >无图片</span
  53. >
  54. <img
  55. v-else
  56. :src="getImgView(text)"
  57. :preview="record.id"
  58. height="25px"
  59. alt=""
  60. style="max-width: 80px; font-size: 12px; font-style: italic"
  61. />
  62. </template>
  63. <template slot="fileSlot" slot-scope="text">
  64. <span v-if="!text" style="font-size: 12px; font-style: italic"
  65. >无文件</span
  66. >
  67. <a-button
  68. v-else
  69. :ghost="true"
  70. type="primary"
  71. icon="download"
  72. size="small"
  73. @click="downloadFile(text)"
  74. >
  75. 下载
  76. </a-button>
  77. </template>
  78. <template slot="price" slot-scope="text, record, index">
  79. <div>
  80. <a-input-number
  81. v-model="record.price"
  82. :min="0"
  83. @change="priceChange($event, record)"
  84. />
  85. </div>
  86. </template>
  87. <span slot="action" slot-scope="text, record">
  88. <a @click="handleDelete(record.id)">删除</a>
  89. </span>
  90. </a-table>
  91. </div>
  92. <select-goods-modal ref="modalForm" @ok="modalFormOk"></select-goods-modal>
  93. </a-card>
  94. </template>
  95. <script>
  96. import "@/assets/less/TableExpand.less";
  97. import { mixinDevice } from "@/utils/mixin";
  98. import { JeecgListMixin } from "@/mixins/JeecgListMixin";
  99. import { httpAction } from "@/api/manage";
  100. import SelectGoodsModal from "./SelectGoodsModal";
  101. export default {
  102. name: "BusMemberCardList",
  103. mixins: [JeecgListMixin, mixinDevice],
  104. components: {
  105. SelectGoodsModal,
  106. },
  107. props: {
  108. supplierId: {
  109. type: String,
  110. default: "",
  111. },
  112. },
  113. data() {
  114. const hotelInfo = JSON.parse(localStorage.getItem("storeInfo"));
  115. return {
  116. datetime: [],
  117. hotelId: "",
  118. num: 1,
  119. description: "PickingGoodsOrder",
  120. // 表头
  121. columns: [
  122. {
  123. title: "商品名称",
  124. align: "center",
  125. dataIndex: "goodsName",
  126. },
  127. {
  128. title: "商品类别",
  129. align: "center",
  130. dataIndex: "goodsTypeName",
  131. },
  132. {
  133. title: "供应价",
  134. align: "center",
  135. dataIndex: "price",
  136. scopedSlots: { customRender: "price" },
  137. },
  138. {
  139. title: "操作",
  140. dataIndex: "action",
  141. align: "center",
  142. fixed: "right",
  143. width: 147,
  144. scopedSlots: { customRender: "action" },
  145. },
  146. ],
  147. url: {
  148. list: "/kc/kcSupplierInGoods/list?supplierId=" + this.supplierId,
  149. delete: "/kc/kcSupplierInGoods/delete",
  150. deleteBatch: "/kc/kcSupplierInGoods/deleteBatch",
  151. exportXlsUrl: "/kc/kcSupplierInGoods/exportXls",
  152. importExcelUrl: "/kc/kcSupplierInGoods/importExcel",
  153. },
  154. dictOptions: {},
  155. superFieldList: [],
  156. orderGoodsDetailList: [],
  157. selectOrderInfo: {},
  158. };
  159. },
  160. created() {},
  161. computed: {
  162. importExcelUrl: function () {
  163. return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
  164. },
  165. },
  166. methods: {
  167. priceChange(e, record) {
  168. let httpurl = "/kc/kcSupplierInGoods/edit";
  169. let method = "put";
  170. httpAction(httpurl, record, method)
  171. .then((res) => {
  172. if (res.success) {
  173. this.$message.success(res.message);
  174. } else {
  175. this.$message.warning(res.message);
  176. }
  177. })
  178. },
  179. handleAdd() {
  180. this.$refs.modalForm.add();
  181. this.$refs.modalForm.title = "选择供货商品";
  182. this.$refs.modalForm.disableSubmit = false;
  183. this.$refs.modalForm.supplierId = this.supplierId;
  184. },
  185. handleSelect(row) {
  186. this.$emit("ok", row);
  187. },
  188. },
  189. };
  190. </script>
  191. <style scoped>
  192. @import "~@assets/less/common.less";
  193. /deep/ .ant-input-search-button {
  194. background-color: #ff4d4f;
  195. border-color: #ff4d4f;
  196. }
  197. /deep/ .ant-input-search-button[disabled]:hover {
  198. opacity: 0.7;
  199. background-color: #ff4d4f;
  200. border-color: #ff4d4f;
  201. }
  202. /deep/ .ant-input-search-button[disabled] {
  203. opacity: 0.7;
  204. color: #ffffff;
  205. }
  206. </style>