Distributor.vue 8.3 KB

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