modifyDeliveryNotice.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <!-- 修改货权转移页面 -->
  3. <div class="shipTransport">
  4. <page-title>返回</page-title>
  5. <!-- 货权转移送达单位 -->
  6. <div class="mofrom">
  7. <span class="motext">货权转移送达单位</span>
  8. <el-input class="moinput" v-model="cargo" disabled> </el-input>
  9. <el-button class="mobutton" type="primary" @click="ondrawer(2)"
  10. >浏览</el-button
  11. >
  12. </div>
  13. <!--大品类 -->
  14. <div class="mofrom">
  15. <span class="motext">大品类</span>
  16. <el-input class="moinput" v-model="materialType" disabled> </el-input>
  17. <el-button class="mobutton" type="primary" @click="ondrawer(4)"
  18. >浏览</el-button
  19. >
  20. </div>
  21. <!-- 货权转移送达单位 -->
  22. <div class="mofrom">
  23. <span class="motext">收货人</span>
  24. <el-input class="moinput" v-model="receiver" disabled> </el-input>
  25. <el-button class="mobutton" type="primary" @click="ondrawer(3)"
  26. >浏览</el-button
  27. >
  28. </div>
  29. <!-- 批次 -->
  30. <div class="mofrom">
  31. <span class="motext">批次</span>
  32. <el-input class="moinput" v-model="batchId" disabled> </el-input>
  33. <el-button class="mobutton" type="primary" @click="ondrawer(5)"
  34. disabled>浏览</el-button
  35. >
  36. </div>
  37. <div class="form">
  38. <div class="form_box">
  39. <dil-form :formId="112" v-model="form1"></dil-form>
  40. </div>
  41. </div>
  42. <!-- 模态框 -->
  43. <el-drawer
  44. :visible.sync="drawer"
  45. :direction="direction"
  46. :before-close="handleClose"
  47. size="50%"
  48. >
  49. <el-input
  50. placeholder="请输入内容"
  51. v-model="input"
  52. style="margin-top: 10px; margin-left: 20px; width: 250px"
  53. clearable
  54. >
  55. </el-input>
  56. <el-button
  57. type="primary"
  58. class="btn"
  59. @click="onclick(a)"
  60. style="margin-bottom: 15px"
  61. >
  62. <i class="el-icon-search"></i>查询
  63. </el-button>
  64. <!-- <div v-show="a == 4">
  65. <dilTable v-bind.sync="options" @radio-change="currentRadioChange6"></dilTable>
  66. </div> -->
  67. <div v-show="a == 2">
  68. <dilTable
  69. v-bind.sync="second1"
  70. @radio-change="currentRadioChange2"
  71. ></dilTable>
  72. </div>
  73. <div v-show="a == 3">
  74. <dilTable
  75. v-bind.sync="second2"
  76. @radio-change="currentRadioChange3"
  77. ></dilTable>
  78. </div>
  79. <div v-show="a == 4">
  80. <dilTable
  81. v-bind.sync="second3"
  82. @radio-change="currentRadioChange4"
  83. ></dilTable>
  84. </div>
  85. <div v-show="a == 5">
  86. <dilTable
  87. v-bind.sync="second5"
  88. @radio-change="currentRadioChange5"
  89. ></dilTable>
  90. </div>
  91. </el-drawer>
  92. <el-form
  93. :inline="true"
  94. class="demo-form-inline"
  95. label-width="80px"
  96. style="margin-left: 450px; display: flex"
  97. >
  98. <el-form-item label="上传货权转移图片">
  99. <el-upload
  100. class="upload-demo"
  101. style="width: 270px"
  102. ref="upload1"
  103. action="/api/v1/rms/uploadCarrier1"
  104. :before-upload="beforeUpload"
  105. :multiple="false"
  106. list-type="picture"
  107. :show-file-list="false"
  108. :on-success="handleAvatarSuccess"
  109. :on-error="onError(1)"
  110. >
  111. <span class="span"></span>
  112. <el-input
  113. class="shippingCertificate"
  114. style="width: 270px; display: flex"
  115. placeholder="请选择货权转移图片(必填项,可支持重新上传)"
  116. v-model="shippingCertificate"
  117. disabled
  118. >
  119. </el-input>
  120. <el-button
  121. size="small"
  122. type="primary"
  123. style="
  124. width: 115px;
  125. height: 35px;
  126. margin-left: 275px;
  127. margin-top: -35px;
  128. display: flex;
  129. "
  130. @click="upCLick(1)"
  131. >
  132. 点击上传图片</el-button
  133. >
  134. </el-upload>
  135. </el-form-item>
  136. </el-form>
  137. <!-- 确定和取消 -->
  138. <div class="button_box">
  139. <el-button @click="onClickCancel">返回</el-button>
  140. <el-button type="primary" @click="onClickConfirm">确认</el-button>
  141. </div>
  142. </div>
  143. </template>
  144. <script>
  145. import PageTitle from "@/components/Page/Title";
  146. import { sjTime } from "@/utils/sharedJsFile";
  147. import { getCookie } from "@/utils/util.js";
  148. export default {
  149. components: { PageTitle },
  150. data() {
  151. return {
  152. form1: {},
  153. a: 1,
  154. cargoPictureUrl: "",
  155. shippingCertificate: "",
  156. materialName: "",
  157. materialType: "",
  158. foreignShipName:"",
  159. materialId: "",
  160. batchIds: "",
  161. cargo: "",
  162. disabled:null,
  163. receiver: "",
  164. input: "",
  165. drawer: false,
  166. direction: "rtl",
  167. second: {
  168. requestUrl: "/api/v1/uc/queryMaterialByLike?apiId=244",
  169. selectionType: "radio",
  170. mapList1: [],
  171. },
  172. second1: {
  173. requestUrl: "/api/v1/tms/selectShippeByName?apiId=215",
  174. selectionType: "radio",
  175. mapList2: [],
  176. },
  177. second2: {
  178. requestUrl: "/api/v1/tms/getGroupList?apiId=217",
  179. selectionType: "radio",
  180. mapList3: [],
  181. },
  182. second3: {
  183. requestUrl: "/api/v1/rms/getMaterialTypeList?apiId=376",
  184. selectionType: "radio",
  185. mapList4: [],
  186. },
  187. second5: {
  188. requestUrl: "/api/v1/tms/getBatchIdByForeign?apiId=489",
  189. selectionType: "radio",
  190. mapList5: [],
  191. },
  192. };
  193. },
  194. mounted() {
  195. this.information();
  196. },
  197. methods: {
  198. information() {
  199. this.axios
  200. .post("/api/v1/tms/selectByNoticeId/" + this.$route.params.noticeId)
  201. .then((res) => {
  202. res.data.data.forEach((e) => {
  203. console.log("aaa", e);
  204. this.form1 = e;
  205. this.batchId = e.foreignShipName + e.materialName;
  206. this.batchIds=e.batchId;
  207. this.foreignShipName=e.foreignShipName;
  208. this.materialId=e.materialId;
  209. // this.materialId = e.materialId;
  210. this.cargo = e.cargoName;
  211. this.cargoId = e.cargoId;
  212. this.shippingCertificate = e.cargoPictureUrl;
  213. this.cargoPictureUrl = e.cargoPictureUrl;
  214. this.receiver = e.reciveName;
  215. this.materialType = e.materialType;
  216. });
  217. });
  218. },
  219. handleClose(done) {
  220. done();
  221. },
  222. upCLick(val) {
  223. this.num = val;
  224. },
  225. beforeUpload(file) {
  226. this.upBool = true;
  227. const isLt2M = file.size < 1024 * 1024 * 0.5;
  228. if (!isLt2M) {
  229. this.$message.error("上传文件大小不能超过500kb!");
  230. } else {
  231. let size = file.size / 1024;
  232. let _URL = window.URL || window.webkitURL;
  233. let img = new Image();
  234. img.src = _URL.createObjectURL(file);
  235. }
  236. return isLt2M;
  237. },
  238. onError(err) {
  239. if (this.upBool) {
  240. if (this.num == 1) {
  241. this.shippingCertificate = null;
  242. this.cargoPictureUrl = null;
  243. // this.$message.error("上传失败");
  244. }
  245. }
  246. },
  247. handleAvatarSuccess(res, file) {
  248. // console.log("res",res.data)
  249. if (res.code) {
  250. this.upBool = false;
  251. if (this.num == 1) {
  252. this.cargoPictureUrl = res.data;
  253. this.shippingCertificate = file.name;
  254. }
  255. this.$message.success("上传成功");
  256. }
  257. },
  258. currentRadioChange() {
  259. console.log(1);
  260. },
  261. ondrawer(num) {
  262. this.drawer = true;
  263. this.a = num;
  264. // 清空当前输入框中的数据
  265. this.input = "";
  266. },
  267. // currentRadioChange1(selection) {
  268. // (this.second.mapList1 = selection),
  269. // (this.materialName = selection.materialName);
  270. // (this.materialId=selection.materialId);
  271. // },
  272. currentRadioChange2(selection) {
  273. (this.second1.mapList2 = selection), (this.cargo = selection.cargoName);
  274. },
  275. currentRadioChange3(selection) {
  276. (this.second2.mapList3 = selection), (this.receiver = selection.pierName);
  277. },
  278. currentRadioChange4(selection) {
  279. (this.second3.mapList4 = selection),
  280. (this.materialType = selection.materialTypeName);
  281. },
  282. currentRadioChange5(selection) {
  283. (this.second5.mapList5 = selection),
  284. (this.batchIds =
  285. selection.foreignShipName + "" + selection.materialName);
  286. (this.batchIds =
  287. selection.batchId);
  288. (this.foreignShipName =
  289. selection.foreignShipName);
  290. },
  291. onchange(val) {},
  292. onclick(a) {
  293. if (a == 2) {
  294. this.second1.requestUrl =
  295. "/api/v1/tms/selectShippeByName?apiId=215&con=" + this.input;
  296. } else if (a == 3) {
  297. this.second2.requestUrl =
  298. "/api/v1/tms/getGroupList?apiId=217&con=" + this.input;
  299. } else if (a == 4) {
  300. // console.log("aaaa");
  301. this.second3.requestUrl =
  302. "/api/v1/rms/getMaterialTypeList?apiId=376&con=" + this.input;
  303. }else if(a==5){
  304. this.second5.requestUrl =
  305. "/api/v1/tms/getBatchIdByForeign?apiId=489&con=" + this.input;
  306. }
  307. },
  308. // 确认
  309. onClickConfirm() {
  310. let map = {
  311. noticeId: this.$route.params.noticeId,
  312. carrierId: this.form1.carrierId,
  313. requesterGroupId: this.form1.requesterGroupId,
  314. noticeCommerceMethod: this.form1.noticeCommerceMethod,
  315. noticeHandoverMethod: this.form1.noticeHandoverMethod,
  316. portId: this.form1.portId,
  317. noticePortConstructionFee: this.form1.noticePortConstructionFee,
  318. noticeDeliveryTime: sjTime(this.form1.noticeDeliveryTime),
  319. noticePileFreeDays: this.form1.noticePileFreeDays,
  320. // batchId: this.batchId,
  321. purchaseContractUnitPrice: this.form1.purchaseContractUnitPrice,
  322. purchaseContractMoisture: this.form1.purchaseContractMoisture,
  323. //微元素含量
  324. tfeContent: this.form1.tfeContent,
  325. silicaContent: this.form1.silicaContent,
  326. aluminaContent: this.form1.aluminaContent,
  327. phosphorusContent: this.form1.phosphorusContent,
  328. manganeseContent: this.form1.manganeseContent,
  329. resultContactPerson: this.form1.resultContactPerson,
  330. resultTelephoneFax: this.form1.resultTelephoneFax,
  331. resultFreightForwardingInfo: this.form1.resultFreightForwardingInfo,
  332. resultMemo: this.form1.resultMemo,
  333. resultNumberOfLoans: this.form1.resultNumberOfLoans,
  334. cargoId: this.second1.mapList2.cargoId,
  335. groupId: this.second2.mapList3.id,
  336. inFactoryShipName: this.form1.inFactoryShipName,
  337. foreignShipName: this.foreignShipName,
  338. batchIds:this.batchIds,
  339. materialId: this.materialId,
  340. materialTypeId: this.second3.mapList4.materialTypeId,
  341. isNeedPortDisCharge: this.form1.isNeedPortDisCharge,
  342. isNeedPortFee: this.form1.isNeedPortFee,
  343. cargoPictureUrl: this.cargoPictureUrl,
  344. userId: getCookie("userId"),
  345. };
  346. // function isNumber() {
  347. // var value = AmsshipCargoTransferResult.resultTelephoneFax;
  348. // //验证是否为数字
  349. // var patrn = /^(-)?\d+(\.\d+)?$/;
  350. // if (patrn.exec(value) == null || value == "") {
  351. // return false;
  352. // } else {
  353. // return true;
  354. // }
  355. // }
  356. // var val = this.value;
  357. // if (
  358. // AmsshipCargoTransferResult.resultTelephoneFax==null||
  359. // AmsshipCargoTransferResult.resultContactPerson==null
  360. // ) this.$message.error("存在空值!");
  361. // else
  362. // if (!isNumber(val)) this.$message.error("联系电话必须是数字!");
  363. // else
  364. this.axios.post("/api/v1/tms/editDeliveryNotice", map).then((res) => {
  365. if (res.data.code == "200") {
  366. this.$message({
  367. type: "success",
  368. message: "修改成功!",
  369. });
  370. this.$router.go(-1);
  371. } else {
  372. this.$message.error("修改失败!!");
  373. }
  374. });
  375. },
  376. // 返回
  377. onClickCancel() {
  378. this.$router.go(-1);
  379. },
  380. },
  381. };
  382. </script>
  383. <style lang="scss">
  384. .shipTransport {
  385. .form {
  386. display: flex;
  387. .form_box {
  388. width: 320px;
  389. margin-left: 35%;
  390. margin-top: 30px;
  391. margin-right: 20px;
  392. .el-form {
  393. .preview-group {
  394. .el-form-item {
  395. .el-form-item__label {
  396. display: inline-block;
  397. width: 70px !important;
  398. }
  399. .el-form-item__content {
  400. .el-select {
  401. width: 250px;
  402. }
  403. .el-input {
  404. width: 250px;
  405. }
  406. }
  407. }
  408. }
  409. }
  410. }
  411. }
  412. .mofrom {
  413. display: flex;
  414. align-items: center;
  415. justify-content: center;
  416. margin-top: 5px;
  417. margin-right: 10px;
  418. .motext {
  419. width: 70px;
  420. }
  421. .moinput {
  422. width: 250px;
  423. }
  424. .mobutton {
  425. margin-left: 6px;
  426. }
  427. }
  428. .button_box {
  429. margin-left: 45%;
  430. }
  431. }
  432. </style>