index.vue 29 KB

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