apply_form.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header @back="goBack" :content="listItem ? '编辑-发货申请' : '新增-发货申请'"></el-page-header>
  4. <div class="main-title">
  5. <div class="title">发货申请单信息</div>
  6. </div>
  7. <div style="font-size: 12px; color: #333; margin-bottom: 20px">
  8. 注:发货申请时,库存数量为实时数量,请选择完成选择后及时保存提交,否则数量可能有变,被其他商家开单而导致库存不足。
  9. </div>
  10. <el-form
  11. ref="mainForm"
  12. :model="mainForm"
  13. :rules="mainFormRules"
  14. label-width="90px"
  15. size="small"
  16. label-position="right"
  17. >
  18. <el-row :gutter="20">
  19. <el-col :xs="24" :sm="12" :lg="8">
  20. <el-form-item label="订单号" prop="orderNum">
  21. <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" disabled></el-input>
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :lg="8" style="height: 51px">
  25. <el-form-item label="单据日期" prop="date">
  26. <el-date-picker
  27. v-model="mainForm.date"
  28. disabled
  29. type="date"
  30. value-format="yyyy-MM-dd"
  31. style="width: 100%"
  32. placeholder="系统自动生成"
  33. >
  34. </el-date-picker>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :xs="24" :sm="12" :lg="8">
  38. <el-form-item label="制单人" prop="createMan">
  39. <el-input v-model="mainForm.createMan" disabled></el-input>
  40. </el-form-item>
  41. </el-col>
  42. <el-col :xs="24" :sm="12" :lg="8">
  43. <el-form-item label="经销商编号" prop="jxsNum">
  44. <el-input v-model="mainForm.jxsNum" disabled></el-input>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :xs="24" :sm="12" :lg="16">
  48. <el-form-item label="经销商名称" prop="jxsName">
  49. <el-input v-model="mainForm.jxsName" disabled></el-input>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :xs="24" :sm="24" :lg="24">
  53. <el-form-item label="备注" prop="headerRemark">
  54. <el-input v-model="mainForm.headerRemark" placeholder="请输入备注"></el-input>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="8" :lg="8">
  58. <el-form-item label="附件" prop="fileUrl">
  59. <fileUpload :fileList="fileList" multiple/>
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. </el-form>
  64. <div class="main-title">
  65. <div class="title">货品信息</div>
  66. <div>
  67. <!-- <span style="font-size: 14px; margin-right: 10px">仓库</span>
  68. <el-select v-model="screenForm.warehouse" placeholder="请选择发货仓库" size="small" filterable clearable :disabled="goodsList.length > 0">
  69. <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
  70. </el-select>
  71. <el-divider direction="vertical"></el-divider> -->
  72. <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
  73. </div>
  74. </div>
  75. <div class="table" style="margin-top: 20px">
  76. <el-table
  77. :data="goodsList"
  78. element-loading-text="Loading"
  79. border
  80. fit
  81. highlight-current-row
  82. stripe
  83. max-height="400"
  84. >
  85. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  86. <el-table-column
  87. align="center"
  88. label="引用单号"
  89. prop="mainOrderId"
  90. min-width="180"
  91. show-overflow-tooltip
  92. ></el-table-column>
  93. <el-table-column
  94. align="center"
  95. label="销售类型"
  96. prop="saleTypeName"
  97. min-width="100"
  98. show-overflow-tooltip
  99. ></el-table-column>
  100. <el-table-column
  101. align="center"
  102. label="物料编码"
  103. prop="materialCode"
  104. min-width="120"
  105. show-overflow-tooltip
  106. ></el-table-column>
  107. <el-table-column
  108. align="center"
  109. label="产品编码"
  110. prop="materialOldNumber"
  111. min-width="120"
  112. show-overflow-tooltip
  113. ></el-table-column>
  114. <el-table-column
  115. align="center"
  116. label="产品名称"
  117. prop="materialName"
  118. min-width="160"
  119. show-overflow-tooltip
  120. ></el-table-column>
  121. <el-table-column
  122. align="center"
  123. label="规格型号"
  124. prop="specification"
  125. min-width="160"
  126. show-overflow-tooltip
  127. ></el-table-column>
  128. <el-table-column
  129. align="center"
  130. label="单位"
  131. prop="unit"
  132. min-width="100"
  133. show-overflow-tooltip
  134. ></el-table-column>
  135. <el-table-column align="center" label="数量" prop="qty" min-width="80" show-overflow-tooltip></el-table-column>
  136. <el-table-column align="center" label="申请数量" prop="invoiceNum" min-width="110" show-overflow-tooltip>
  137. <template slot-scope="scope">
  138. <el-input v-model="scope.row.invoiceNum" size="small"></el-input>
  139. </template>
  140. </el-table-column>
  141. <el-table-column
  142. align="center"
  143. label="已申请数量"
  144. prop="alreadyInvoiceNum"
  145. min-width="100"
  146. show-overflow-tooltip
  147. ></el-table-column>
  148. <el-table-column align="center" label="未申请数量" prop="canApply" min-width="100" show-overflow-tooltip>
  149. </el-table-column>
  150. <el-table-column align="left" label="表头备注" prop="headerRemark" min-width="160" show-overflow-tooltip>
  151. <template slot-scope="scope">
  152. <el-input v-model="scope.row.headerRemark" size="small" :disabled="isDealer"></el-input>
  153. </template>
  154. </el-table-column>
  155. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip>
  156. <template slot-scope="scope">
  157. <el-input v-model="scope.row.invoiceRemark" size="small" :disabled="isDealer"></el-input>
  158. </template>
  159. </el-table-column>
  160. <el-table-column align="center" label="操作" width="100" fixed="right">
  161. <template slot-scope="scope">
  162. <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
  163. </template>
  164. </el-table-column>
  165. </el-table>
  166. </div>
  167. <div class="page-footer">
  168. <div class="footer">
  169. <!-- <el-button type="primary" @click="clickSubmitForm('SAVE')">保 存</el-button> -->
  170. <el-button type="primary" @click="clickSubmitForm('WAIT')">提交审核</el-button>
  171. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px">
  172. <el-button slot="reference">返回列表</el-button>
  173. </el-popconfirm>
  174. </div>
  175. </div>
  176. <el-dialog title="添加引用" :visible.sync="isShowDialog" width="80%">
  177. <el-form ref="screenForm" :model="screenForm" size="small" label-position="left" label-width="70px">
  178. <el-row :gutter="20">
  179. <el-col :xs="12" :sm="6" :lg="6">
  180. <el-form-item prop="warehouse" label="选择仓库">
  181. <el-select
  182. v-model="screenForm.warehouse"
  183. placeholder="请选择仓库"
  184. size="small"
  185. filterable
  186. clearable
  187. :disabled="goodsList.length > 0"
  188. style="width: 100%"
  189. >
  190. <el-option
  191. :label="item.name"
  192. :value="item.id"
  193. v-for="(item, index) in warehouseList"
  194. :key="index"
  195. ></el-option>
  196. </el-select>
  197. </el-form-item>
  198. </el-col>
  199. <el-col :xs="12" :sm="6" :lg="6">
  200. <el-form-item prop="type" label="存货类别">
  201. <el-select
  202. v-model="screenForm.type"
  203. placeholder="选择存货类别"
  204. style="width: 100%"
  205. clearable
  206. :disabled="goodsList.length > 0"
  207. >
  208. <el-option
  209. v-for="item in categoryList"
  210. :key="item.name"
  211. :label="item.name"
  212. :value="item.name"
  213. ></el-option>
  214. </el-select>
  215. </el-form-item>
  216. </el-col>
  217. <!-- <el-col :xs="12" :sm="6" :lg="6">
  218. <el-form-item prop="type" label="产品大类">
  219. <el-select v-model="screenForm.type" placeholder="选择产品大类" style="width: 100%" :disabled="goodsList.length > 0 || tableSelection.length > 0">
  220. <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
  221. </el-select>
  222. </el-form-item>
  223. </el-col> -->
  224. <el-col :xs="12" :sm="6" :lg="6">
  225. <el-form-item prop="orderNum" label="订单号">
  226. <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
  227. </el-form-item>
  228. </el-col>
  229. <el-col :xs="12" :sm="6" :lg="6">
  230. <el-form-item label="规格型号" prop="model">
  231. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  232. </el-form-item>
  233. </el-col>
  234. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  235. <el-form-item label="">
  236. <el-button size="small" @click="resetScreenForm">清空</el-button>
  237. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. </el-form>
  242. <div class="table">
  243. <el-table
  244. :data="tableGoodsList"
  245. element-loading-text="Loading"
  246. border
  247. fit
  248. highlight-current-row
  249. stripe
  250. height="400"
  251. >
  252. <el-table-column align="center" label="新旧单标识" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  253. <template slot-scope="scope">
  254. {{ scope.row.orderBase == 1 ? '新单' : '旧单' }}
  255. </template>
  256. </el-table-column>
  257. <el-table-column
  258. align="center"
  259. label="订单号"
  260. prop="mainOrderId"
  261. min-width="140"
  262. show-overflow-tooltip
  263. ></el-table-column>
  264. <el-table-column
  265. align="center"
  266. label="销售类型"
  267. prop="saleTypeName"
  268. min-width="100"
  269. show-overflow-tooltip
  270. ></el-table-column>
  271. <el-table-column
  272. align="center"
  273. label="存货类别"
  274. prop="categoryName"
  275. min-width="100"
  276. show-overflow-tooltip
  277. ></el-table-column>
  278. <el-table-column
  279. align="center"
  280. label="产品名称"
  281. prop="materialName"
  282. min-width="160"
  283. show-overflow-tooltip
  284. ></el-table-column>
  285. <el-table-column
  286. align="center"
  287. label="规格型号"
  288. prop="specification"
  289. min-width="160"
  290. show-overflow-tooltip
  291. ></el-table-column>
  292. <el-table-column
  293. align="center"
  294. label="单位"
  295. prop="unit"
  296. min-width="80"
  297. show-overflow-tooltip
  298. ></el-table-column>
  299. <el-table-column
  300. align="center"
  301. label="数量"
  302. prop="qty"
  303. min-width="80"
  304. show-overflow-tooltip
  305. ></el-table-column>
  306. <el-table-column
  307. align="center"
  308. label="未申请数量"
  309. prop="canApply"
  310. min-width="100"
  311. show-overflow-tooltip
  312. ></el-table-column>
  313. <el-table-column
  314. align="center"
  315. label="已申请数量"
  316. prop="alreadyInvoiceNum"
  317. min-width="100"
  318. show-overflow-tooltip
  319. ></el-table-column>
  320. <el-table-column align="center" label="本次申请数量" prop="invoiceNum" min-width="110" show-overflow-tooltip>
  321. <template slot-scope="scope">
  322. <el-input
  323. v-model="scope.row.invoiceNum"
  324. size="small"
  325. type="number"
  326. @mousewheel.native.prevent
  327. :disabled="scope.row.selected"
  328. ></el-input>
  329. </template>
  330. </el-table-column>
  331. <el-table-column
  332. align="center"
  333. label="对应库存数量"
  334. prop="stockCorrespond"
  335. min-width="110"
  336. show-overflow-tooltip
  337. >
  338. <template slot-scope="scope">
  339. {{ stockFilter(scope.row, 2) }}
  340. </template>
  341. </el-table-column>
  342. <el-table-column
  343. align="center"
  344. label="已申请未出货数量"
  345. prop="sendQty"
  346. min-width="100"
  347. show-overflow-tooltip
  348. ></el-table-column>
  349. <!-- <el-table-column align="center" label="总库存数量" prop="stockAdequate" min-width="100" show-overflow-tooltip>
  350. <template slot-scope="scope">
  351. {{stockFilter(scope.row, 1)}}
  352. </template>
  353. </el-table-column> -->
  354. </el-table>
  355. <div class="pagination clearfix" style="margin-top: 10px">
  356. <div class="fr">
  357. <el-pagination
  358. @current-change="handleTableCurrentChange"
  359. :current-page="currentPage"
  360. :page-size="10"
  361. background
  362. layout="prev, pager, next"
  363. :total="listTotal"
  364. >
  365. </el-pagination>
  366. </div>
  367. </div>
  368. </div>
  369. <span slot="footer" class="dialog-footer">
  370. <el-button @click="closeDialog">取 消</el-button>
  371. <el-button type="primary" @click="submitAddGoods">确 定</el-button>
  372. </span>
  373. </el-dialog>
  374. </div>
  375. </template>
  376. <script>
  377. import { getApplyDetail, addApply, editApply, getGoodsList, getWarehouseList, getDealerList } from '@/api/supply/apply'
  378. import { getDictList, getCategoryList } from '@/api/common'
  379. import { findElem } from '@/utils/util'
  380. import fileUpload from '@/components/Common/file-upload.vue'
  381. export default {
  382. components: {
  383. fileUpload
  384. },
  385. name: 'ApplyForm',
  386. componentName: 'ApplyForm',
  387. props: ['listItem'],
  388. data() {
  389. return {
  390. mainForm: {
  391. orderNum: '',
  392. date: '',
  393. jxsNum: '',
  394. jxsName: '',
  395. headerRemark: '',
  396. createMan: ''
  397. },
  398. mainFormRules: {
  399. // date: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
  400. },
  401. dealerList: [],
  402. fileList: [],
  403. goodsList: [],
  404. warehouseList: [],
  405. isShowDialog: false,
  406. screenForm: {
  407. warehouse: '',
  408. type: '',
  409. orderNum: '',
  410. model: ''
  411. },
  412. currentPage: 1,
  413. listTotal: 0,
  414. // typeList: [],
  415. stockList: [],
  416. categoryList: [],
  417. tableGoodsList: []
  418. }
  419. },
  420. computed: {
  421. isDealer() {
  422. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  423. }
  424. },
  425. created() {
  426. this.getDictList()
  427. this.getWarehouseList()
  428. this.getDealerList()
  429. this.getCategoryList()
  430. if (this.listItem) {
  431. this.getDetail()
  432. } else {
  433. this.mainForm.jxsNum = JSON.parse(localStorage.getItem('supply_user')).customerNumber
  434. this.mainForm.jxsName = JSON.parse(localStorage.getItem('supply_user')).customerName
  435. this.mainForm.createMan = JSON.parse(localStorage.getItem('supply_user')).nickName
  436. }
  437. },
  438. methods: {
  439. // 返回列表
  440. goBack() {
  441. this.$emit('backListFormDetail')
  442. },
  443. // 获取详情
  444. getDetail() {
  445. getApplyDetail({ id: this.listItem.id }).then(res => {
  446. let data = res.data
  447. this.mainForm.orderNum = data.id
  448. this.mainForm.date = data.orderTime
  449. this.mainForm.jxsNum = data.customerNumber
  450. this.mainForm.jxsName = data.customerName
  451. this.mainForm.createMan = data.createBy
  452. this.mainForm.headerRemark = data.headerRemark
  453. this.mainForm.remark = data.remark
  454. this.screenForm.warehouse = data.correspondId
  455. this.fileList = data.salesOrderPictures
  456. // data.orders.forEach(item => {
  457. // item.orderId = item.id;
  458. // })
  459. this.goodsList = data.orders
  460. // this.screenForm.type = data.mainId;
  461. })
  462. },
  463. // 获取仓库列表
  464. getWarehouseList() {
  465. getWarehouseList({
  466. pageNum: 1,
  467. pageSize: -1
  468. }).then(res => {
  469. this.warehouseList = res.data.records
  470. })
  471. },
  472. getDictList() {
  473. getDictList({ sysDictEnum: 'STOCK_ORDER' }).then(res => {
  474. this.stockList = res.data
  475. })
  476. },
  477. // 获取经销商列表
  478. getDealerList() {
  479. getDealerList({
  480. pageNum: 1,
  481. pageSize: -1,
  482. bindUser: false
  483. }).then(res => {
  484. this.dealerList = res.data.records
  485. })
  486. },
  487. // 获取存货类别列表
  488. getCategoryList() {
  489. getCategoryList({
  490. pageNum: 1,
  491. pageSize: -1
  492. }).then(res => {
  493. this.categoryList = res.data.records
  494. })
  495. },
  496. // 库存字段
  497. stockFilter(item, type) {
  498. let STOCK_ORDER_INVOICE = this.stockList.find(o => o.dictCode == 'STOCK_ORDER_INVOICE').dictValue
  499. if (type === 1) {
  500. return item.stockAdequate > STOCK_ORDER_INVOICE ? '充足' : item.stockAdequate
  501. }
  502. if (type === 2) {
  503. if (item.stockCorrespond <= 0) {
  504. return '无货'
  505. } else if (item.stockCorrespond >= 1 && item.stockCorrespond <= 30) {
  506. return item.stockCorrespond
  507. } else if (item.stockCorrespond >= 31 && item.stockCorrespond <= 1000) {
  508. return '有货'
  509. } else {
  510. return '充足'
  511. }
  512. // return item.stockCorrespond > STOCK_ORDER_INVOICE ? '充足' : item.stockCorrespond;
  513. }
  514. },
  515. // 获取商品列表
  516. getGoodsList() {
  517. getGoodsList({
  518. pageNum: this.currentPage,
  519. pageSize: 10,
  520. correspondId: this.screenForm.warehouse,
  521. categoryName: this.screenForm.type,
  522. id: this.screenForm.orderNum,
  523. specification: this.screenForm.model
  524. }).then(res => {
  525. let oldGoodsList = this.goodsList
  526. let newGoodsList = res.data.records
  527. for (let i = 0; i < oldGoodsList.length; i++) {
  528. let oldItem = oldGoodsList[i]
  529. for (let j = 0; j < newGoodsList.length; j++) {
  530. let newItem = newGoodsList[j]
  531. if (newItem.orderId === oldItem.orderId) {
  532. newGoodsList[j].selected = true
  533. newGoodsList[j].invoiceNum = oldGoodsList[i].invoiceNum
  534. break
  535. }
  536. }
  537. }
  538. this.tableGoodsList = newGoodsList
  539. this.listTotal = res.data.total
  540. })
  541. },
  542. // 查询重复值并禁选
  543. checkboxSelect(row, rowIndex) {
  544. if (row.selected) {
  545. return false // 禁用
  546. } else {
  547. return true // 不禁用
  548. }
  549. },
  550. // 点击 选择商品
  551. openDialog() {
  552. this.isShowDialog = true
  553. if (this.screenForm.warehouse) {
  554. this.getGoodsList()
  555. }
  556. },
  557. // 提交筛选表单
  558. submitScreenForm() {
  559. if (!this.screenForm.warehouse) {
  560. return this.$errorMsg('请选择仓库')
  561. }
  562. if (!this.screenForm.type) {
  563. return this.$errorMsg('请选择存货类别')
  564. }
  565. this.currentPage = 1
  566. this.getGoodsList()
  567. },
  568. // 重置筛选表单
  569. resetScreenForm() {
  570. this.$refs.screenForm.resetFields()
  571. this.currentPage = 1
  572. this.tableGoodsList = []
  573. // this.getGoodsList();
  574. },
  575. // 更改列表当前页
  576. handleTableCurrentChange(val) {
  577. this.currentPage = val
  578. this.getGoodsList()
  579. },
  580. // 关闭 弹窗
  581. closeDialog() {
  582. this.isShowDialog = false
  583. },
  584. // 确定 添加产品
  585. submitAddGoods() {
  586. let tableSelection = []
  587. this.tableGoodsList.forEach(item => {
  588. if ((item.invoiceNum || item.invoiceNum === 0) && !item.selected) {
  589. tableSelection.push(item)
  590. }
  591. })
  592. for (let i = 0; i < tableSelection.length; i++) {
  593. for (let j = i + 1; j < tableSelection.length; j++) {
  594. if (tableSelection[i].orderBase !== tableSelection[j].orderBase) {
  595. return this.$errorMsg('只能选择新单或旧单')
  596. }
  597. }
  598. if (tableSelection[i].invoiceNum < 1) {
  599. this.$errorMsg('申请数量要大于0')
  600. return
  601. }
  602. // if(tableSelection[i].invoiceNum > tableSelection[i].canApply) {
  603. // this.$errorMsg('申请数量不能大于未申请数量');
  604. // return;
  605. // }
  606. }
  607. this.isShowDialog = false
  608. this.tableGoodsList = []
  609. this.goodsList = this.goodsList.concat(tableSelection)
  610. },
  611. // 删除产品
  612. deleteItem(index) {
  613. this.goodsList.splice(index, 1)
  614. },
  615. // 保存
  616. clickSubmitForm(status) {
  617. this.$refs.mainForm.validate(valid => {
  618. if (valid) {
  619. if (this.goodsList.length < 1) {
  620. return this.$errorMsg('请添加引用')
  621. }
  622. for (let i = 0; i < this.goodsList.length; i++) {
  623. if (!Number(this.goodsList[i].invoiceNum)) {
  624. this.$errorMsg('请输入申请数量')
  625. return
  626. }
  627. // if(this.goodsList[i].invoiceNum > this.goodsList[i].canApply) {
  628. // this.$errorMsg('申请数量不能大于未申请数量');
  629. // return;
  630. // }
  631. }
  632. if (!this.screenForm.warehouse) {
  633. return this.$errorMsg('请选择仓库')
  634. }
  635. const salesOrderPictures = []
  636. if (this.fileList.length) {
  637. this.fileList.forEach(k => {
  638. salesOrderPictures.push({
  639. fileName: k.name,
  640. fileUrl: k.url,
  641. salesId: this.goodsList[0].id
  642. })
  643. })
  644. }
  645. let correspondName = this.warehouseList[findElem(this.warehouseList, 'id', this.screenForm.warehouse)].name
  646. let params = {
  647. id: this.listItem ? this.listItem.id : '',
  648. headerRemark: this.mainForm.headerRemark,
  649. remark: this.mainForm.headerRemark,
  650. fileUrl: this.fileList && this.fileList.length > 0 ? this.fileList[0].url : '',
  651. fileName: this.fileList && this.fileList.length > 0 ? this.fileList[0].name : '',
  652. // orderType: 1, // 1零售单 2家用工程 3商用工程
  653. correspondId: this.screenForm.warehouse,
  654. correspondName,
  655. orders: this.goodsList,
  656. examineStatus: status,
  657. salesOrderPictures
  658. }
  659. if (this.listItem) {
  660. editApply(params).then(res => {
  661. this.$successMsg('编辑成功')
  662. this.goBack()
  663. this.$parent.getList()
  664. })
  665. } else {
  666. addApply(params).then(res => {
  667. this.$successMsg('添加成功')
  668. this.goBack()
  669. this.$parent.getList()
  670. })
  671. }
  672. }
  673. })
  674. }
  675. }
  676. }
  677. </script>
  678. <style scoped lang="scss">
  679. .detail-container {
  680. width: 100%;
  681. height: 100%;
  682. }
  683. .main-title {
  684. display: flex;
  685. justify-content: space-between;
  686. align-items: center;
  687. margin-top: 20px;
  688. height: 60px;
  689. border-bottom: 1px solid #dcdfe6;
  690. margin-bottom: 20px;
  691. .title {
  692. font-size: 16px;
  693. font-weight: 600;
  694. padding-left: 10px;
  695. }
  696. }
  697. </style>