Distributor.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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="mini"
  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 class="mymain-container">
  104. <div class="table">
  105. <el-table
  106. v-loading="listLoading"
  107. :data="dataList"
  108. element-loading-text="Loading"
  109. border
  110. @select="hanleSelectAll"
  111. @select-all="hanleSelectAll"
  112. fit
  113. highlight-current-row
  114. stripe
  115. >
  116. <el-table-column type="selection" width="55" align="center"> </el-table-column>
  117. <el-table-column
  118. prop="customerNumber"
  119. label="经销商编码"
  120. width="300"
  121. align="center"
  122. >
  123. </el-table-column>
  124. <el-table-column
  125. prop="customerName"
  126. label="经销商名称"
  127. width="300"
  128. align="center"
  129. >
  130. </el-table-column>
  131. <el-table-column
  132. prop="limitTakeNum"
  133. label="最多提货套数"
  134. width="300"
  135. align="center"
  136. >
  137. </el-table-column>
  138. <el-table-column
  139. prop="remark"
  140. label="表体备注"
  141. width="300"
  142. align="center"
  143. >
  144. </el-table-column>
  145. <el-table-column
  146. prop="lastOrderTime"
  147. label="最近订货时间"
  148. width="300"
  149. align="center"
  150. >
  151. </el-table-column>
  152. <el-table-column
  153. fixed="right"
  154. label="操作"
  155. align="center"
  156. width="200"
  157. >
  158. <!-- v-if="!$store.getters.customerId"-->
  159. <template slot-scope="scope" >
  160. <el-button
  161. type="text"
  162. size="small"
  163. @click="(type = 2), (dialogVisible = true), (id = scope.row.id)"
  164. >设置</el-button
  165. >
  166. <el-button
  167. type="text"
  168. size="small"
  169. @click="(type = 1), (dialogVisible = true), (id = scope.row.id)"
  170. >
  171. 备注</el-button
  172. >
  173. <!-- <el-button type="text" size="small">删除</el-button> -->
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. </div>
  178. <!-- 分页 -->
  179. <div class="fr" style="margin-top: 20px">
  180. <el-pagination
  181. @size-change="handleSizeChange"
  182. @current-change="handleCurrentChange"
  183. :current-page="currentPage"
  184. :page-sizes="[10, 20, 30, 50]"
  185. :page-size="10"
  186. layout="total, sizes, prev, pager, next, jumper"
  187. :total="listTotal"
  188. >
  189. </el-pagination>
  190. </div>
  191. </el-main>
  192. <el-dialog
  193. :visible.sync="dialogVisible"
  194. width="30%"
  195. :before-close="handleClose"
  196. >
  197. <el-input
  198. v-if="type == 1"
  199. v-model="remark"
  200. placeholder="备注"
  201. size="small"
  202. ></el-input>
  203. <el-input
  204. v-else
  205. v-model="limitTakeNum"
  206. placeholder="最大提货数量
  207. "
  208. size="small"
  209. ></el-input>
  210. <span slot="footer" class="dialog-footer">
  211. <el-button @click="dialogVisible = false">取 消</el-button>
  212. <el-button type="primary" @click="handleInfo">确 定</el-button>
  213. </span>
  214. </el-dialog>
  215. </el-container>
  216. </template>
  217. <script>
  218. import Pagination from './Pagination'
  219. import Transfer from './Transfer'
  220. import { eidtBatch, getCustomerList, getPolicyDetail } from '@/api/policy_list'
  221. import Minxin from '@/mixin'
  222. export default {
  223. mixins: [Minxin],
  224. props: {
  225. cid: {
  226. type: String,
  227. default: "",
  228. },
  229. },
  230. data() {
  231. return {
  232. dialogVisible: false,
  233. input: "",
  234. ruleForm: {},
  235. listLoading: false,
  236. remark: "",
  237. limitTakeNum: "",
  238. searchForm: {
  239. code: "",
  240. remark: "",
  241. title: "",
  242. },
  243. id: "",
  244. ids: [],
  245. dataList: [],
  246. detail: {},
  247. radio: "",
  248. type: "",
  249. typeOptions: [
  250. {
  251. vlaue: "PROVISION",
  252. label: "配提",
  253. },
  254. {
  255. value: "LIMIT",
  256. label: "限量",
  257. },
  258. ],
  259. details: {},
  260. };
  261. },
  262. methods: {
  263. handelLeftCheck(e) {
  264. console.log(e);
  265. },
  266. getList() {
  267. if (this.cid) {
  268. this.listLoading = true;
  269. const params = {
  270. pageNum: this.currentPage,
  271. pageSize: this.pageSize,
  272. policyId: this.cid,
  273. };
  274. getCustomerList(params).then((res) => {
  275. this.dataList = res.data.records;
  276. this.listTotal = res.data.total
  277. this.listLoading = false;
  278. });
  279. getPolicyDetail({ policyId: this.cid }).then((res) => {
  280. this.details = res.data;
  281. this.listLoading = false;
  282. });
  283. }
  284. },
  285. handleEdit() {
  286. if (this.ids.length) {
  287. this.type = 2;
  288. this.dialogVisible = true;
  289. return;
  290. }
  291. this.$errorMsg("请选编辑项");
  292. },
  293. handleClose(done) {
  294. done();
  295. },
  296. hanleDelete() {},
  297. handleInfo() {
  298. let ids = this.id && typeof this.id != Array ? [this.id] : this.ids;
  299. eidtBatch({
  300. policyCustomerIds: ids.join(","),
  301. limitTakeNum: this.limitTakeNum,
  302. remark: this.remark,
  303. }).then((res) => {
  304. this.$successMsg("编辑成功");
  305. this.dialogVisible = false;
  306. this.remark = "";
  307. this.limitTakeNum = "";
  308. this.getList();
  309. });
  310. },
  311. },
  312. components: {
  313. Transfer,
  314. Pagination,
  315. },
  316. };
  317. </script>
  318. <style lang="scss" scoped>
  319. .pdt {
  320. padding-top: 20px;
  321. }
  322. .text_right {
  323. text-align: right;
  324. }
  325. .el-select {
  326. width: 100%;
  327. }
  328. </style>