index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. <template>
  2. <div id="demandSummary">
  3. <div v-if="isList">
  4. <el-form class="search_area" label-width="100px">
  5. <el-row :gutter="10">
  6. <el-col :span="1.5">
  7. <el-form-item label="行状态">
  8. <el-select multiple v-model="queryParams.rowStatus" size="small" style="width: 200px" clearable>
  9. <el-option v-for="dict in dict.type.sys_row_status" :key="dict.value" :label="dict.label" :value="dict.value">
  10. </el-option>
  11. </el-select>
  12. </el-form-item>
  13. </el-col>
  14. <el-col :span="1.5">
  15. <el-form-item label="采购员">
  16. <el-select size="small" v-model="queryParams.buyerName" @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')" style="width: 200px">
  17. <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.id" />
  18. </el-select>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="1.5">
  22. <el-form-item label="品类">
  23. <el-select
  24. v-model="queryParams.materialName"
  25. size="small"
  26. clearable
  27. @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '选择品类')"
  28. style="width: 200px"
  29. >
  30. <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
  31. </el-select>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="1.5">
  35. <el-form-item label="" label-width="20px">
  36. <el-button type="primary" size="small" icon="el-icon-search" plain @click="search">搜索</el-button>
  37. <el-button size="small" icon="el-icon-refresh" plain @click="reset">重置</el-button>
  38. </el-form-item>
  39. </el-col>
  40. </el-row>
  41. <CollapseTransition>
  42. <div v-show="expanded">
  43. <el-row :gutter="10">
  44. <el-col :span="1.5">
  45. <el-form-item label="生产厂家">
  46. <el-input
  47. v-model="queryParams.manufacturer"
  48. size="small"
  49. clearable
  50. style="width: 200px"
  51. />
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="1.5">
  55. <el-form-item label="预测分类">
  56. <el-select v-model="queryParams.forecastClassification" size="small" style="width: 200px" clearable>
  57. <el-option
  58. v-for="dict in dict.type.predictive_classify" :key="dict.value" :label="dict.label" :value="dict.value">
  59. </el-option>
  60. </el-select>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="1.5">
  64. <el-form-item label="周期单位">
  65. <el-select v-model="queryParams.periodUnit" size="small" style="width: 200px" clearable>
  66. <el-option
  67. v-for="dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
  68. </el-option>
  69. </el-select>
  70. </el-form-item>
  71. </el-col>
  72. </el-row>
  73. <el-row :gutter="10">
  74. <!-- <el-col :span="1.5">
  75. <el-form-item label="转请购单号">
  76. <el-input
  77. v-model="queryParams.zqgdh"
  78. size="small"
  79. placeholder=""
  80. clearable
  81. style="width: 200px"
  82. />
  83. </el-form-item>
  84. </el-col> -->
  85. <el-col :span="1.5">
  86. <el-form-item label="业务部门">
  87. <el-select size="small" v-model="queryParams.departmentName" @focus="chooseRefer('DEPT_PARAM', true, '业务部门')" style="width: 200px">
  88. <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
  89. </el-select>
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="1.5">
  93. <el-form-item label="审核人">
  94. <el-select size="small" v-model="queryParams.puManagerAuditor" @focus="chooseRefer('CONTACTS_PARAM', true, '审核人')" style="width: 200px">
  95. <el-option v-for="item in auditOptions" :key="item.id" :label="item.name" :value="item.id" />
  96. </el-select>
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="1.5">
  100. <el-form-item label="采购需求单号">
  101. <el-input
  102. v-model="queryParams.code"
  103. size="small"
  104. placeholder=""
  105. clearable
  106. style="width: 200px"
  107. />
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. <el-row :gutter="10">
  112. <el-col :span="1.5">
  113. <el-form-item label="注册人">
  114. <el-input
  115. v-model="queryParams.registrant"
  116. size="small"
  117. placeholder=""
  118. clearable
  119. style="width: 200px"
  120. />
  121. </el-form-item>
  122. </el-col>
  123. <el-col :span="1.5">
  124. <el-form-item label="业务类型">
  125. <el-select v-model="queryParams.businessType" size="small" style="width: 200px" clearable>
  126. <el-option
  127. v-for="dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
  128. </el-option>
  129. </el-select>
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="1.5">
  133. <el-form-item label="单据来源">
  134. <el-select v-model="queryParams.billSource" size="small" style="width: 200px" clearable>
  135. <el-option
  136. v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
  137. </el-option>
  138. </el-select>
  139. </el-form-item>
  140. </el-col>
  141. </el-row>
  142. <el-row :gutter="10">
  143. <el-col :span="1.5">
  144. <el-form-item label="需求客户">
  145. <el-select size="small" v-model="queryParams.customer" @focus="chooseRefer('CUSTOMER_PARAM', true, '需求客户')" style="width: 200px">
  146. <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
  147. </el-select>
  148. </el-form-item>
  149. </el-col>
  150. <el-col :span="1.5">
  151. <el-form-item label="末级供应仓库">
  152. <el-select size="small" v-model="queryParams.lastWarehouse" @focus="chooseRefer('WAREHOUSE_PARAM', true, '末级供应仓库')" style="width: 200px">
  153. <el-option v-for="item in lastWarehouseOptions" :key="item.id" :label="item.name" :value="item.id" />
  154. </el-select>
  155. </el-form-item>
  156. </el-col>
  157. <el-col :span="1.5">
  158. <el-form-item label="末级供应库位">
  159. <el-select size="small" v-model="queryParams.lastAllocation" @focus="chooseRefer('ALLOCATION_PARAM', true, '末级供应库位')" style="width: 200px">
  160. <el-option v-for="item in lastAllocationOptions" :key="item.id" :label="item.name" :value="item.id" />
  161. </el-select>
  162. </el-form-item>
  163. </el-col>
  164. <!-- <el-col :span="1.5">
  165. <el-form-item label="转请购时间">
  166. <el-select v-model="queryParams.ywlx" size="small" style="width: 200px" clearable>
  167. <el-option
  168. v-for="item in options"
  169. :key="item.value"
  170. :label="item.label"
  171. :value="item.value">
  172. </el-option>
  173. </el-select>
  174. </el-form-item>
  175. </el-col> -->
  176. </el-row>
  177. <el-row :gutter="10">
  178. <el-col :span="1.5">
  179. <el-form-item label="物料编码">
  180. <el-input readonly size="small" v-model="queryParams.names" style="width: 200px">
  181. <el-button size="small" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
  182. </el-input>
  183. <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
  184. </el-form-item>
  185. </el-col>
  186. <el-col :span="1.5">
  187. <el-form-item label="默认采购组织">
  188. <el-select size="small" v-model="queryParams.purchaseOrg" @focus="chooseRefer('ORG_PARAM', true, '默认采购组织')" style="width: 200px">
  189. <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
  190. </el-select>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="1.5">
  194. <el-form-item label="需求日期">
  195. <el-date-picker
  196. v-model="queryParams.demandDate"
  197. type="date"
  198. value-format="yyyy-MM-dd"
  199. size="small"
  200. style="width: 200px"
  201. >
  202. </el-date-picker>
  203. </el-form-item>
  204. </el-col>
  205. </el-row>
  206. <el-row :gutter="10">
  207. <el-col :span="1.5">
  208. <el-form-item label="汇总审核时间">
  209. <el-date-picker
  210. v-model="queryParams.auditTime"
  211. type="date"
  212. value-format="yyyy-MM-dd"
  213. size="small"
  214. style="width: 200px"
  215. >
  216. </el-date-picker>
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="1.5">
  220. <el-form-item label="汇总确认时间">
  221. <el-date-picker
  222. v-model="queryParams.yesTime"
  223. type="date"
  224. value-format="yyyy-MM-dd"
  225. size="small"
  226. style="width: 200px"
  227. >
  228. </el-date-picker>
  229. </el-form-item>
  230. </el-col>
  231. </el-row>
  232. </div>
  233. </CollapseTransition>
  234. </el-form>
  235. <el-divider class="lines"><i style="cursor: pointer;" :class="expanded?'el-icon-arrow-up':'el-icon-arrow-down'" @click="drop"></i></el-divider>
  236. <el-card>
  237. <div class="btn_grooup">
  238. <el-button type="primary" size="small" @click="editList">编辑</el-button>
  239. <el-button type="success" size="small" v-if="!lineDisable" @click="saveList">保存</el-button>
  240. <el-button type="primary" size="small" @click="confirms">确认</el-button>
  241. <el-button type="primary" size="small" @click="cancels">取消</el-button>
  242. <el-button type="primary" size="small" @click="audits">审核</el-button>
  243. <el-button type="primary" size="small" @click="cancelAudits">弃审</el-button>
  244. <el-dropdown size="small" @command="handleCommand">
  245. <el-button size="small" type="primary" style="margin: 0 10px;">
  246. 导出<i class="el-icon-arrow-down el-icon--right"></i>
  247. </el-button>
  248. <el-dropdown-menu slot="dropdown">
  249. <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
  250. <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
  251. </el-dropdown-menu>
  252. </el-dropdown>
  253. <!-- <el-button type="primary" size="small">转请购</el-button> -->
  254. </div>
  255. <el-table
  256. :data="tableList"
  257. fit
  258. show-summary
  259. max-height="480"
  260. @selection-change="handleSelectionChange"
  261. :key="isUpdate"
  262. >
  263. <el-table-column type="selection" width="55" />
  264. <el-table-column label="行状态" align="center" prop="status" width="120px" :formatter="hangStatus"/>
  265. <el-table-column label="一级品类" align="center" prop="materialClassifyOneName" width="120px"/>
  266. <el-table-column label="物料编码" align="center" prop="materialCode" width="180px"/>
  267. <el-table-column label="品名" align="center" prop="materialName" width="180px"/>
  268. <el-table-column label="规格" align="center" prop="specification" width="200px"/>
  269. <el-table-column label="单位" align="center" prop="unit"/>
  270. <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
  271. <el-table-column label="需求单位数" align="center" prop="demandNum" width="120px"/>
  272. <el-table-column label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
  273. <el-table-column label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
  274. <el-table-column label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
  275. <el-table-column label="总月销量" align="center" prop="totalMonthlySales"/>
  276. <el-table-column label="需求可用周期" align="center" prop="demandCycle" width="180px"/>
  277. <el-table-column label="呆滞量" align="center" prop="dullQut"/>
  278. <el-table-column label="采购周期" align="center" prop="buyPeriod"/>
  279. <el-table-column label="中心公共库存" align="center" prop="centralPublicStock" width="120px"/>
  280. <el-table-column label="中心仓专属货位" align="center" prop="centralWarehouse" width="120px"/>
  281. <el-table-column label="区域分仓公共库存" align="center" prop="regionPublicStock" width="130px"/>
  282. <el-table-column label="各项目仓库存" align="center" prop="eachWarehouseStock" width="120px"/>
  283. <el-table-column label="电商仓库" align="center" prop="commerceWarehouse"/>
  284. <el-table-column label="采购在途" align="center" prop="buyTransit"/>
  285. <el-table-column label="借出在途" align="center" prop="lendTransit"/>
  286. <el-table-column label="调拨在途" align="center" prop="transferTransit"/>
  287. <el-table-column label="库存总计" align="center" prop="stockTotal"/>
  288. <el-table-column label="最小包装量" align="center" prop="minPackage" width="100px"/>
  289. <el-table-column label="最小订货量" align="center" prop="minOrder" width="100px"/>
  290. <el-table-column label="最小批量" align="center" prop="minBatch"/>
  291. <el-table-column label="人工调整数" align="center" prop="artificialAdjust" width="100px"/>
  292. <el-table-column label="修改原因" align="center" prop="modifyReason" width="150px">
  293. <template slot-scope="scope">
  294. <el-input :disabled="lineDisable" v-model="scope.row.modifyReason"/>
  295. </template>
  296. </el-table-column>
  297. <el-table-column label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
  298. <el-table-column label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
  299. <el-table-column label="最终采购量" align="center" prop="finalBuyQty" width="150">
  300. <template slot-scope="scope">
  301. <el-input :disabled="lineDisable" v-model="scope.row.finalBuyQty"/>
  302. </template>
  303. </el-table-column>
  304. <el-table-column label="二级品类" align="center" prop="materialClassifyTwoName" width="150px"/>
  305. <el-table-column label="三级品类" align="center" prop="materialClassifyThreeName" width="150px"/>
  306. <el-table-column label="四级品类" align="center" prop="materialClassifyFourName" width="150px"/>
  307. <el-table-column label="采购员" align="center" prop="buyerName" width="150px">
  308. <template slot-scope="scope">
  309. <el-input :disabled="lineDisable" size="small" v-model="scope.row.buyerName">
  310. <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'CONTACTS_PARAM', true, '采购员')"></el-button>
  311. </el-input>
  312. </template>
  313. </el-table-column>
  314. <el-table-column label="默认采购组织" align="center" prop="purchaseOrgName" width="280px">
  315. <template slot-scope="scope">
  316. <el-input :disabled="lineDisable" size="small" v-model="scope.row.purchaseOrgName">
  317. <el-button size="small" :disabled="lineDisable" slot="append" icon="el-icon-more" @click="chooseSon(scope.$index, 'ORG_PARAM', true, '默认采购组织')"></el-button>
  318. </el-input>
  319. </template>
  320. </el-table-column>
  321. <el-table-column label="有效期" align="center" prop="validityPeriod"/>
  322. <el-table-column label="有效期单位" align="center" prop="validityPeriodUnit" width="100px"/>
  323. <el-table-column label="业务类型" align="center" prop="businessType" :formatter="formatterBusinessType"/>
  324. <el-table-column label="安全库存量" align="center" prop="safetyStock" width="100px"/>
  325. <el-table-column label="单据来源" align="center" prop="billSource"/>
  326. <el-table-column label="行号" align="center" prop="rowNo"/>
  327. <el-table-column label="注册人" align="center" prop="registrant"/>
  328. <el-table-column label="可用量" align="center" prop="qty"/>
  329. <el-table-column label="总需与终采差异" align="center" prop="buyDiscrepancy" width="120px"/>
  330. <el-table-column label="集团预测分类" align="center" prop="forecastClassification" width="100px"/>
  331. <el-table-column label="中心仓占有量" align="center" prop="centerBinPossession" width="100px"/>
  332. <el-table-column label="中心仓可用量" align="center" prop="centralWarehouseAvailable" width="100px"/>
  333. <el-table-column label="物料类别" align="center" prop="materialCategory" width="150px"/>
  334. <el-table-column label="业务部门" align="center" prop="departmentName" width="150px"/>
  335. <el-table-column label="需求单位" align="center" prop="demandUnit"/>
  336. <el-table-column label="采购经理审核人" align="center" prop="puManagerAuditor" width="120px"/>
  337. <el-table-column
  338. fixed="right"
  339. label="操作"
  340. align="center"
  341. width="100"
  342. >
  343. <template slot-scope="scope">
  344. <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
  345. </template>
  346. </el-table-column>
  347. </el-table>
  348. <el-pagination
  349. @size-change="handleSizeChange"
  350. @current-change="handleCurrentChange"
  351. :current-page="1"
  352. :page-sizes="[5, 10, 15, 20]"
  353. :page-size="100"
  354. layout="total, sizes, prev, pager, next, jumper"
  355. :total=total>
  356. </el-pagination>
  357. </el-card>
  358. </div>
  359. <Add v-model="isList" v-if="!isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList"/>
  360. <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
  361. <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
  362. <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
  363. </div>
  364. </template>
  365. <script>
  366. import Add from './add.vue'
  367. import Refers from '@/components/Refers/refers.vue'
  368. import TreeRefers from '@/components/Refers/treeRefer.vue'
  369. import popDialog from '@/components/PopDialog/index.vue'
  370. import CollapseTransition from '@/components/MyCollapse/collapse.vue'
  371. import {getSummaryList, auditSummary, confirmSummary , cancelSummary , cancelAuditSummary, editSummaryList } from '@/api/purchase/DemandSummary.js'
  372. export default {
  373. name: 'demandSummary',
  374. dicts: ['sys_row_status', 'predictive_classify', 'sys_period_unit', 'sys_business', 'sys_bill_source'],
  375. components: {
  376. Add,
  377. CollapseTransition,
  378. Refers,
  379. TreeRefers,
  380. popDialog
  381. },
  382. data() {
  383. return {
  384. hangStatus(row) {
  385. switch (row.status) {
  386. case '0':
  387. return '需补货'
  388. case '1':
  389. return '待采购确认'
  390. case '2':
  391. return '采购已确认'
  392. case '3':
  393. return '采购已审核'
  394. case '4':
  395. return '行关闭'
  396. case '5':
  397. return '总供应可满足'
  398. }
  399. },
  400. formatterBusinessType(row) {
  401. switch (row.businessType) {
  402. case 'ZQBH':
  403. return '周期备货'
  404. case 'FXXQ':
  405. return '分销需求'
  406. case 'TSXQ':
  407. return '特殊采购需求'
  408. case 'BDXQ':
  409. return '补单需求'
  410. case 'JJXQ':
  411. return '紧急需求单'
  412. case 'XPXQ':
  413. return '新品需求'
  414. case 'HZBM':
  415. return '合作部门需求'
  416. }
  417. },
  418. isUpdate: false,
  419. expanded: false,
  420. // 页面配置
  421. isList: true,
  422. // 页面状态
  423. page: '',
  424. queryParams: {
  425. rowStatus: [],
  426. buyerName: '',
  427. materialName: '',
  428. manufacturer: '',
  429. forecastClassification: '',
  430. periodUnit: '',
  431. departmentName: '',
  432. puManagerAuditor: '',
  433. // zqgdh: '',
  434. code: '',
  435. registrant: '',
  436. businessType: '',
  437. billSource: '',
  438. customer: '',
  439. lastWarehouse: '',
  440. lastAllocation: '',
  441. materialCode: '',
  442. names: '',
  443. purchaseOrg: '',
  444. demandDate: '',
  445. auditTime: '',
  446. yesTime: '',
  447. pageNum: 1,
  448. pageSize: 5
  449. },
  450. personOptions: [],
  451. classOptions: [],
  452. deptOptions: [],
  453. auditOptions: [],
  454. customerOptions: [],
  455. lastWarehouseOptions: [],
  456. lastAllocationOptions: [],
  457. orgOptions: [],
  458. options: [{
  459. value: 'Y', label: '是',
  460. }, {
  461. value: 'N', label: '否'
  462. }],
  463. referCondition: {
  464. type: '',
  465. isPage: true,
  466. title: ''
  467. },
  468. tableList: [],
  469. total: 0,
  470. rowDetail: {},
  471. disable: false,
  472. lineDisable: true,
  473. ids: [],
  474. allSelection: [],
  475. // 子表index
  476. tableIndex: null,
  477. referConditionMx: {
  478. type: '',
  479. isPage: true,
  480. title: ''
  481. }
  482. }
  483. },
  484. created() {
  485. this.getList(this.queryParams)
  486. },
  487. methods: {
  488. // 搜索
  489. search() {
  490. this.getList(this.queryParams)
  491. },
  492. reset() {
  493. this.queryParams = {
  494. rowStatus: [],
  495. buyerName: '',
  496. materialName: '',
  497. manufacturer: '',
  498. forecastClassification: '',
  499. periodUnit: '',
  500. departmentName: '',
  501. puManagerAuditor: '',
  502. // zqgdh: '',
  503. code: '',
  504. registrant: '',
  505. businessType: '',
  506. billSource: '',
  507. customer: '',
  508. lastWarehouse: '',
  509. lastAllocation: '',
  510. materialCode: '',
  511. names: '',
  512. purchaseOrg: '',
  513. demandDate: '',
  514. auditTime: '',
  515. yesTime: '',
  516. pageNum: 1,
  517. pageSize: 5
  518. }
  519. this.getList(this.queryParams)
  520. },
  521. getList(params){
  522. getSummaryList(params).then(res => {
  523. if (res.code === 200) {
  524. this.tableList = res.rows
  525. this.total = res.total
  526. }
  527. })
  528. },
  529. handleSelectionChange(selection) {
  530. console.log('选中', selection)
  531. this.allSelection = selection
  532. this.ids = selection.map(item => item.demandItemId)
  533. console.log('选中数组', this.ids.join())
  534. },
  535. handleCommand(command) {
  536. alert(command)
  537. },
  538. check(row) {
  539. this.isList = false
  540. this.page = 'check'
  541. this.rowDetail = row
  542. this.disable = true
  543. },
  544. handleSizeChange(val) {
  545. console.log(`每页 ${val} 条`);
  546. this.queryParams.pageSize = val
  547. this.getList(this.queryParams)
  548. },
  549. handleCurrentChange(val) {
  550. console.log(`当前页: ${val}`);
  551. this.queryParams.pageNum = val
  552. this.getList(this.queryParams)
  553. },
  554. drop() {
  555. this.expanded = !this.expanded
  556. },
  557. editList() {
  558. console.log('Lists`````',this.tableList)
  559. this.lineDisable = false
  560. },
  561. saveList() {
  562. editSummaryList(this.tableList).then(res => {
  563. if (res.code === 200) {
  564. this.$modal.msgSuccess("保存成功");
  565. this.lineDisable = true
  566. this.getList(this.queryParams)
  567. }
  568. })
  569. },
  570. confirms() {
  571. if (this.ids.length == 0) {
  572. this.$modal.msgWarning("请选中至少一条数据");
  573. } else {
  574. confirmSummary(this.allSelection).then(res => {
  575. this.$modal.msgSuccess("确认成功");
  576. this.getList(this.queryParams)
  577. })
  578. }
  579. },
  580. cancels() {
  581. if (this.ids.length == 0) {
  582. this.$modal.msgWarning("请选中至少一条数据");
  583. } else {
  584. let param = this.ids.join()
  585. cancelSummary(param).then(res => {
  586. if (res.code === 200) {
  587. this.$modal.msgSuccess("取消成功");
  588. this.getList(this.queryParams)
  589. }
  590. })
  591. }
  592. },
  593. audits() {
  594. if(this.ids.length == 0) {
  595. this.$modal.msgWarning("请选中至少一条数据");
  596. } else {
  597. let param = this.ids.join()
  598. auditSummary(param).then(res => {
  599. if (res.code === 200) {
  600. this.$modal.msgSuccess("审核成功");
  601. this.getList(this.queryParams)
  602. }
  603. })
  604. }
  605. },
  606. cancelAudits() {
  607. if (this.ids.length == 0) {
  608. this.$modal.msgWarning("请选中至少一条数据");
  609. } else {
  610. let param = this.ids.join()
  611. cancelAuditSummary(param).then(res => {
  612. if (res.code === 200) {
  613. this.$modal.msgSuccess("操作成功");
  614. this.getList(this.queryParams)
  615. }
  616. })
  617. }
  618. },
  619. // 搜索区参照选择
  620. chooseRefer(type, isPage, title) {
  621. this.referCondition.type = type
  622. this.referCondition.isPage = isPage
  623. this.referCondition.title = title
  624. this.$refs.refer.init(this.referCondition)
  625. },
  626. selectionsToInput(selection) {
  627. if (this.referCondition.title == '采购员') {
  628. this.personOptions = selection
  629. this.queryParams.buyerName = selection[0].id
  630. }
  631. if (this.referCondition.title == '业务部门') {
  632. this.deptOptions = selection
  633. this.queryParams.departmentName = selection[0].id
  634. }
  635. if (this.referCondition.title == '审核人') {
  636. this.auditOptions = selection
  637. this.queryParams.puManagerAuditor = selection[0].id
  638. }
  639. if (this.referCondition.title == '需求客户') {
  640. this.customerOptions = selection
  641. this.queryParams.customer = selection[0].id
  642. }
  643. if (this.referCondition.title == '末级供应仓库') {
  644. this.lastWarehouseOptions = selection
  645. this.queryParams.lastWarehouse = selection[0].id
  646. }
  647. if (this.referCondition.title == '末级供应库位') {
  648. this.lastAllocationOptions = selection
  649. this.queryParams.lastAllocation = selection[0].id
  650. }
  651. if (this.referCondition.title == '默认采购组织') {
  652. this.orgOptions = selection
  653. this.queryParams.purchaseOrg = selection[0].id
  654. }
  655. if (this.referConditionMx.title == '采购员') {
  656. console.log('选择进了吗',this.tableList)
  657. this.tableList[this.tableIndex].buyer = selection[0].code
  658. this.tableList[this.tableIndex].buyerName = selection[0].name
  659. }
  660. if (this.referConditionMx.title == '默认采购组织') {
  661. console.log('选择进了吗',this.tableList)
  662. this.tableList[this.tableIndex].purchaseOrg = selection[0].id
  663. this.tableList[this.tableIndex].purchaseOrgName = selection[0].name
  664. }
  665. },
  666. // 搜索区树形选择
  667. chooseTreeRefer(type, isPage, title) {
  668. this.referCondition.type = type
  669. this.referCondition.isPage = isPage
  670. this.referCondition.title = title
  671. this.$refs.tree.init(this.referCondition)
  672. },
  673. selectionsToInput2(selection) {
  674. this.classOptions.push(selection)
  675. this.queryParams.materialName = selection.id
  676. },
  677. // 搜索区物料编码
  678. chooseMaterial() {
  679. this.$refs.materialRefer.init()
  680. },
  681. selectMaterial(selection) {
  682. this.queryParams.materialCode = selection[0].id
  683. this.queryParams.names = selection[0].name
  684. },
  685. // 明细行选择业务部门参照带出业务部门数据
  686. chooseSon(index, type, isPage, title) {
  687. this.tableIndex = index
  688. this.referConditionMx.type = type
  689. this.referConditionMx.isPage = isPage
  690. this.referConditionMx.title = title
  691. this.$refs.refer.init(this.referConditionMx)
  692. }
  693. }
  694. }
  695. </script>
  696. <style lang="scss" scoped>
  697. #demandSummary {
  698. height: calc(100vh - 84px);
  699. padding: 12px;
  700. box-sizing: border-box;
  701. overflow-y: scroll;
  702. }
  703. .btn_grooup {
  704. margin-bottom: 10px;
  705. display: flex;
  706. justify-content: flex-end;
  707. }
  708. .lines {
  709. margin-top: 0;
  710. }
  711. .hang {
  712. margin: auto;
  713. }
  714. .hang ::v-deep .el-form-item__content{
  715. margin-left: 0px !important;
  716. }
  717. </style>