other.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. <template>
  2. <div class="app-container">
  3. <el-radio-group v-model="formType" size="small" @change="changeType">
  4. <el-radio-button label="first">订单日期设置</el-radio-button>
  5. <el-radio-button label="second">工程登录二次引用设置</el-radio-button>
  6. <el-radio-button label="third">自动预留单生成</el-radio-button>
  7. <el-radio-button label="fourth">库存显示规则设置</el-radio-button>
  8. <el-radio-button label="fifth">二次打印密码设置</el-radio-button>
  9. <el-radio-button label="sixth">机型类别</el-radio-button>
  10. <el-radio-button label="seventh">登录类型</el-radio-button>
  11. <el-radio-button label="eigth">权限分类</el-radio-button>
  12. <el-radio-button v-if="$checkBtnRole('receipt', $route.meta.roles)" label="receipt">发票</el-radio-button>
  13. <el-radio-button label="warehouse">仓租费配置</el-radio-button>
  14. <el-radio-button label="radius">商用登录地图半径</el-radio-button>
  15. <!-- <el-radio-button label="forcedHold">强制仓</el-radio-button>-->
  16. </el-radio-group>
  17. <div v-show="formType === 'first'">
  18. <div style="margin: 40px 0 30px">
  19. <span>下单时间超过当天</span>
  20. <el-time-picker
  21. v-model="firstForm.input1.dictValue"
  22. placeholder="选择时间点"
  23. size="small"
  24. format="HH:mm"
  25. style="width: 150px; margin: 0 10px"
  26. />
  27. <span>的订单,订单日期计为下一天的日期</span>
  28. </div>
  29. <el-button type="primary" size="small" @click="submitForm('first')">确 定</el-button>
  30. </div>
  31. <div v-show="formType === 'second'">
  32. <div style="margin: 40px 0 30px">
  33. <div>工程登录二次引用密码设置</div>
  34. <div>
  35. <el-input
  36. v-model="secondForm.input1.dictValue"
  37. placeholder="请输入密码"
  38. size="small"
  39. style="width: 150px; margin-top: 20px"
  40. />
  41. </div>
  42. </div>
  43. <el-button type="primary" size="small" @click="submitForm('second')">确 定</el-button>
  44. </div>
  45. <div v-show="formType === 'third'">
  46. <div style="margin: 40px 0 30px">
  47. <h4>佛山自动预留配置</h4>
  48. <div>预留单自动生成时间,从订单审单后,第</div>
  49. <el-input
  50. v-model="thirdForm.input1.dictValue"
  51. type="number"
  52. size="small"
  53. style="width: 150px; margin-top: 20px; margin-right: 10px"
  54. @mousewheel.native.prevent
  55. />
  56. <span>天零时起,按商家提交订单时间顺序,自动生成预留单</span>
  57. </div>
  58. <div style="margin: 40px 0 30px">
  59. <h4>广州自动预留配置</h4>
  60. <div>预留单自动生成时间,从订单审单后,第</div>
  61. <el-input
  62. v-model="thirdForm.input2.dictValue"
  63. type="number"
  64. size="small"
  65. style="width: 150px; margin-top: 20px; margin-right: 10px"
  66. @mousewheel.native.prevent
  67. />
  68. <span>天零时起,按商家提交订单时间顺序,自动生成预留单</span>
  69. </div>
  70. <el-button type="primary" size="small" @click="submitForm('third')">确 定</el-button>
  71. </div>
  72. <div v-show="formType === 'fourth'">
  73. <div style="margin: 40px 0 30px">
  74. <div>总可发货数 = 总库存数-总预留数-总发货申请暂扣</div>
  75. <div style="margin-top: 20px">订单查询库存时:</div>
  76. <div style="margin-top: 10px">总可发货数为0,显示无货</div>
  77. <div style="margin-top: 10px">
  78. <span>总可发货数</span>
  79. <el-input
  80. v-model="fourthForm.input1.dictValue"
  81. type="number"
  82. size="small"
  83. style="width: 100px; margin: 0 10px"
  84. @mousewheel.native.prevent
  85. />
  86. <span>到</span>
  87. <el-input
  88. v-model="fourthForm.input2.dictValue"
  89. type="number"
  90. size="small"
  91. style="width: 100px; margin: 0 10px"
  92. @mousewheel.native.prevent
  93. />
  94. <span>,总库存显示具体数量</span>
  95. </div>
  96. <div style="margin-top: 10px">
  97. <span>总可发货数</span>
  98. <el-input
  99. v-model="fourthForm.input3.dictValue"
  100. type="number"
  101. size="small"
  102. style="width: 100px; margin: 0 10px"
  103. @mousewheel.native.prevent
  104. />
  105. <span>到</span>
  106. <el-input
  107. v-model="fourthForm.input4.dictValue"
  108. type="number"
  109. size="small"
  110. style="width: 100px; margin: 0 10px"
  111. @mousewheel.native.prevent
  112. />
  113. <span>,总库存显示有货</span>
  114. </div>
  115. <div style="margin-top: 10px">
  116. <span>总可发货数大于</span>
  117. <el-input
  118. v-model="fourthForm.input5.dictValue"
  119. type="number"
  120. size="small"
  121. style="width: 100px; margin: 0 10px"
  122. @mousewheel.native.prevent
  123. />
  124. <span>,总库存显示充足</span>
  125. </div>
  126. <div style="margin-top: 30px">发货申请查询库存时:</div>
  127. <div style="margin-top: 10px">
  128. <span>可发货数大于</span>
  129. <el-input
  130. v-model="fourthForm.input6.dictValue"
  131. type="number"
  132. size="small"
  133. style="width: 100px; margin: 0 10px"
  134. @mousewheel.native.prevent
  135. />
  136. <span>显示充足</span>
  137. </div>
  138. </div>
  139. <el-button type="primary" size="small" @click="submitForm('fourth')">确 定</el-button>
  140. </div>
  141. <div v-show="formType === 'fifth'">
  142. <div style="margin: 40px 0 30px">
  143. <div>二次打印密码设置</div>
  144. <div>
  145. <el-input
  146. v-model="fifthForm.input1.dictValue"
  147. placeholder="请输入密码"
  148. size="small"
  149. style="width: 150px; margin-top: 20px"
  150. />
  151. </div>
  152. </div>
  153. <el-button type="primary" size="small" @click="submitForm('fifth')">确 定</el-button>
  154. </div>
  155. <div v-show="formType === 'sixth'">
  156. <div style="margin: 40px 0 30px">
  157. <el-button type="primary" size="mini" @click="addShowFn">新增</el-button>
  158. <!-- 列表 -->
  159. <div class="mymain-container">
  160. <div class="table">
  161. <el-table
  162. v-loading="listLoading"
  163. :data="sixthForm"
  164. element-loading-text="Loading"
  165. border
  166. fit
  167. highlight-current-row
  168. stripe
  169. >
  170. <el-table-column
  171. align="left"
  172. label="名称"
  173. prop="dictCode"
  174. min-width="160"
  175. show-overflow-tooltip
  176. />
  177. <el-table-column
  178. align="left"
  179. label="备注"
  180. prop="remark"
  181. min-width="170"
  182. show-overflow-tooltip
  183. />
  184. <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
  185. <template slot-scope="scope">
  186. <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
  187. <el-popconfirm
  188. v-if="$checkBtnRole('del', $route.meta.roles)"
  189. title="这是一段内容确定删除吗?"
  190. @confirm="deleFn(scope.row.sysDictId)"
  191. >
  192. <el-button slot="reference" type="text" class="textColor">删除</el-button>
  193. </el-popconfirm>
  194. </template>
  195. </el-table-column>
  196. </el-table>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <div v-show="formType === 'seventh'">
  202. <div style="margin: 40px 0 30px">
  203. <el-button type="primary" size="mini" @click="addShowFn">新增</el-button>
  204. <!-- 列表 -->
  205. <div class="mymain-container">
  206. <div class="table">
  207. <el-table
  208. v-loading="listLoading"
  209. :data="seventhForm"
  210. element-loading-text="Loading"
  211. border
  212. fit
  213. highlight-current-row
  214. stripe
  215. >
  216. <el-table-column
  217. align="left"
  218. label="名称"
  219. prop="dictCode"
  220. min-width="160"
  221. show-overflow-tooltip
  222. />
  223. <el-table-column
  224. align="left"
  225. label="备注"
  226. prop="remark"
  227. min-width="170"
  228. show-overflow-tooltip
  229. />
  230. <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
  231. <template slot-scope="scope">
  232. <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
  233. <el-popconfirm
  234. v-if="$checkBtnRole('del', $route.meta.roles)"
  235. title="这是一段内容确定删除吗?"
  236. @confirm="deleFn(scope.row.sysDictId)"
  237. >
  238. <el-button slot="reference" type="text" class="textColor">删除</el-button>
  239. </el-popconfirm>
  240. </template>
  241. </el-table-column>
  242. </el-table>
  243. </div>
  244. </div>
  245. </div>
  246. </div>
  247. <div v-show="formType === 'eigth'">
  248. <div style="margin: 40px 0 30px">
  249. <el-button type="primary" size="mini" @click="addShowFn">新增</el-button>
  250. <!-- 列表 -->
  251. <div class="mymain-container">
  252. <div class="table">
  253. <el-table
  254. v-loading="listLoading"
  255. :data="eigthForm"
  256. element-loading-text="Loading"
  257. border
  258. fit
  259. highlight-current-row
  260. stripe
  261. >
  262. <el-table-column
  263. align="left"
  264. label="名称"
  265. prop="dictCode"
  266. min-width="160"
  267. show-overflow-tooltip
  268. />
  269. <el-table-column
  270. align="left"
  271. label="备注"
  272. prop="remark"
  273. min-width="170"
  274. show-overflow-tooltip
  275. />
  276. <el-table-column align="center" label="操作" prop="" min-width="160" show-overflow-tooltip fixed="right">
  277. <template slot-scope="scope">
  278. <el-button type="text" class="textColor" @click="editFn(scope.row)">编辑</el-button>
  279. <el-popconfirm
  280. v-if="$checkBtnRole('del', $route.meta.roles)"
  281. title="这是一段内容确定删除吗?"
  282. @confirm="deleFn(scope.row.sysDictId)"
  283. >
  284. <el-button slot="reference" type="text" class="textColor">删除</el-button>
  285. </el-popconfirm>
  286. </template>
  287. </el-table-column>
  288. </el-table>
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. <div v-show="formType === 'receipt'">
  294. <div style="margin: 40px 0 30px">
  295. <el-date-picker
  296. v-model="value1"
  297. size="mini"
  298. type="daterange"
  299. value-format="yyyy-MM-dd HH:mm:ss"
  300. range-separator="至"
  301. :picker-options="setDisabled"
  302. start-placeholder="开始日期"
  303. end-placeholder="结束日期"
  304. style="margin: 0 10px"
  305. />
  306. <el-button size="mini" type="warning" icon="el-icon-finished" @click="updateReceipt">更新发票</el-button>
  307. </div>
  308. </div>
  309. <div v-show="formType === 'warehouse'">
  310. <div style="margin: 40px 0 30px;">
  311. <span>总库存大于</span>
  312. <el-input
  313. v-model.number="stockCostDict.dictValue"
  314. type="number"
  315. style="width: 150px; margin: 0 10px"
  316. placeholder=""
  317. size="mini"
  318. />
  319. <span>才开始标记计算经销商订单相应机型仓租费用</span>
  320. </div>
  321. <el-button type="primary" size="small" @click="submitStockForm">确 定</el-button>
  322. </div>
  323. <div v-show="formType === 'radius'">
  324. <div style="margin: 40px 0 30px;">
  325. <span>商用工程登录信息的工程半径配置</span>
  326. <el-input
  327. v-model="radiusForm.input1.dictValue"
  328. style="width: 150px; margin: 0 10px"
  329. placeholder=""
  330. size="mini"
  331. />
  332. <span>公里</span>
  333. </div>
  334. <el-button type="primary" size="small" @click="submitForm('radius')">确 定</el-button>
  335. </div>
  336. <div v-show="formType === 'forcedHold'">
  337. <div style="margin: 40px 0 30px;">
  338. <el-form ref="form" :model="forcedHoldForm" label-width="50px" label-position="left">
  339. <el-row>
  340. <el-col>
  341. <el-form-item label="仓库">
  342. <el-select
  343. v-model="forcedHoldForm.warehouse"
  344. style="width: 50%"
  345. placeholder="请选择仓库"
  346. size="mini"
  347. @change="()=> this.forcedHoldForm.category = []"
  348. >
  349. <el-option
  350. v-for="item in warehouseList"
  351. :key="item.id"
  352. :label="item.name"
  353. :value="item.id"
  354. />
  355. </el-select>
  356. </el-form-item>
  357. </el-col>
  358. <el-col>
  359. <el-form-item label="品类">
  360. <el-checkbox-group v-model="forcedHoldForm.category">
  361. <el-checkbox v-for="item in categoryList" :key="item.id" :label="item.id">{{ item.name }}
  362. </el-checkbox>
  363. </el-checkbox-group>
  364. </el-form-item>
  365. </el-col>
  366. </el-row>
  367. </el-form>
  368. </div>
  369. <el-button type="primary" size="small" @click="submitForcedHold">确 定</el-button>
  370. <el-button
  371. size="small"
  372. @click="handleDel"
  373. >重置
  374. </el-button>
  375. </div>
  376. <!-- //弹窗 -->
  377. <el-dialog :title="title" :visible.sync="dialogForm" width="30%" :show-close="false" :close-on-click-modal="false">
  378. <el-form ref="addForm" size="mini" :rules="rules" :model="addForm" label-width="120px">
  379. <el-form-item label="名称" prop="dictCode">
  380. <el-input v-model="addForm.dictCode" />
  381. </el-form-item>
  382. <el-form-item label="备注" prop="remark">
  383. <el-input v-model="addForm.remark" />
  384. </el-form-item>
  385. </el-form>
  386. <div slot="footer" class="dialog-footer">
  387. <el-button size="mini" @click="cancelFn">取 消</el-button>
  388. <el-button size="mini" type="primary" @click="addDataFn">确 定</el-button>
  389. </div>
  390. </el-dialog>
  391. </div>
  392. </template>
  393. <script>
  394. import {
  395. getDictList,
  396. editDictList,
  397. addDictList,
  398. deleDictList,
  399. updateReceipt,
  400. getStockCostDict,
  401. updateStockCostDict, getStockForceDetail, updateStockForceDetail,
  402. delTockForceDetail
  403. } from '@/api/common'
  404. import { getKingDeeCategory } from '@/api/basic_data/material'
  405. import { getListStockV2 } from '@/api/basic_data/warehouse'
  406. export default {
  407. data() {
  408. return {
  409. listLoading: false, // 列表加载loading
  410. rules: {
  411. dictCode: [{ required: true, message: '请输入名称', trigger: 'blur' }]
  412. },
  413. addForm: {
  414. dictCode: '',
  415. remark: ''
  416. },
  417. dialogForm: false,
  418. title: '新增',
  419. formType: 'first',
  420. firstForm: {
  421. input1: {}
  422. },
  423. secondForm: {
  424. input1: {}
  425. },
  426. thirdForm: {
  427. input1: {},
  428. input2: {}
  429. },
  430. fourthForm: {
  431. input1: {},
  432. input2: {},
  433. input3: {},
  434. input4: {},
  435. input5: {},
  436. input6: {}
  437. },
  438. fifthForm: {
  439. input1: {}
  440. },
  441. radiusForm: {
  442. input1: {}
  443. },
  444. forcedHoldForm: {
  445. warehouse: '',
  446. category: []
  447. },
  448. stockCostDict: {},
  449. sixthForm: [],
  450. seventhForm: [],
  451. eigthForm: [],
  452. value1: '',
  453. choiceDate: '',
  454. setDisabled: {
  455. disabledDate: time => {
  456. if (this.choiceDate) {
  457. const res = 13 * 24 * 3600 * 1000
  458. const minTime = this.choiceDate - res
  459. const maxTime = this.choiceDate + res
  460. return time.getTime() < minTime || time.getTime() > maxTime
  461. }
  462. },
  463. onPick: ({ maxDate, minDate }) => {
  464. this.choiceDate = minDate.getTime()
  465. if (maxDate) this.choiceDate = ''
  466. }
  467. },
  468. categoryList: [],
  469. warehouseList: []
  470. }
  471. },
  472. created() {
  473. this.getDetail('first')
  474. },
  475. methods: {
  476. // 删除
  477. async deleFn(id) {
  478. await deleDictList({ id: id })
  479. this.$message.success('删除成功')
  480. this.getDetail(this.formType)
  481. },
  482. // 编辑
  483. editFn(value) {
  484. this.$nextTick(() => {
  485. this.title = '编辑'
  486. this.addForm.dictCode = value.dictCode
  487. this.addForm.remark = value.remark
  488. this.addForm.sysDictId = value.sysDictId
  489. this.addForm.dictType = value.dictType
  490. })
  491. this.dialogForm = true
  492. },
  493. // 弹窗确定
  494. async addDataFn() {
  495. // console.log(this.addForm);
  496. await this.$refs.addForm.validate()
  497. if (this.addForm.sysDictId) {
  498. // 编辑
  499. await editDictList([
  500. {
  501. ...this.addForm
  502. }
  503. ])
  504. this.$message.success('编辑成功')
  505. } else {
  506. let type = ''
  507. if (this.formType == 'sixth') {
  508. type = 'MACHINE_TYPE'
  509. } else if (this.formType == 'seventh') {
  510. type = 'SIGN_TYPE'
  511. } else {
  512. type = 'POWER_CATEGORY'
  513. }
  514. await addDictList({
  515. ...this.addForm,
  516. dictValue: this.addForm.dictCode,
  517. dictType: type
  518. })
  519. this.$message.success('新增成功')
  520. }
  521. this.getDetail(this.formType)
  522. this.addForm = {
  523. dictCode: '',
  524. remark: ''
  525. }
  526. this.dialogForm = false
  527. },
  528. // cancelFn 弹窗取消
  529. async cancelFn() {
  530. await this.$refs.addForm.resetFields()
  531. this.addForm = {
  532. dictCode: '',
  533. remark: ''
  534. }
  535. this.dialogForm = false
  536. // this.addForm.dictCode ='';
  537. },
  538. // 展示新增弹窗
  539. addShowFn() {
  540. this.title = '新增'
  541. this.dialogForm = true
  542. },
  543. // 查询按钮权限
  544. checkBtnRole(_value) {
  545. // let btnRole = this.$route.meta.roles;
  546. // if(!btnRole) {return true}
  547. // let index = btnRole.indexOf(value);
  548. // return index >= 0 ? true : false;
  549. return true
  550. },
  551. // 获取品类数据
  552. async getCategoryList() {
  553. const res = await getKingDeeCategory()
  554. this.categoryList = res.data
  555. },
  556. // 获取仓库列表
  557. getListStockV2() {
  558. getListStockV2({
  559. pageNum: 1,
  560. pageSize: -1
  561. }).then(res => {
  562. this.warehouseList = res.data.records
  563. })
  564. },
  565. getStockForceDetail() {
  566. getStockForceDetail().then(res => {
  567. this.forcedHoldForm = {
  568. warehouse: res.data?.stockCorrespondId || '',
  569. category: res.data?.stockForceCategories.map(k => k.categoryId) || []
  570. }
  571. })
  572. },
  573. changeType(val) {
  574. if (this.formType === 'receipt') return
  575. if (val === 'warehouse') {
  576. this.getStockCostDict()
  577. return
  578. }
  579. if (val === 'forcedHold') {
  580. this.getListStockV2()
  581. this.getCategoryList()
  582. this.getStockForceDetail()
  583. return
  584. }
  585. this.getDetail(val)
  586. },
  587. getStockCostDict() {
  588. getStockCostDict().then(res => {
  589. res.data.dictValue = +res.data.dictValue
  590. this.stockCostDict = res.data
  591. })
  592. },
  593. getDictList(e, type) {
  594. getDictList({ sysDictEnum: e }).then(res => {
  595. const data = res.data.map(item => {
  596. return {
  597. sysDictId: item.sysDictId,
  598. dictValue: item.dictValue,
  599. dictType: item.dictType,
  600. dictCode: item.dictCode
  601. }
  602. })
  603. if (type != 'fourth') {
  604. if (e === 'FO_SHAN_RESERVED_DAY') {
  605. this[type + 'Form'].input1 = data[0]
  606. return
  607. } else if (e === 'GUANG_ZHOU_RESERVED_DAY') {
  608. this[type + 'Form'].input2 = data[0]
  609. return
  610. }
  611. this[type + 'Form'].input1 = data[0]
  612. console.log(this[type + 'Form'].input1, 999)
  613. // this[type + "Form"].input2 = data[1];
  614. } else {
  615. this[type + 'Form'].input1 = data[0]
  616. this[type + 'Form'].input2 = data[1]
  617. this[type + 'Form'].input3 = data[2]
  618. this[type + 'Form'].input4 = data[3]
  619. this[type + 'Form'].input5 = data[4]
  620. this[type + 'Form'].input6 = data[5]
  621. }
  622. if (type == 'sixth') {
  623. this.sixthForm = res.data
  624. }
  625. if (type == 'seventh') {
  626. this.seventhForm = res.data
  627. }
  628. if (type == 'sixth') {
  629. this.sixthForm = res.data
  630. }
  631. if (type == 'seventh') {
  632. this.seventhForm = res.data
  633. }
  634. if (type == 'eigth') {
  635. this.eigthForm = res.data
  636. }
  637. })
  638. },
  639. getDetail(type) {
  640. const MAP = {
  641. first: 'ORDER_TIME_LIMIT',
  642. second: 'ENGIN_TWO_PWD',
  643. third: ['GUANG_ZHOU_RESERVED_DAY', 'FO_SHAN_RESERVED_DAY'],
  644. fourth: 'STOCK_ORDER',
  645. fifth: 'PRINT_PASSWORD',
  646. sixth: 'MACHINE_TYPE',
  647. seventh: 'SIGN_TYPE',
  648. eigth: 'POWER_CATEGORY',
  649. radius: 'MAP_ENGIN_RATE'
  650. }
  651. if (type === 'third') {
  652. MAP[type].forEach(e => {
  653. this.getDictList(e, type)
  654. })
  655. return
  656. }
  657. this.getDictList(MAP[type], type)
  658. },
  659. submitForm(type) {
  660. const list = []
  661. for (var key in this[type + 'Form']) {
  662. console.log(this[type + 'Form'], this[type + 'Form'][key].dictValue)
  663. if (!this[type + 'Form'][key].dictValue) {
  664. return this.$errorMsg('请完善信息')
  665. }
  666. list.push(this[type + 'Form'][key])
  667. }
  668. editDictList(list).then(_res => {
  669. this.$successMsg('保存成功')
  670. this.getDetail(type)
  671. })
  672. },
  673. updateReceipt() {
  674. if (!this.value1) {
  675. this.$errorMsg('请选择时间')
  676. return
  677. }
  678. updateReceipt({
  679. startTime: this.value1[0],
  680. endTime: this.value1[1]
  681. }).then(_res => {
  682. this.$successMsg('已更新')
  683. this.value1 = ''
  684. })
  685. },
  686. handleDel() {
  687. delTockForceDetail().then(res => {
  688. this.getStockForceDetail()
  689. this.$successMsg('重置成功')
  690. })
  691. },
  692. submitForcedHold() {
  693. if (!this.forcedHoldForm.warehouse) {
  694. this.$errorMsg('请选择仓库')
  695. return
  696. }
  697. if (!this.forcedHoldForm.category.length) {
  698. this.$errorMsg('请选择品类')
  699. return
  700. }
  701. const temp = this.warehouseList.find(k => k.id === this.forcedHoldForm.warehouse)
  702. const stockForceCategories = this.forcedHoldForm.category.map(k => {
  703. return {
  704. categoryId: k,
  705. correspondId: temp.id,
  706. correspondName: temp.name
  707. }
  708. })
  709. updateStockForceDetail({
  710. stockCorrespondId: temp.id,
  711. stockCorrespondName: temp.name,
  712. stockForceCategories
  713. }).then(_res => {
  714. this.getStockForceDetail()
  715. this.$successMsg('操作成功')
  716. })
  717. },
  718. submitStockForm() {
  719. if (!this.stockCostDict.dictValue) {
  720. this.$errorMsg('请输入总库存')
  721. return
  722. }
  723. updateStockCostDict({ dictValue: this.stockCostDict.dictValue }).then(_res => {
  724. this.getStockCostDict()
  725. this.$successMsg('已更新')
  726. })
  727. }
  728. }
  729. }
  730. </script>
  731. <style scoped lang="scss">
  732. .app-container {
  733. color: #333333;
  734. font-size: 14px;
  735. }
  736. </style>
  737. <style>
  738. .demo-table-expand {
  739. font-size: 0;
  740. }
  741. .demo-table-expand label {
  742. width: 80px;
  743. color: #99a9bf;
  744. }
  745. .demo-table-expand .el-form-item {
  746. margin-right: 0;
  747. margin-bottom: 0;
  748. width: 100%;
  749. }
  750. </style>