purchaseContractAdd.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  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. </ws-form-item>
  110. <ws-form-item label="重量(吨)" span="1" prop="weight">
  111. <ws-input
  112. v-model="deptBudgetList.weight"
  113. maxlength="100"
  114. size="small"
  115. />
  116. </ws-form-item>
  117. <ws-form-item label="验收方式" span="1" prop="acceptanceMethod">
  118. <el-select
  119. v-model="deptBudgetList.acceptanceMethod"
  120. placeholder="请选择验收方式"
  121. style="width: 100%"
  122. filterable
  123. @change="selectunitList"
  124. >
  125. <el-option
  126. v-for="(item, index) in unitList"
  127. :key="item.constValue"
  128. :label="item.constValue"
  129. :value="item.constValue"
  130. >
  131. <span class="unit-left" style="float: left">
  132. <span v-if="item.flag == 'delete'"> {{ item.constValue }}</span>
  133. <!-- 新增文本框 -->
  134. <div
  135. style="width: 160px"
  136. v-if="item.flag !== 'delete'"
  137. @click.stop
  138. >
  139. <ws-input
  140. v-model="item.constValue"
  141. clearable
  142. maxlength="10"
  143. style="width: 100%"
  144. ></ws-input>
  145. </div>
  146. </span>
  147. <span style="float: right; color: #8492a6; font-size: 13px">
  148. <!-- 对号 -->
  149. <i
  150. class="el-icon-check"
  151. style="line-height: 29px; margin-left: 10px"
  152. v-if="item.flag !== 'delete'"
  153. @click.stop="saveClick(item, index)"
  154. ></i>
  155. <!-- 编辑 -->
  156. <i
  157. class="el-icon-edit"
  158. style="line-height: 29px; margin-left: 10px"
  159. v-if="item.flag == 'delete'"
  160. @click.stop="editClick(item, index)"
  161. ></i>
  162. <!-- 删除 -->
  163. <i
  164. class="el-icon-delete"
  165. style="line-height: 29px"
  166. @click.stop="deleteClick(item, index)"
  167. ></i>
  168. </span>
  169. </el-option>
  170. <!-- 新增按钮 -->
  171. <el-option value="" label="">
  172. <div style="text-align: center">
  173. <ws-button type="primary" @click.stop="addClick">{{
  174. $t('button.add')
  175. }}</ws-button>
  176. </div>
  177. </el-option>
  178. </el-select>
  179. </ws-form-item>
  180. <ws-form-item label="溢短装(%)" span="1" prop="overShort">
  181. <ws-input
  182. v-model="deptBudgetList.overShort"
  183. maxlength="100"
  184. size="small"
  185. />
  186. </ws-form-item>
  187. <ws-form-item label="交货日期(起)" span="1" prop="deliveryDateStart">
  188. <ws-date-picker
  189. :picker-options="pickerBeginDateBefore"
  190. v-model="deptBudgetList.deliveryDateStart"
  191. type="date"
  192. default-value="1980-01-01"
  193. placeholder="交货日期(起)"
  194. format="yyyy-MM-dd"
  195. value-format="yyyy-MM-dd"
  196. />
  197. </ws-form-item>
  198. <ws-form-item
  199. label="合同单价(元/吨)"
  200. span="1"
  201. prop="unitContractPrice"
  202. >
  203. <ws-input
  204. v-model="deptBudgetList.unitContractPrice"
  205. maxlength="100"
  206. size="small"
  207. />
  208. </ws-form-item>
  209. <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
  210. <ws-date-picker
  211. :picker-options="pickerBeginDateBefore"
  212. v-model="deptBudgetList.deliveryDateEnd"
  213. type="date"
  214. default-value="1980-01-01"
  215. placeholder="交货日期(止)"
  216. format="yyyy-MM-dd"
  217. value-format="yyyy-MM-dd"
  218. />
  219. </ws-form-item>
  220. <ws-form-item label="合同总价(元)" span="1" prop="totalContractPrice">
  221. <ws-input
  222. v-model="deptBudgetList.totalContractPrice"
  223. maxlength="100"
  224. size="small"
  225. />
  226. </ws-form-item>
  227. <ws-form-item label="签订日期" span="1" prop="signingDate">
  228. <ws-date-picker
  229. :picker-options="pickerBeginDateBefore"
  230. v-model="deptBudgetList.signingDate"
  231. type="date"
  232. default-value="1980-01-01"
  233. placeholder="签订日期"
  234. format="yyyy-MM-dd"
  235. value-format="yyyy-MM-dd"
  236. />
  237. </ws-form-item>
  238. </ws-info-table>
  239. <!--面试信息-->
  240. <div class="remark">
  241. <h3>货物信息</h3>
  242. </div>
  243. <ws-info-table>
  244. <ws-form-item label="货名" span="1" prop="goodsName">
  245. <ws-select
  246. v-model="deptBudgetList.contractGoodsInfo.goodsName"
  247. placeholder=""
  248. class="typeselect"
  249. @change="selectgoodsName"
  250. >
  251. <ws-option
  252. v-for="item in goodnameList"
  253. :key="item.constKey"
  254. :label="item.constValue"
  255. :value="item.constValue"
  256. />
  257. </ws-select>
  258. </ws-form-item>
  259. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  260. <ws-input
  261. v-model="deptBudgetList.contractGoodsInfo.waterContent"
  262. maxlength="100"
  263. size="small"
  264. />
  265. </ws-form-item>
  266. <ws-form-item label="品级" span="1" prop="grade">
  267. <ws-select
  268. v-model="deptBudgetList.contractGoodsInfo.grade"
  269. placeholder=""
  270. class="typeselect"
  271. @change="selectgrade"
  272. >
  273. <ws-option
  274. v-for="item in gradeList"
  275. :key="item.constValue"
  276. :label="item.constValue"
  277. :value="item.constValue"
  278. />
  279. </ws-select>
  280. </ws-form-item>
  281. <ws-form-item label="杂质(%)<=" span="1" prop="interviewDates">
  282. <ws-input
  283. v-model="deptBudgetList.contractGoodsInfo.impurity"
  284. maxlength="100"
  285. size="small"
  286. />
  287. </ws-form-item>
  288. <ws-form-item label="容重(克/升)<=" span="1" prop="interviewType">
  289. <ws-input
  290. v-model="deptBudgetList.contractGoodsInfo.bulkDensity"
  291. maxlength="100"
  292. size="small"
  293. />
  294. </ws-form-item>
  295. <ws-form-item
  296. label="霉变粒(%)<="
  297. span="1"
  298. prop="mildewGrain"
  299. class="result"
  300. >
  301. <ws-input
  302. v-model="deptBudgetList.contractGoodsInfo.mildewGrain"
  303. maxlength="100"
  304. size="small"
  305. />
  306. </ws-form-item>
  307. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  308. <ws-input
  309. v-model="deptBudgetList.contractGoodsInfo.jiaorenli"
  310. maxlength="100"
  311. size="small"
  312. />
  313. </ws-form-item>
  314. <ws-form-item
  315. label="不完善粒(%)<="
  316. span="1"
  317. prop="imperfectGrain"
  318. class="result"
  319. >
  320. <ws-input
  321. v-model="deptBudgetList.contractGoodsInfo.imperfectGrain"
  322. maxlength="100"
  323. size="small"
  324. />
  325. </ws-form-item>
  326. </ws-info-table>
  327. <div class="remark">
  328. <h3>流程信息</h3>
  329. </div>
  330. <ws-info-table>
  331. <ws-form-item label="合同收入(元)" span="1" prop="goodsNameKey">
  332. <ws-input
  333. v-model="deptBudgetList.contractProcessInfo.goodsNameKey"
  334. maxlength="100"
  335. size="small"
  336. />
  337. </ws-form-item>
  338. <ws-form-item label="已开发票(元)" span="1" prop="goodsName">
  339. <ws-input
  340. v-model="deptBudgetList.contractProcessInfo.goodsName"
  341. maxlength="100"
  342. size="small"
  343. />
  344. </ws-form-item>
  345. <ws-form-item label="费用支出(元)" span="1" prop="waterContent">
  346. <ws-input
  347. v-model="deptBudgetList.contractProcessInfo.waterContent"
  348. maxlength="100"
  349. size="small"
  350. />
  351. </ws-form-item>
  352. <ws-form-item label="未开发票(元)" span="1" prop="impurity">
  353. <ws-input
  354. v-model="deptBudgetList.contractProcessInfo.impurity"
  355. maxlength="100"
  356. size="small"
  357. />
  358. </ws-form-item>
  359. <ws-form-item label="未回款(元)" span="1" prop="mildewGrain">
  360. <ws-input
  361. v-model="deptBudgetList.contractProcessInfo.mildewGrain"
  362. maxlength="100"
  363. size="small"
  364. />
  365. </ws-form-item>
  366. <ws-form-item
  367. label="已完成发运量(吨)"
  368. span="1"
  369. prop="Prettier"
  370. class="imperfectGrain"
  371. >
  372. <ws-input
  373. v-model="deptBudgetList.contractProcessInfo.imperfectGrain"
  374. maxlength="100"
  375. size="small"
  376. />
  377. </ws-form-item>
  378. <ws-form-item label="双章原件回收情况" span="1" prop="grade">
  379. <ws-select
  380. v-model="deptBudgetList.contractProcessInfo.grade"
  381. placeholder=""
  382. class="typeselect"
  383. @change="selectChapterTwo"
  384. >
  385. <ws-option
  386. v-for="item in ChapterTwoList"
  387. :key="item.constValue"
  388. :label="item.constValue"
  389. :value="item.constValue"
  390. />
  391. </ws-select>
  392. </ws-form-item>
  393. </ws-info-table>
  394. <div class="remark">
  395. <h3>备注信息</h3>
  396. </div>
  397. <ws-input
  398. v-model="deptBudgetList.remarks"
  399. type="textarea"
  400. row="3"
  401. placeholder="请输入备注信息,不超过200字"
  402. maxlength="200"
  403. />
  404. <ws-upload
  405. ref="upload"
  406. table-name="maintain_work_order"
  407. oss-key="mainPlan"
  408. :comp-id="compId"
  409. :appendix-ids="appendixIdsAdd"
  410. :vesselId="deptBudgetList.addressUrl"
  411. :size-limit="size"
  412. @uploadSuccess="uploadSuccess"
  413. @onChange="onChange"
  414. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
  415. />
  416. </ws-form>
  417. <div style="text-align: right; padding: 10px">
  418. <el-button class="bg-bottom" type="primary" size="small" @click="submit()"
  419. >提交</el-button
  420. >
  421. </div>
  422. </div>
  423. </template>
  424. <script>
  425. import { EventBus, dayjs } from 'base-core-lib'
  426. import {
  427. packList,
  428. addList,
  429. xiala,
  430. addxiala,
  431. editxiala,
  432. delxiala,
  433. } from '@/model/contarct/index'
  434. import WsUpload from '@/components/WsUpload'
  435. export default {
  436. name: 'viewSpareMoney',
  437. components: {
  438. WsUpload,
  439. },
  440. watch: {
  441. vesselId(val) {
  442. this.getVesselData()
  443. },
  444. isShow(val) {
  445. this.showType = val
  446. },
  447. $route(to, from) {
  448. this.loaddata()
  449. },
  450. },
  451. data() {
  452. return {
  453. //弹出框
  454. dialogViewSpareMoney: false,
  455. dialogApproveFormVisible: false,
  456. // 船舶类型
  457. monetaryKey: null,
  458. // 表格显示数据
  459. tableDate: [],
  460. // 是否显示
  461. showType: true,
  462. // 年
  463. year: '',
  464. size: 10,
  465. pleaseChoose: '',
  466. // 提交类型
  467. submitType: true,
  468. tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
  469. ruleDeptBudget: [],
  470. deptBudgetList: {
  471. contractGoodsInfo: {
  472. goodsName: '',
  473. },
  474. contractProcessInfo: {},
  475. },
  476. appendixIdsAdd: '',
  477. mainReportAdd: {
  478. contractNo: [
  479. { required: true, message: '请输入活动名称', trigger: 'blur' },
  480. { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' },
  481. ],
  482. },
  483. trainingMethods: {},
  484. pickerBeginDateBefore: {
  485. disabledDate: (time) => {
  486. return time.getTime() > Date.now()
  487. },
  488. },
  489. compId: sessionStorage.getItem('ws-pf_compId'),
  490. packtypeList: [],
  491. goodnameList: [],
  492. ChapterTwoList: [],
  493. unitList: [],
  494. gradeList: [],
  495. taskTypeList: [
  496. { value: '未完成(默认)' },
  497. { value: '已完成' },
  498. { value: '待回款' },
  499. { value: '全部合同' },
  500. ],
  501. }
  502. },
  503. activated() {
  504. //cg.viewBudget
  505. //cg.viewSpareMoney
  506. // this.getVesselData();
  507. this.loaddata()
  508. this.showType = this.isShow
  509. },
  510. methods: {
  511. // 关闭 dialog时 处理文件url 初始化upload组件
  512. handleClose() {
  513. this.dialogViewSpareMoney = false
  514. },
  515. loaddata() {
  516. // 包装方式
  517. packList({ constId: 'CON1' })
  518. .toPromise()
  519. .then((response) => {
  520. this.packtypeList = response
  521. })
  522. // 验收方式
  523. this.getUnitList()
  524. // 货名
  525. packList({ constId: 'CON2' })
  526. .toPromise()
  527. .then((response) => {
  528. this.goodnameList = response
  529. })
  530. // 品级
  531. packList({ constId: 'CON3' })
  532. .toPromise()
  533. .then((response) => {
  534. this.gradeList = response
  535. })
  536. // 双章
  537. packList({ constId: 'CON4' })
  538. .toPromise()
  539. .then((response) => {
  540. this.ChapterTwoList = response
  541. })
  542. },
  543. // 上传附件
  544. uploadSuccess(data, files, url) {
  545. console.log(data, files, url)
  546. // this.deptBudgetList.
  547. // this.formData.append('files', files)
  548. // this.feedbackObj.uploadNameAttachment = data.appendixName
  549. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  550. // // this.newAppendixs = files
  551. // this.onChangeFlag = true
  552. },
  553. onChange(files) {
  554. this.fileNum = files
  555. this.$refs.upload.handleSaveBill().then((res) => {
  556. console.log(files)
  557. })
  558. },
  559. submit() {
  560. this.$refs.deptBudgetList.validate((valid) => {
  561. if (valid) {
  562. this.deptBudgetList.compId = this.compId
  563. this.deptBudgetList.contractType = 2
  564. addList(this.deptBudgetList)
  565. .toPromise()
  566. .then((response) => {
  567. this.$message.success('添加成功')
  568. this.$router.push({ path: 'purchaseContract' })
  569. })
  570. } else {
  571. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  572. return false
  573. }
  574. })
  575. },
  576. getUnitList() {
  577. xiala({
  578. compId: sessionStorage.getItem('ws-pf_compId'),
  579. constCode: 'TYPEYAN',
  580. })
  581. .toPromise()
  582. .then((response) => {
  583. this.unitList = response
  584. let currItem
  585. this.unitList.forEach((item, index, arr) => {
  586. item.flag = 'delete'
  587. if (this.vModel == item.constKey) {
  588. currItem = item
  589. }
  590. })
  591. //
  592. if (currItem) {
  593. this.selectContract(currItem.constValue)
  594. }
  595. })
  596. },
  597. selectContract(val) {
  598. let key = this.unitList.find((item) => item.constValue === val).constKey
  599. this.pleaseChoose = val
  600. },
  601. handleExamine() {},
  602. approve() {},
  603. returnsales() {
  604. this.$router.push({ path: 'purchaseContract' })
  605. },
  606. selectChapterTwo(e) {
  607. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  608. if (this.ChapterTwoList[i].constValue == e) {
  609. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  610. }
  611. }
  612. },
  613. selectunitList(e) {
  614. for (var i = 0; i < this.unitList.length; i++) {
  615. if (this.unitList[i].constValue == e) {
  616. this.deptBudgetList.packingMethodKey = this.unitList[i].constKey
  617. }
  618. }
  619. },
  620. selectgrade(e) {
  621. for (var i = 0; i < this.gradeList.length; i++) {
  622. if (this.gradeList[i].constValue == e) {
  623. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  624. }
  625. }
  626. },
  627. selectgoodsName(e) {
  628. for (var i = 0; i < this.goodnameList.length; i++) {
  629. if (this.goodnameList[i].constValue == e) {
  630. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  631. }
  632. }
  633. },
  634. selectpackingMethod(e) {
  635. for (var i = 0; i < this.packtypeList.length; i++) {
  636. if (this.packtypeList[i].constValue == e) {
  637. this.deptBudgetList.acceptanceMethodKey = this.packtypeList[
  638. i
  639. ].constKey
  640. }
  641. }
  642. },
  643. addClick() {
  644. this.unitList.push({
  645. flag: 'add',
  646. constValue: '',
  647. constKey: '',
  648. })
  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. // 编辑
  690. editClick(item, index) {
  691. const map = JSON.parse(JSON.stringify(item))
  692. if (Object.is(item.id, 1)) {
  693. return
  694. }
  695. if (Object.is(this.unitList[index].flag, 'delete')) {
  696. map.flag = 'check'
  697. this.$set(this.unitList, index, map)
  698. } else {
  699. map.flag = 'delete'
  700. this.$set(this.unitList, index, map)
  701. }
  702. },
  703. // 删除
  704. deleteClick(item, index) {
  705. if (Object.is(item.constKey, 1)) {
  706. return
  707. }
  708. if (!item.constValue) {
  709. this.unitList.splice(index, 1)
  710. return
  711. }
  712. delxiala({ id: this.unitList[index].id })
  713. .toPromise()
  714. .then((response) => {
  715. this.getUnitList()
  716. this.pleaseChoose = ''
  717. })
  718. },
  719. },
  720. }
  721. </script>
  722. <style lang="scss" scoped>
  723. /deep/.ws-info-table .el-form-item .el-form-item__label {
  724. width: 140px;
  725. text-align: center;
  726. }
  727. .ws-upload {
  728. margin-top: 20px;
  729. }
  730. .el-form {
  731. padding: 0 20%;
  732. }
  733. .el-form-item {
  734. width: 50%;
  735. }
  736. .unchangeable {
  737. color: #1d6ced;
  738. }
  739. .button-container {
  740. display: flex;
  741. flex-wrap: nowrap;
  742. justify-content: space-between;
  743. align-items: center;
  744. background-color: #fff;
  745. width: 100%;
  746. height: 50px;
  747. padding: 0 10px;
  748. & > div {
  749. margin-left: 10px;
  750. display: flex;
  751. flex-wrap: nowrap;
  752. flex-direction: row;
  753. & > span {
  754. line-height: 50px;
  755. }
  756. }
  757. /deep/.auditFlow-box {
  758. position: unset;
  759. margin-left: 10px;
  760. &/deep/.auditFlow-icon {
  761. width: auto;
  762. padding-right: 30px;
  763. }
  764. &/deep/.auditFlow-main {
  765. position: absolute;
  766. }
  767. }
  768. }
  769. .box-app {
  770. display: inline-block;
  771. float: left;
  772. margin-left: 30px;
  773. line-height: 50px;
  774. }
  775. /deep/.el-dialog {
  776. .el-form-item {
  777. margin-bottom: 0 !important;
  778. .el-input--medium {
  779. textarea {
  780. min-height: 100px !important;
  781. }
  782. }
  783. }
  784. }
  785. .collapse-bottom {
  786. margin-bottom: 20px;
  787. }
  788. .input-main .textarea .el-textarea__inner {
  789. width: 100%;
  790. z-index: 1;
  791. }
  792. .collapse-bottom {
  793. margin-bottom: 20px;
  794. }
  795. .input-main .textarea .el-textarea__inner {
  796. width: 100%;
  797. z-index: 1;
  798. }
  799. .bg-left {
  800. padding-left: 10px;
  801. }
  802. .bg-right {
  803. padding-right: 10px;
  804. text-align: right;
  805. }
  806. .bg-bottom {
  807. margin: 20px 0px;
  808. }
  809. .remark h3 {
  810. display: inline-block;
  811. margin-right: 20px;
  812. }
  813. .remark p {
  814. display: inline-block;
  815. }
  816. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  817. /* height: 82px;*/
  818. /*}*/
  819. // 控制select为只读的时候显示样式
  820. .hide-sel {
  821. .el-input__inner {
  822. border: 0px;
  823. }
  824. .el-icon-arrow-up {
  825. display: none;
  826. }
  827. .el-textarea__inner {
  828. background-color: #fff !important;
  829. border: 0;
  830. }
  831. .el-date-editor {
  832. i {
  833. display: none;
  834. }
  835. }
  836. .is-disabled {
  837. .el-input__inner:hover {
  838. background-color: #fff !important;
  839. border: 0;
  840. }
  841. color: #606266;
  842. .el-input__inner {
  843. background-color: #fff !important;
  844. border: 0;
  845. color: #606266;
  846. }
  847. .el-textarea__inner {
  848. background-color: #fff !important;
  849. border: 0;
  850. color: #606266;
  851. }
  852. }
  853. }
  854. // 控制select为只读的时候显示样式
  855. /deep/.ws-class-table-col {
  856. height: auto;
  857. padding: 0px 2px;
  858. /deep/.el-input__inner {
  859. padding: 0px 2px;
  860. }
  861. }
  862. /deep/.is-disabled {
  863. .el-input__prefix,
  864. .el-input__suffix {
  865. display: none;
  866. }
  867. .el-input__inner {
  868. background-color: #fff;
  869. border-color: #fff !important;
  870. color: #000 !important;
  871. font-size: 14px;
  872. cursor: text;
  873. padding: 0 !important;
  874. }
  875. }
  876. .winseaview-view {
  877. padding: 10px 0 20px;
  878. }
  879. .container {
  880. overflow: scroll;
  881. height: 93vh;
  882. }
  883. </style>