sum_list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选条件 -->
  4. <div class="screen-container">
  5. <Collapse :screen-form="screenForm">
  6. <template #right_btn>
  7. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  8. <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
  9. </template>
  10. <template #search>
  11. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
  12. <el-row :gutter="20">
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="销售单号" prop="orderNum">
  15. <el-input v-model="screenForm.orderNum" placeholder="请输入销售单号"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="销售类型" prop="salesType">
  20. <el-input v-model="screenForm.salesType" placeholder="请输入销售类型"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="产品名称" prop="chName">
  25. <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :xs="24" :sm="12" :lg="6">
  29. <el-form-item label="产品编码" prop="chNum">
  30. <el-input v-model="screenForm.chNum" placeholder="请输入产品编码"></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="12" :lg="6">
  34. <el-form-item label="规格型号" prop="model">
  35. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="12" :lg="6">
  39. <el-form-item label="品类" prop="type">
  40. <el-select v-model="screenForm.type" placeholder="全部">
  41. <el-option label="全部" value=""></el-option>
  42. <el-option
  43. v-for="item in typeList"
  44. :key="item.dictCode"
  45. :label="item.dictValue"
  46. :value="item.dictCode"
  47. ></el-option>
  48. </el-select>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :lg="6">
  52. <el-form-item label="经销商名称" prop="jxsName">
  53. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :xs="24" :sm="12" :lg="6">
  57. <el-form-item label="经销商编码" prop="jxsNum">
  58. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编码"></el-input>
  59. </el-form-item>
  60. </el-col>
  61. </el-row>
  62. </el-form>
  63. </template>
  64. </Collapse>
  65. </div>
  66. <div class="mymain-container">
  67. <div class="btn-group clearfix">
  68. <div class="fr">
  69. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  70. </div>
  71. </div>
  72. <div class="table">
  73. <el-table
  74. v-loading="listLoading"
  75. :data="dataList"
  76. element-loading-text="Loading"
  77. border
  78. fit
  79. highlight-current-row
  80. stripe
  81. @selection-change="handleSelectionChange"
  82. >
  83. <el-table-column align="center" type="selection" width="55"></el-table-column>
  84. <el-table-column
  85. align="center"
  86. label="单据号"
  87. prop="billNo"
  88. min-width="160"
  89. show-overflow-tooltip
  90. ></el-table-column>
  91. <el-table-column align="center" label="订单类型" prop="orderType" min-width="160" show-overflow-tooltip>
  92. <template slot-scope="scope">
  93. {{ scope.row.orderType | orderTypeFilter }}
  94. </template>
  95. </el-table-column>
  96. <el-table-column
  97. align="center"
  98. label="销售类型"
  99. prop="saleName"
  100. min-width="160"
  101. show-overflow-tooltip
  102. ></el-table-column>
  103. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
  104. <template slot-scope="scope">
  105. <CopyButton :copyText="scope.row.materialNumber" />
  106. <span>{{ scope.row.materialNumber }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  110. <template slot-scope="scope">
  111. <CopyButton :copyText="scope.row.materialOldNumber" />
  112. <span>{{ scope.row.materialOldNumber }}</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  116. <template slot-scope="scope">
  117. <CopyButton :copyText="scope.row.materialName" />
  118. <span>{{ scope.row.materialName }}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  122. <template slot-scope="scope">
  123. <CopyButton :copyText="scope.row.specification" />
  124. <span>{{ scope.row.specification }}</span>
  125. </template>
  126. </el-table-column>
  127. <el-table-column
  128. align="center"
  129. label="计量单位"
  130. prop="unit"
  131. min-width="100"
  132. show-overflow-tooltip
  133. ></el-table-column>
  134. <el-table-column
  135. align="center"
  136. label="数量"
  137. prop="number"
  138. min-width="100"
  139. show-overflow-tooltip
  140. ></el-table-column>
  141. <el-table-column
  142. align="center"
  143. label="单价"
  144. prop="price"
  145. min-width="100"
  146. show-overflow-tooltip
  147. ></el-table-column>
  148. <el-table-column
  149. align="center"
  150. label="金额"
  151. prop="amount"
  152. min-width="100"
  153. show-overflow-tooltip
  154. ></el-table-column>
  155. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  156. <template slot-scope="scope">
  157. <CopyButton :copyText="scope.row.customerNumber" />
  158. <span>{{ scope.row.customerNumber }}</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  162. <template slot-scope="scope">
  163. <CopyButton :copyText="scope.row.customerName" />
  164. <span>{{ scope.row.customerName }}</span>
  165. </template>
  166. </el-table-column>
  167. </el-table>
  168. </div>
  169. </div>
  170. <div class="pagination clearfix">
  171. <div class="fr">
  172. <el-pagination
  173. @size-change="handleSizeChange"
  174. @current-change="handleCurrentChange"
  175. :current-page="currentPage"
  176. :page-sizes="[10, 20, 30, 50]"
  177. :page-size="10"
  178. layout="total, sizes, prev, pager, next, jumper"
  179. :total="listTotal"
  180. >
  181. </el-pagination>
  182. </div>
  183. </div>
  184. <div class="">
  185. <div>
  186. <el-button size="small" type="primary" @click="clickSubmit()">提 交</el-button>
  187. </div>
  188. <div style="margin-top: 10px; font-size: 14px; color: #666">注:提交成功后,系统将自动生成采购计划订单</div>
  189. </div>
  190. </div>
  191. </template>
  192. <script>
  193. import { getSumList, submitPlan } from '@/api/supply/purchase'
  194. import { getDictList } from '@/api/common'
  195. export default {
  196. filters: {
  197. orderTypeFilter(val) {
  198. const MAP = {
  199. 1: '工程计划单',
  200. 2: '零售计划单'
  201. }
  202. return MAP[val]
  203. }
  204. },
  205. data() {
  206. return {
  207. currentPage: 1, // 当前页码
  208. pageSize: 10, // 每页数量
  209. listTotal: 0, // 列表总数
  210. dataList: null, // 列表数据
  211. listLoading: false, // 列表加载loading
  212. screenForm: {
  213. // 筛选表单数据
  214. orderNum: '',
  215. salesType: '',
  216. chName: '',
  217. chNum: '',
  218. model: '',
  219. type: '',
  220. jxsName: '',
  221. jxsNum: ''
  222. },
  223. typeList: [],
  224. isCollapse: true,
  225. multipleSelection: []
  226. }
  227. },
  228. computed: {
  229. exParams() {
  230. return {
  231. billNo: this.screenForm.orderNum,
  232. saleName: this.screenForm.salesType,
  233. materialName: this.screenForm.chName,
  234. materialNumber: this.screenForm.chNum,
  235. specification: this.screenForm.model,
  236. materialType: this.screenForm.type,
  237. customerName: this.screenForm.jxsName,
  238. customerNumber: this.screenForm.jxsNum
  239. }
  240. }
  241. },
  242. created() {
  243. this.getDictList()
  244. this.getList()
  245. },
  246. methods: {
  247. // 查询按钮权限
  248. checkBtnRole(value) {
  249. // let btnRole = this.$route.meta.roles;
  250. // if(!btnRole) {return true}
  251. // let index = btnRole.indexOf(value);
  252. // return index >= 0;
  253. return true
  254. },
  255. getDictList() {
  256. getDictList({ sysDictEnum: 'PRODUCT_TYPE' }).then(res => {
  257. this.typeList = res.data
  258. })
  259. },
  260. // 查询列表
  261. getList() {
  262. this.listLoading = true
  263. let params = {
  264. pageNum: this.currentPage,
  265. pageSize: this.pageSize,
  266. billNo: this.screenForm.orderNum,
  267. saleName: this.screenForm.salesType,
  268. materialName: this.screenForm.chName,
  269. materialNumber: this.screenForm.chNum,
  270. specification: this.screenForm.model,
  271. materialType: this.screenForm.type,
  272. customerName: this.screenForm.jxsName,
  273. customerNumber: this.screenForm.jxsNum
  274. }
  275. getSumList(params).then(res => {
  276. this.dataList = res.data.records
  277. this.listTotal = res.data.total
  278. this.listLoading = false
  279. })
  280. },
  281. // 提交筛选表单
  282. submitScreenForm() {
  283. this.currentPage = 1
  284. this.getList()
  285. },
  286. // 重置筛选表单
  287. resetScreenForm() {
  288. this.$refs.screenForm.resetFields()
  289. this.currentPage = 1
  290. this.getList()
  291. },
  292. // 更改每页数量
  293. handleSizeChange(val) {
  294. this.pageSize = val
  295. this.currentPage = 1
  296. this.getList()
  297. },
  298. // 更改当前页
  299. handleCurrentChange(val) {
  300. this.currentPage = val
  301. this.getList()
  302. },
  303. // 表格选择
  304. handleSelectionChange(val) {
  305. this.multipleSelection = val
  306. },
  307. // 提交
  308. clickSubmit() {
  309. if (this.multipleSelection.length < 1) {
  310. return this.$errorMsg('请选择单据')
  311. }
  312. let ids = []
  313. this.multipleSelection.forEach(item => {
  314. ids.push(item.id)
  315. })
  316. submitPlan(ids).then(res => {
  317. this.$successMsg()
  318. this.getList()
  319. })
  320. }
  321. }
  322. }
  323. </script>
  324. <style lang="scss" scoped></style>