modifyDeliveryNotice.vue 11 KB

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