Distributor.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <template>
  2. <el-container>
  3. <el-header height="" class="pdt">
  4. <el-form
  5. :model="details"
  6. ref="details"
  7. label-width="120px"
  8. size="small"
  9. label-position="left"
  10. class="demo-ruleForm"
  11. >
  12. <el-row :gutter="20">
  13. <el-col :xs="24" :ms="12" :lg="12">
  14. <el-form-item label="销售政策编号" prop="code">
  15. <el-input
  16. disabled
  17. v-model="details.code"
  18. placeholder="如未填写,则系统自动生成"
  19. ></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :ms="12" :lg="12">
  23. <el-form-item label="销售政策说明" prop="title">
  24. <el-input
  25. disabled
  26. v-model="details.title"
  27. placeholder="销售政策说明"
  28. ></el-input>
  29. </el-form-item>
  30. </el-col>
  31. </el-row>
  32. <el-row :gutter="20">
  33. <el-col :xs="24" :ms="12" :lg="12">
  34. <el-form-item label="销售政策类型" prop="type">
  35. <el-select
  36. disabled
  37. v-model="typeOptions[details.type]"
  38. placeholder="请选择"
  39. >
  40. <el-option
  41. v-for="item in typeOptions"
  42. :key="item.value"
  43. :label="item.label"
  44. :value="item.value"
  45. >
  46. </el-option>
  47. </el-select>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :xs="24" :ms="12" :lg="12"> </el-col>
  51. </el-row>
  52. <el-row :gutter="20">
  53. <el-col :xs="24" :ms="12" :lg="12">
  54. <el-form-item label="制单人" prop="createBy">
  55. <el-input
  56. disabled
  57. v-model="details.createBy"
  58. placeholder=""
  59. ></el-input>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :xs="24" :ms="12" :lg="12">
  63. <el-form-item label="制单日期" prop="startTime">
  64. <el-input
  65. disabled
  66. v-model="details.startTime"
  67. placeholder=""
  68. ></el-input>
  69. </el-form-item>
  70. </el-col>
  71. </el-row>
  72. <el-row>
  73. <el-form-item label="表头备注" prop="remark">
  74. <el-input
  75. disabled
  76. v-model="details.remark"
  77. placeholder="新风机变频挂机。按提货数量1:3开单"
  78. ></el-input>
  79. </el-form-item>
  80. </el-row>
  81. </el-form>
  82. </el-header>
  83. <!-- 按钮 -->
  84. <div class="btn-group clearfix">
  85. <div class="fl">
  86. <el-button
  87. type="primary"
  88. size="small"
  89. slot="reference"
  90. class="el-popover-left"
  91. @click="handleEdit"
  92. >批量编辑</el-button
  93. >
  94. </div>
  95. </div>
  96. <el-main>
  97. <el-table
  98. v-loading="listLoading"
  99. :data="dataList"
  100. element-loading-text="Loading"
  101. border
  102. @select="hanleSelectAll"
  103. @select-all="hanleSelectAll"
  104. fit
  105. highlight-current-row
  106. stripe
  107. >
  108. <el-table-column type="selection" width="55"> </el-table-column>
  109. <el-table-column
  110. prop="customerNumber"
  111. label="经销商编码"
  112. width="300"
  113. align="center"
  114. >
  115. </el-table-column>
  116. <el-table-column
  117. prop="customerName"
  118. label="经销商名称"
  119. width="300"
  120. align="center"
  121. >
  122. </el-table-column>
  123. <el-table-column
  124. prop="limitTakeNum"
  125. label="最多提货套数"
  126. width="300"
  127. align="center"
  128. >
  129. </el-table-column>
  130. <el-table-column
  131. prop="remark"
  132. label="表体备注"
  133. width="300"
  134. align="center"
  135. >
  136. </el-table-column>
  137. <el-table-column
  138. prop="lastOrderTime"
  139. label="最近订货时间"
  140. width="300"
  141. align="center"
  142. >
  143. </el-table-column>
  144. <el-table-column
  145. fixed="right"
  146. label="操作"
  147. align="center"
  148. width="200"
  149. >
  150. <!-- v-if="!$store.getters.customerId"-->
  151. <template slot-scope="scope" >
  152. <el-button
  153. type="text"
  154. size="small"
  155. @click="(type = 2), (dialogVisible = true), (id = scope.row.id)"
  156. >设置</el-button
  157. >
  158. <el-button
  159. type="text"
  160. size="small"
  161. @click="(type = 1), (dialogVisible = true), (id = scope.row.id)"
  162. >
  163. 备注</el-button
  164. >
  165. <!-- <el-button type="text" size="small">删除</el-button> -->
  166. </template>
  167. </el-table-column>
  168. </el-table>
  169. <!-- 分页 -->
  170. <div class="fr" style="margin-top: 20px">
  171. <el-pagination
  172. @size-change="handleSizeChange"
  173. @current-change="handleCurrentChange"
  174. :current-page="currentPage"
  175. :page-sizes="[10, 20, 30, 50]"
  176. :page-size="10"
  177. layout="total, sizes, prev, pager, next, jumper"
  178. :total="listTotal"
  179. >
  180. </el-pagination>
  181. </div>
  182. </el-main>
  183. <el-dialog
  184. :visible.sync="dialogVisible"
  185. width="30%"
  186. :before-close="handleClose"
  187. >
  188. <el-input
  189. v-if="type == 1"
  190. v-model="remark"
  191. placeholder="备注"
  192. size="small"
  193. ></el-input>
  194. <el-input
  195. v-else
  196. v-model="limitTakeNum"
  197. placeholder="最大提货数量
  198. "
  199. size="small"
  200. ></el-input>
  201. <span slot="footer" class="dialog-footer">
  202. <el-button @click="dialogVisible = false">取 消</el-button>
  203. <el-button type="primary" @click="handleInfo">确 定</el-button>
  204. </span>
  205. </el-dialog>
  206. </el-container>
  207. </template>
  208. <script>
  209. import Pagination from "./Pagination";
  210. import Transfer from "./Transfer";
  211. import { getPolicyDetail, getCustomerList, eidtBatch } from "@/api/policy_list";
  212. import Minxin from "@/mixin";
  213. export default {
  214. mixins: [Minxin],
  215. props: {
  216. cid: {
  217. type: String,
  218. default: "",
  219. },
  220. },
  221. data() {
  222. return {
  223. dialogVisible: false,
  224. input: "",
  225. ruleForm: {},
  226. listLoading: false,
  227. remark: "",
  228. limitTakeNum: "",
  229. searchForm: {
  230. code: "",
  231. remark: "",
  232. title: "",
  233. },
  234. id: "",
  235. ids: [],
  236. dataList: [],
  237. detail: {},
  238. radio: "",
  239. type: "",
  240. typeOptions: [
  241. {
  242. vlaue: "PROVISION",
  243. label: "配提",
  244. },
  245. {
  246. value: "LIMIT",
  247. label: "限量",
  248. },
  249. ],
  250. details: {},
  251. };
  252. },
  253. methods: {
  254. handelLeftCheck(e) {
  255. console.log(e);
  256. },
  257. getList() {
  258. if (this.cid) {
  259. this.listLoading = true;
  260. const params = {
  261. pageNum: this.currentPage,
  262. pageSize: this.pageSize,
  263. policyId: this.cid,
  264. };
  265. getCustomerList(params).then((res) => {
  266. this.dataList = res.data.records;
  267. this.listLoading = false;
  268. });
  269. getPolicyDetail({ policyId: this.cid }).then((res) => {
  270. this.details = res.data;
  271. });
  272. this.listLoading = false;
  273. }
  274. },
  275. handleEdit() {
  276. if (this.ids.length) {
  277. this.type = 2;
  278. this.dialogVisible = true;
  279. return;
  280. }
  281. this.$errorMsg("请选编辑项");
  282. },
  283. handleClose(done) {
  284. done();
  285. },
  286. hanleDelete() {},
  287. handleInfo() {
  288. let ids = this.id && typeof this.id != Array ? [this.id] : this.ids;
  289. eidtBatch({
  290. policyCustomerIds: ids.join(","),
  291. limitTakeNum: this.limitTakeNum,
  292. remark: this.remark,
  293. }).then((res) => {
  294. this.$successMsg("编辑成功");
  295. this.dialogVisible = false;
  296. this.remark = "";
  297. this.limitTakeNum = "";
  298. this.getList();
  299. });
  300. },
  301. },
  302. components: {
  303. Transfer,
  304. Pagination,
  305. },
  306. };
  307. </script>
  308. <style lang="scss" scoped>
  309. .pdt {
  310. padding-top: 20px;
  311. }
  312. .text_right {
  313. text-align: right;
  314. }
  315. .el-select {
  316. width: 100%;
  317. }
  318. </style>