purchaseContractAdd.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  1. <!--采购合同-->
  2. <!--2019年5月30日 20:25:16 by jlx-->
  3. <template>
  4. <div class="container">
  5. <el-row>
  6. <el-col :span="12">
  7. <h2 class="bg-left">创建采购合同</h2>
  8. </el-col>
  9. <el-col :span="12" class="bg-right">
  10. <el-button
  11. class="bg-bottom"
  12. type="primary"
  13. size="small"
  14. @click="returnsales()"
  15. >返回</el-button
  16. >
  17. </el-col>
  18. </el-row>
  19. <ws-form
  20. ref="deptBudgetList"
  21. :rules="mainReportAdd"
  22. :model="deptBudgetList"
  23. >
  24. <div class="remark">
  25. <h3>基本信息</h3>
  26. <p style="color: #8890b1">
  27. 注:基本信息和货物信息均为必填项,“*” 标记的条目提交后不可修改。
  28. </p>
  29. </div>
  30. <ws-info-table>
  31. <ws-form-item label="合同编号" span="1" prop="contractNo">
  32. <ws-input
  33. v-model="deptBudgetList.contractNo"
  34. maxlength="100"
  35. size="small"
  36. />
  37. <span class="unchangeable">*</span>
  38. </ws-form-item>
  39. <ws-form-item label="运输方式" span="1" prop="shippingType">
  40. <ws-input
  41. v-model="deptBudgetList.shippingType"
  42. maxlength="100"
  43. size="small"
  44. />
  45. </ws-form-item>
  46. <ws-form-item label="买方" span="1" prop="buyer">
  47. <ws-input
  48. v-model="deptBudgetList.buyer"
  49. maxlength="100"
  50. size="small"
  51. />
  52. </ws-form-item>
  53. <ws-form-item label="结算方式" span="1" prop="settlementMethod">
  54. <ws-input
  55. v-model="deptBudgetList.settlementMethod"
  56. maxlength="100"
  57. size="small"
  58. />
  59. </ws-form-item>
  60. <ws-form-item label="卖方" span="1" prop="seller">
  61. <ws-input
  62. v-model="deptBudgetList.seller"
  63. maxlength="100"
  64. size="small"
  65. />
  66. </ws-form-item>
  67. <ws-form-item label="货源地" span="1" prop="sourceGoods">
  68. <ws-input
  69. v-model="deptBudgetList.sourceGoods"
  70. maxlength="100"
  71. size="small"
  72. />
  73. </ws-form-item>
  74. <ws-form-item label="买方电话" span="1" prop="buyerPhone">
  75. <ws-input
  76. v-model="deptBudgetList.buyerPhone"
  77. maxlength="100"
  78. size="small"
  79. />
  80. </ws-form-item>
  81. <ws-form-item label="交货地" span="1" prop="placeDelivery">
  82. <ws-input
  83. v-model="deptBudgetList.placeDelivery"
  84. maxlength="100"
  85. size="small"
  86. />
  87. </ws-form-item>
  88. <ws-form-item label="卖方电话" span="1" prop="sellerPhone">
  89. <ws-input
  90. v-model="deptBudgetList.sellerPhone"
  91. maxlength="100"
  92. size="small"
  93. />
  94. </ws-form-item>
  95. <ws-form-item label="包装方式" span="1" prop="packingMethod">
  96. <ws-select
  97. v-model="deptBudgetList.packingMethod"
  98. placeholder=""
  99. class="typeselect"
  100. @change="selectpackingMethod"
  101. >
  102. <ws-option
  103. v-for="item in packtypeList"
  104. :key="item.constKey"
  105. :label="item.constValue"
  106. :value="item.constValue"
  107. />
  108. </ws-select>
  109. <span class="unchangeable">*</span>
  110. </ws-form-item>
  111. <!--运输方式-->
  112. <ws-form-item label="运输方式" span="1" prop="shippingType">
  113. <ws-input
  114. v-model="deptBudgetList.shippingType"
  115. placeholder="请输入运输方式"
  116. maxlength="20"
  117. size="small"
  118. />
  119. </ws-form-item>
  120. <!--买方-->
  121. <ws-form-item label="买方" span="1" prop="buyer">
  122. <ws-input
  123. v-model="deptBudgetList.buyer"
  124. placeholder="请输入买方名称"
  125. maxlength="100"
  126. size="small"
  127. />
  128. <span class="unchangeable">*</span>
  129. </ws-form-item>
  130. <!--结算方式-->
  131. <ws-form-item label="结算方式" span="1" prop="settlementMethod">
  132. <ws-input
  133. v-model="deptBudgetList.settlementMethod"
  134. placeholder="请输入结算方式"
  135. maxlength="100"
  136. size="small"
  137. />
  138. </ws-form-item>
  139. <!--卖方-->
  140. <ws-form-item label="卖方" span="1" prop="seller">
  141. <ws-input
  142. v-model="deptBudgetList.seller"
  143. placeholder="请输入卖方名称"
  144. maxlength="100"
  145. size="small"
  146. />
  147. <span class="unchangeable">*</span>
  148. </ws-form-item>
  149. <!--货源地-->
  150. <ws-form-item label="货源地" span="1" prop="sourceGoods">
  151. <ws-input
  152. v-model="deptBudgetList.sourceGoods"
  153. placeholder="请输入货源地"
  154. maxlength="100"
  155. size="small"
  156. />
  157. </ws-form-item>
  158. <!--买方电话-->
  159. <ws-form-item label="买方电话" span="1" prop="buyerPhone">
  160. <ws-input
  161. v-model="deptBudgetList.buyerPhone"
  162. placeholder="请输入买方电话"
  163. maxlength="100"
  164. size="small"
  165. />
  166. </ws-form-item>
  167. <!--交货地-->
  168. <ws-form-item label="交货地" span="1" prop="placeDelivery">
  169. <ws-input
  170. v-model="deptBudgetList.placeDelivery"
  171. placeholder="请输入交货地"
  172. maxlength="100"
  173. size="small"
  174. />
  175. </ws-form-item>
  176. <!--卖方电话-->
  177. <ws-form-item label="卖方电话" span="1" prop="sellerPhone">
  178. <ws-input
  179. v-model="deptBudgetList.sellerPhone"
  180. placeholder="请输入卖方电话"
  181. maxlength="100"
  182. size="small"
  183. />
  184. </ws-form-item>
  185. <!--包装方式-->
  186. <ws-form-item label="包装方式" span="1" prop="packingMethod">
  187. <ws-select
  188. v-model="deptBudgetList.packingMethod"
  189. placeholder=""
  190. class="typeselect"
  191. @change="selectpackingMethod"
  192. >
  193. <ws-option
  194. v-for="item in packtypeList"
  195. :key="item.constKey"
  196. :label="item.constValue"
  197. :value="item.constValue"
  198. />
  199. </ws-select>
  200. </ws-form-item>
  201. <!--重量(吨)-->
  202. <ws-form-item label="重量(吨)" span="1" prop="weight">
  203. <ws-input
  204. v-model="deptBudgetList.weight"
  205. placeholder="请输入重量(吨)"
  206. maxlength="100"
  207. size="small"
  208. />
  209. </ws-form-item>
  210. <!--验收方式-->
  211. <ws-form-item label="验收方式" span="1" prop="acceptanceMethod">
  212. <el-select
  213. v-model="deptBudgetList.acceptanceMethod"
  214. placeholder="请选择验收方式"
  215. style="width: 100%"
  216. filterable
  217. @change="selectunitList"
  218. >
  219. <el-option
  220. v-for="(item, index) in unitList"
  221. :key="item.constValue"
  222. :label="item.constValue"
  223. :value="item.constValue"
  224. >
  225. <span class="unit-left" style="float: left">
  226. <span v-if="item.flag == 'delete'">
  227. {{ item.constValue }}</span
  228. >
  229. <!-- 新增文本框 -->
  230. <div
  231. style="width: 160px"
  232. v-if="item.flag !== 'delete'"
  233. @click.stop
  234. >
  235. <ws-input
  236. v-model="item.constValue"
  237. clearable
  238. maxlength="10"
  239. style="width: 100%"
  240. ></ws-input>
  241. </div>
  242. </span>
  243. <span style="float: right; color: #8492a6; font-size: 13px">
  244. <!-- 对号 -->
  245. <i
  246. class="el-icon-check"
  247. style="line-height: 29px; margin-left: 10px"
  248. v-if="item.flag !== 'delete'"
  249. @click.stop="saveClick(item, index)"
  250. ></i>
  251. <!-- 编辑 -->
  252. <i
  253. class="el-icon-edit"
  254. style="line-height: 29px; margin-left: 10px"
  255. v-if="item.flag == 'delete'"
  256. @click.stop="editClick(item, index)"
  257. ></i>
  258. <!-- 删除 -->
  259. <i
  260. class="el-icon-delete"
  261. style="line-height: 29px"
  262. @click.stop="deleteClick(item, index)"
  263. ></i>
  264. </span>
  265. </el-option>
  266. <!-- 新增按钮 -->
  267. <el-option value="" label="">
  268. <div style="text-align: center">
  269. <ws-button type="primary" @click.stop="addClick">{{
  270. $t('button.add')
  271. }}</ws-button>
  272. </div>
  273. </el-option>
  274. </el-select>
  275. </ws-form-item>
  276. <!--溢短装(%)-->
  277. <ws-form-item label="溢短装(%)" span="1" prop="overShort">
  278. <ws-input
  279. v-model="deptBudgetList.overShort"
  280. placeholder="请输入溢短装比例(%)"
  281. maxlength="100"
  282. size="small"
  283. />
  284. </ws-form-item>
  285. <!--交货日期(起)-->
  286. <ws-form-item
  287. label="交货日期(起)"
  288. span="1"
  289. prop="deliveryDateStart"
  290. >
  291. <ws-date-picker
  292. :picker-options="pickerBeginDateBefore"
  293. v-model="deptBudgetList.deliveryDateStart"
  294. type="date"
  295. default-value="1980-01-01"
  296. placeholder="起始日期"
  297. format="yyyy-MM-dd"
  298. value-format="yyyy-MM-dd"
  299. />
  300. </ws-form-item>
  301. <!--合同单价(元/吨)-->
  302. <ws-form-item label="合同单价(元/吨)" span="1" prop="unitContractPrice">
  303. <ws-input
  304. v-model="deptBudgetList.unitContractPrice"
  305. placeholder="请输入合同单价"
  306. maxlength="100"
  307. size="small"
  308. />
  309. <span class="unchangeable">*</span>
  310. </ws-form-item>
  311. <!--交货日期(止)-->
  312. <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
  313. <ws-date-picker
  314. :picker-options="pickerBeginDateBefore"
  315. v-model="deptBudgetList.deliveryDateEnd"
  316. type="date"
  317. default-value="1980-01-01"
  318. placeholder="起始日期"
  319. format="yyyy-MM-dd"
  320. value-format="yyyy-MM-dd"
  321. />
  322. </ws-form-item>
  323. <!--合同总价-->
  324. <ws-form-item label="合同总价" span="1" prop="totalContractPrice">
  325. <ws-input
  326. v-model="deptBudgetList.totalContractPrice"
  327. placeholder="请输入合同总价"
  328. maxlength="100"
  329. size="small"
  330. />
  331. </ws-form-item>
  332. <!--签订日期-->
  333. <ws-form-item label="签订日期" span="1" prop="signingDate">
  334. <ws-date-picker
  335. :picker-options="pickerBeginDateBefore"
  336. v-model="deptBudgetList.signingDate"
  337. type="date"
  338. default-value="1980-01-01"
  339. placeholder="起始日期"
  340. format="yyyy-MM-dd"
  341. value-format="yyyy-MM-dd"
  342. />
  343. </ws-form-item>
  344. </ws-info-table>
  345. </ws-form>
  346. </div>
  347. </template>
  348. <script>
  349. // import { getVesselOne } from '@/model/procurement/basic'
  350. // import { dayjs } from 'base-core-lib'
  351. import {
  352. packList,
  353. addList,
  354. xiala,
  355. addxiala,
  356. editxiala,
  357. delxiala,
  358. } from '@/model/contarct/index'
  359. import WsUpload from '@/components/WsUpload'
  360. export default {
  361. name: 'viewSpareMoney',
  362. components: {
  363. WsUpload,
  364. },
  365. watch: {
  366. vesselId(val) {
  367. this.getVesselData()
  368. },
  369. isShow(val) {
  370. this.showType = val
  371. },
  372. },
  373. data() {
  374. return {
  375. //弹出框
  376. dialogViewSpareMoney: false,
  377. dialogApproveFormVisible: false,
  378. // 船舶类型
  379. monetaryKey: null,
  380. // 表格显示数据
  381. tableDate: [],
  382. // 是否显示
  383. showType: true,
  384. // 年
  385. year: '',
  386. // 提交类型
  387. submitType: true,
  388. tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
  389. packtypeList: [],
  390. compId: sessionStorage.getItem('ws-pf_compId'),
  391. mainReportAdd: {},
  392. appendixIdsAdd: '',
  393. size: 10,
  394. // uploadSuccess: {},
  395. // onChange:{},
  396. unitList: [],
  397. goodnameList: [],
  398. gradeList: [],
  399. ChapterTwoList: [],
  400. deptBudgetList: {
  401. contractGoodsInfo: {
  402. goodsName: '',
  403. },
  404. contractProcessInfo: {},
  405. },
  406. pickerBeginDateBefore: {
  407. disabledDate: (time) => {
  408. return time.getTime() > Date.now()
  409. },
  410. },
  411. // selectpackingMethod: {},
  412. // selectgrade: {},
  413. // selectunitList: {},
  414. // selectDuty: {},
  415. // isEdited: false,
  416. // registered: {},
  417. // selectCrtDuty: {},
  418. // dutyList: {},
  419. // sexList: {},
  420. ruleDeptBudget: {
  421. contractNo: [
  422. { required: true, message: '请输入活动名称', trigger: 'blur' },
  423. { min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
  424. ],
  425. },
  426. selectIntendedShip: {},
  427. interviewTypeList: {},
  428. }
  429. },
  430. activated() {
  431. //cg.viewBudget
  432. //cg.viewSpareMoney
  433. // this.getVesselData();
  434. this.loaddata()
  435. this.showType = this.isShow
  436. },
  437. methods: {
  438. // 关闭 dialog时 处理文件url 初始化upload组件
  439. handleClose() {
  440. this.dialogViewSpareMoney = false
  441. },
  442. returnsales() {
  443. this.$router.push({ path: 'purchaseContract' })
  444. },
  445. loaddata() {
  446. // 包装方式
  447. packList({ constId: 'CON1' })
  448. .toPromise()
  449. .then((response) => {
  450. this.packtypeList = response
  451. })
  452. // 验收方式
  453. this.getUnitList()
  454. // 货名
  455. packList({ constId: 'CON2' })
  456. .toPromise()
  457. .then((response) => {
  458. this.goodnameList = response
  459. })
  460. // 品级
  461. packList({ constId: 'CON3' })
  462. .toPromise()
  463. .then((response) => {
  464. this.gradeList = response
  465. })
  466. // 双章
  467. packList({ constId: 'CON4' })
  468. .toPromise()
  469. .then((response) => {
  470. this.ChapterTwoList = response
  471. })
  472. },
  473. // 上传附件
  474. uploadSuccess(data, files, url) {
  475. console.log(data, files, url)
  476. // this.deptBudgetList.
  477. // this.formData.append('files', files)
  478. // this.feedbackObj.uploadNameAttachment = data.appendixName
  479. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  480. // // this.newAppendixs = files
  481. // this.onChangeFlag = true
  482. },
  483. onChange(files) {
  484. this.fileNum = files
  485. this.$refs.upload.handleSaveBill().then((res) => {
  486. console.log(files)
  487. })
  488. },
  489. getUnitList() {
  490. xiala({
  491. compId: sessionStorage.getItem('ws-pf_compId'),
  492. constCode: 'TYPEYAN',
  493. })
  494. .toPromise()
  495. .then((response) => {
  496. this.unitList = response
  497. let currItem
  498. this.unitList.forEach((item, index, arr) => {
  499. item.flag = 'delete'
  500. if (this.vModel == item.constKey) {
  501. currItem = item
  502. }
  503. })
  504. //
  505. if (currItem) {
  506. this.selectContract(currItem.constValue)
  507. }
  508. })
  509. },
  510. submit() {
  511. if(!this.deptBudgetList.contractNo){
  512. this.$message({
  513. message: '请输入合同编号',
  514. type: 'warning'
  515. });
  516. return
  517. }
  518. if(!this.deptBudgetList.shippingType){
  519. this.$message({
  520. message:'请输入运输方式!',
  521. type:'warning'
  522. });
  523. return
  524. }
  525. if(!this. deptBudgetList.buyer){
  526. this.$message({
  527. message:'请输入买方名称!',
  528. type:'warning'
  529. });
  530. return
  531. }
  532. if(!this.deptBudgetList.seller){
  533. this.$message({
  534. message:'请输入卖方名称!',
  535. type:'warning'
  536. });
  537. return
  538. }
  539. if(!this.deptBudgetList.buyerPhone){
  540. this.$message({
  541. message:'请输入买方电话!',
  542. type:'warning'
  543. });
  544. return
  545. }
  546. if(isNaN(this.deptBudgetList.buyerPhone)){
  547. this.$message({
  548. message:'输入买方电话有误!',
  549. type:'warning'
  550. });
  551. return
  552. }
  553. if(!this.deptBudgetList.sellerPhone){
  554. this.$message({
  555. message:'请输入卖方电话!',
  556. type:'warning'
  557. });
  558. return
  559. }
  560. if(isNaN(this.deptBudgetList.sellerPhone)){
  561. this.$message({
  562. message:'输入卖方电话有误!',
  563. type:'warning'
  564. });
  565. return
  566. }
  567. if(!this. deptBudgetList.settlementMethod){
  568. this.$message({
  569. message:'请输入结算方式!',
  570. type:'warning'
  571. });
  572. return
  573. }
  574. if(!this.deptBudgetList.sourceGoods){
  575. this.$message({
  576. message:'请输入货源地!',
  577. type:'warning'
  578. });
  579. return
  580. }
  581. if(!this.deptBudgetList.placeDelivery){
  582. this.$message({
  583. message:'请输入交货地!',
  584. type:'warning'
  585. });
  586. return
  587. }
  588. if(!this.deptBudgetList.weight){
  589. this.$message({
  590. message:'请输入重量!',
  591. type:'warning'
  592. });
  593. return
  594. }
  595. if(isNaN(this.deptBudgetList.weight)){
  596. this.$message({
  597. message:'输入重量有误!',
  598. type:'warning'
  599. });
  600. return
  601. }
  602. if(!this.deptBudgetList.overShort && isNaN(this.deptBudgetList.overShort)){
  603. this.$message({
  604. message:'溢短装输入有误!',
  605. type:'warning'
  606. });
  607. return
  608. }
  609. if(!this.deptBudgetList.unitContractPrice && isNaN(this.deptBudgetList.unitContractPrice)){
  610. this.$message({
  611. message:'合同单价输入有误!',
  612. type:'warning'
  613. });
  614. return
  615. }
  616. if(!this.deptBudgetList.totalContractPrice && isNaN(this.deptBudgetList.totalContractPrice)){
  617. this.$message({
  618. message:'合同总价输入有误!',
  619. type:'warning'
  620. });
  621. return
  622. }
  623. //时间
  624. if(this.deptBudgetList.deliveryDateStart>this.deptBudgetList.deliveryDateEnd){
  625. this.$message({
  626. message:'时间输入有误!',
  627. type:'warning'
  628. });
  629. return
  630. }
  631. this.$refs.deptBudgetList.validate((valid) => {
  632. if (valid) {
  633. this.deptBudgetList.compId = this.compId
  634. this.deptBudgetList.contractType = 1
  635. addList(this.deptBudgetList)
  636. .toPromise()
  637. .then((response) => {
  638. this.$message.success('添加成功')
  639. this.$router.push({ path: 'salesContract' })
  640. })
  641. } else {
  642. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  643. return false
  644. }
  645. })
  646. },
  647. resetForm(deptBudgetList) {
  648. this.$refs[deptBudgetList].resetFields();
  649. },
  650. saveClick(item, index) {
  651. console.log(item)
  652. if (Object.is(item.id, 1)) {
  653. return
  654. }
  655. if (Object.is(this.unitList[index].flag, 'delete')) {
  656. this.$set(this.unitList, index, { flag: 'check' })
  657. } else {
  658. this.$set(this.unitList, index, { flag: 'delete' })
  659. }
  660. if (!item.constValue) {
  661. this.unitList.splice(index, 1)
  662. return
  663. }
  664. if (item.flag == 'add') {
  665. item.constKey = Math.random() * 20
  666. this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
  667. this.trainingMethods.constKey = item.constKey
  668. this.trainingMethods.constCode = 'TYPEYAN'
  669. this.trainingMethods.constValue = item.constValue
  670. this.trainingMethods.id = item.id
  671. addxiala(this.trainingMethods)
  672. .toPromise()
  673. .then((response) => {
  674. this.getUnitList()
  675. })
  676. } else if (item.flag == 'check') {
  677. this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
  678. this.trainingMethods.constKey = item.constKey
  679. this.trainingMethods.constCode = 'TYPEYAN'
  680. this.trainingMethods.constValue = item.constValue
  681. this.trainingMethods.id = item.id
  682. editxiala(this.trainingMethods)
  683. .toPromise()
  684. .then((response) => {
  685. this.getUnitList()
  686. })
  687. }
  688. },
  689. // selectContract(val) {
  690. // let key = this.unitList.find((item) => item.constValue === val).constKey
  691. // this.pleaseChoose = val
  692. // },
  693. handleExamine() {},
  694. approve() {},
  695. // returnsales() {
  696. // this.$router.push({ path: 'purchaseContract' })
  697. // },
  698. selectChapterTwo(e) {
  699. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  700. if (this.ChapterTwoList[i].constValue == e) {
  701. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  702. }
  703. }
  704. },
  705. selectunitList(e) {
  706. for (var i = 0; i < this.unitList.length; i++) {
  707. if (this.unitList[i].constValue == e) {
  708. this.deptBudgetList.packingMethodKey = this.unitList[i].constKey
  709. }
  710. }
  711. },
  712. selectgrade(e) {
  713. for (var i = 0; i < this.gradeList.length; i++) {
  714. if (this.gradeList[i].constValue == e) {
  715. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  716. }
  717. }
  718. },
  719. selectgoodsName(e) {
  720. for (var i = 0; i < this.goodnameList.length; i++) {
  721. if (this.goodnameList[i].constValue == e) {
  722. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  723. }
  724. }
  725. },
  726. selectpackingMethod(e) {
  727. for (var i = 0; i < this.packtypeList.length; i++) {
  728. if (this.packtypeList[i].constValue == e) {
  729. this.deptBudgetList.acceptanceMethodKey = this.packtypeList[
  730. i
  731. ].constKey
  732. }
  733. }
  734. },
  735. // 编辑
  736. editClick(item, index) {
  737. const map = JSON.parse(JSON.stringify(item))
  738. if (Object.is(item.id, 1)) {
  739. return
  740. }
  741. if (Object.is(this.unitList[index].flag, 'delete')) {
  742. map.flag = 'check'
  743. this.$set(this.unitList, index, map)
  744. } else {
  745. map.flag = 'delete'
  746. this.$set(this.unitList, index, map)
  747. }
  748. },
  749. // 删除
  750. deleteClick(item, index) {
  751. if (Object.is(item.constKey, 1)) {
  752. return
  753. }
  754. if (!item.constValue) {
  755. this.unitList.splice(index, 1)
  756. return
  757. }
  758. delxiala({ id: this.unitList[index].id })
  759. .toPromise()
  760. .then((response) => {
  761. this.getUnitList()
  762. this.pleaseChoose = ''
  763. })
  764. },
  765. },
  766. }
  767. </script>
  768. <style lang="scss" scoped>
  769. .button-container {
  770. display: flex;
  771. flex-wrap: nowrap;
  772. justify-content: space-between;
  773. align-items: center;
  774. background-color: #fff;
  775. width: 100%;
  776. height: 50px;
  777. padding: 0 10px;
  778. & > div {
  779. margin-left: 10px;
  780. display: flex;
  781. flex-wrap: nowrap;
  782. flex-direction: row;
  783. & > span {
  784. line-height: 50px;
  785. }
  786. }
  787. /deep/.auditFlow-box {
  788. position: unset;
  789. margin-left: 10px;
  790. &/deep/.auditFlow-icon {
  791. width: auto;
  792. padding-right: 30px;
  793. }
  794. &/deep/.auditFlow-main {
  795. position: absolute;
  796. }
  797. }
  798. .box-app {
  799. display: inline-block;
  800. float: left;
  801. margin-left: 30px;
  802. line-height: 50px;
  803. }
  804. /deep/.el-dialog {
  805. .el-form-item {
  806. margin-bottom: 0 !important;
  807. .el-input--medium {
  808. textarea {
  809. min-height: 100px !important;
  810. }
  811. }
  812. }
  813. }
  814. .collapse-bottom {
  815. margin-bottom: 20px;
  816. }
  817. .input-main .textarea .el-textarea__inner {
  818. width: 100%;
  819. z-index: 1;
  820. }
  821. .bg-left {
  822. padding-left: 30px;
  823. }
  824. .bg-right {
  825. padding-right: 10px;
  826. text-align: right;
  827. }
  828. .bg-bottom {
  829. margin: 20px 0px;
  830. }
  831. .wenzi {
  832. width: 900px;
  833. margin: 0 auto;
  834. }
  835. .wenzi h3 {
  836. display: inline-block;
  837. left: 10px;
  838. }
  839. .wenzi p {
  840. display: inline-block;
  841. }
  842. .center {
  843. width: 900px;
  844. margin: 0 auto;
  845. }
  846. .el-form-item {
  847. width: 50%;
  848. }
  849. .el-form-item__label {
  850. text-align: center;
  851. }
  852. .ce {
  853. width: 900px;
  854. margin: 0 auto;
  855. }
  856. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  857. /* height: 82px;*/
  858. /*}*/
  859. // 控制select为只读的时候显示样式
  860. .hide-sel {
  861. .el-input__inner {
  862. border: 0px;
  863. }
  864. .el-icon-arrow-up {
  865. display: none;
  866. }
  867. .el-textarea__inner {
  868. background-color: #fff !important;
  869. border: 0;
  870. }
  871. .el-date-editor {
  872. i {
  873. display: none;
  874. }
  875. }
  876. .is-disabled {
  877. .el-input__inner:hover {
  878. background-color: #fff !important;
  879. border: 0;
  880. }
  881. color: #606266;
  882. .el-input__inner {
  883. background-color: #fff !important;
  884. border: 0;
  885. color: #606266;
  886. }
  887. .el-textarea__inner {
  888. background-color: #fff !important;
  889. border: 0;
  890. color: #606266;
  891. }
  892. }
  893. }
  894. // 控制select为只读的时候显示样式
  895. /deep/.ws-class-table-col {
  896. height: auto;
  897. padding: 0px 2px;
  898. /deep/.el-input__inner {
  899. padding: 0px 2px;
  900. }
  901. }
  902. /deep/.is-disabled {
  903. .el-input__prefix,
  904. .el-input__suffix {
  905. display: none;
  906. }
  907. .el-input__inner {
  908. background-color: #fff;
  909. border-color: #fff !important;
  910. color: #000 !important;
  911. font-size: 14px;
  912. cursor: text;
  913. padding: 0 !important;
  914. }
  915. }
  916. .winseaview-view {
  917. padding: 10px 0 20px;
  918. }
  919. .container {
  920. overflow: scroll;
  921. height: 93vh;
  922. }
  923. .unchangeable {
  924. position: absolute;
  925. width: 9px;
  926. height: 22px;
  927. font-size: 16px;
  928. font-family: PingFangSC-Medium, PingFang SC;
  929. font-weight: 500;
  930. color: #ff2727;
  931. line-height: 22px;
  932. display: inline-block;
  933. right: 14px;
  934. }
  935. /deep/.el-input,
  936. /deep/.el-date-editor {
  937. font-size: 13px;
  938. width: 232px;
  939. left: 21px;
  940. }
  941. /deep/.el-textarea {
  942. width: 900px;
  943. margin: 0px;
  944. }
  945. /deep/el-date-editor--date {
  946. width: 200px;
  947. }
  948. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__labe{
  949. width: 130px;
  950. }
  951. }
  952. </style>