updateBill.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. // 采购内转需求
  2. <template>
  3. <div class="admin">
  4. <template>
  5. <div class="admin1">
  6. <el-tabs v-model="activeName">
  7. <el-tab-pane label="修改提货单" name="first">
  8. <div class="admin2">
  9. <div class="carrier from">
  10. <el-form
  11. :inline="true"
  12. class="demo-form-inline"
  13. label-width="80px"
  14. >
  15. <el-form-item label="车牌号:">
  16. <el-autocomplete
  17. class="inline-input"
  18. v-model="capacityName"
  19. :fetch-suggestions="querySearchCapacity"
  20. placeholder="车牌号"
  21. :trigger-on-focus="false"
  22. @select="handleSelectCapacity"
  23. >
  24. <template slot-scope="{ item }">
  25. <div class="name">{{ item.capacityNumber }}</div>
  26. </template>
  27. </el-autocomplete>
  28. </el-form-item>
  29. </el-form>
  30. </div>
  31. <div></div>
  32. <div class="poundNo from">
  33. <span class="text">运输订单号:</span>
  34. <el-select v-model="orderId" placeholder="请选择" @change="changeOrderNo">
  35. <el-option
  36. v-for="item in orderList"
  37. :key="item.orderId"
  38. :label="item.orderNumber"
  39. :value="item.orderId"
  40. >
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <div class="material from">
  45. <span class="text">物资:</span>
  46. <el-select v-model="materialId" placeholder="请选择" @change="changeMaterial">
  47. <el-option
  48. v-for="item in materialList"
  49. :key="item.materialId"
  50. :label="item.materialName"
  51. :value="item.materialId"
  52. >
  53. </el-option>
  54. </el-select>
  55. </div>
  56. <div class="material from">
  57. <span class="text">物资件数:</span>
  58. <el-input v-model="materialNum" ></el-input>
  59. </div>
  60. <div class="material from">
  61. <span class="text">发货单位:</span>
  62. <el-input v-model="shipperName" disabled></el-input>
  63. </div>
  64. <div class="material from">
  65. <span class="text">收货单位:</span>
  66. <el-input v-model="consigneeCompanyName" disabled></el-input>
  67. </div>
  68. <div class="material from">
  69. <span class="text">收货地址:</span>
  70. <el-input v-model="receiveAddressName" disabled></el-input>
  71. </div>
  72. <div class="material from">
  73. <span class="text">截止日期:</span>
  74. <el-input v-model="saleDateOfReceipt" disabled></el-input>
  75. </div>
  76. </div>
  77. <div class="button_box">
  78. <el-button type="primary" @click="onClickConfirm" :disabled = "disabled">确认</el-button>
  79. </div>
  80. </el-tab-pane>
  81. </el-tabs>
  82. </div>
  83. </template>
  84. </div>
  85. </template>
  86. <script>
  87. import { isNumber } from "@/utils/sharedJsFile";
  88. export default {
  89. data() {
  90. return {
  91. orderNumber:null,
  92. activeName:"first",
  93. capacityName:null,
  94. stateCapacity:null,
  95. materialList:[],
  96. capacityId:null,
  97. materialId:null,
  98. disabled:false,
  99. orderId:null,
  100. orderList:[],
  101. materialNum:null,
  102. saleDateOfReceipt:null,
  103. consigneeCompanyName:null,
  104. receiveAddressName:null,
  105. shipperName:null
  106. };
  107. },
  108. methods: {
  109. //运力弹出层
  110. handleSelectCapacity(item){
  111. console.log(item)
  112. this.capacityId = item.capacityId
  113. this.capacityName = item.capacityNumber
  114. this.axios.get("/api/v1/oms/getSteelOrderNum?capacityId=" + this.capacityId).then((res) =>{
  115. if(res.data.code == "200"){
  116. console.log(res.data.data)
  117. this.orderList = res.data.data
  118. }
  119. })
  120. },
  121. changeOrderNo(){
  122. console.log(this.orderNumber)
  123. this.axios.get("/api/v1/oms/getMesToSteelDepartment?orderId=" + this.orderId).then((res) => {
  124. this.materialList = res.data.data.materialMes
  125. this.saleDateOfReceipt = res.data.data.saleDateOfReceipt
  126. this.consigneeCompanyName = res.data.data.consigneeCompanyName
  127. this.receiveAddressName = res.data.data.receiveAddressName
  128. this.shipperName = res.data.data.shipperName
  129. })
  130. },
  131. changeMaterial(){
  132. console.log(this.materialId)
  133. this.materialList.forEach((e) => {
  134. if(e.materialId == this.materialId){
  135. this.materialNum = e.materialNum
  136. this.maxMaterialNum = e.materialNum
  137. }
  138. })
  139. },
  140. //以下是运力边输边查搜索
  141. querySearchCapacity(queryString, cb) {
  142. if(queryString.length < 3){
  143. return
  144. }
  145. this.axios.get('/api/v1/uc/getCapacityNumber?index='+queryString).then((res)=>{
  146. if(res.data.code == "200"){
  147. var restaurantsCarrier = res.data.data
  148. console.log(restaurantsCarrier,"restaurantsCarrier");
  149. var results = queryString ? restaurantsCarrier.filter(this.createFilterCarrier(queryString)) :restaurantsCarrier;
  150. // 调用 callback 返回建议列表的数据
  151. cb(results);
  152. }
  153. })
  154. },
  155. createFilterCarrier(queryString) {
  156. return (restaurantsCarrier) => {
  157. return (restaurantsCarrier.capacityNumber.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
  158. };
  159. },
  160. //以上是承运商边输边查搜索
  161. onClickConfirm(){
  162. if(!isNumber(this.materialNum)){
  163. this.$message.error("件数请输入数字")
  164. return
  165. }
  166. if((parseInt(this.materialNum) > parseInt(this.maxMaterialNum))){
  167. this.$message.error("修改后的数量不得大于提货单数量")
  168. return
  169. }
  170. if(this.materialNum == 0){
  171. this.$message.error("不能将物资数量修改为0")
  172. return
  173. }
  174. let updateNumMap = {
  175. orderId:this.orderId,
  176. materialId:this.materialId,
  177. materialNum:parseInt(this.materialNum)
  178. }
  179. this.axios.post("/api/v1/oms/updateMaterialMes",updateNumMap).then((res) => {
  180. console.log(res)
  181. if(res.data.code == '200'){
  182. this.$message.success("修改物资数量成功")
  183. }else{
  184. this.$message.error("新增失败请联系管理员")
  185. }
  186. })
  187. },
  188. },
  189. };
  190. </script>
  191. <style lang="scss">
  192. .admin{
  193. .admin1 {
  194. margin-top: 40px;
  195. margin-left: 40px;
  196. .switch {
  197. display: flex;
  198. justify-content: center;
  199. align-items: center;
  200. margin-top: 20px;
  201. color: aqua;
  202. }
  203. .button_box {
  204. display: flex;
  205. justify-content: center;
  206. align-items: center;
  207. width: 100%;
  208. height: 100px;
  209. }
  210. .admin2 {
  211. margin-top: 40px;
  212. .from {
  213. display: flex;
  214. align-items: center;
  215. justify-content: center;
  216. margin-top: 20px;
  217. margin-bottom: 20px;
  218. }
  219. .carrier{
  220. display: flex;
  221. justify-content: center;
  222. align-items: center;
  223. .el-form-item {
  224. text-align: right;
  225. }
  226. .el-autocomplete{
  227. width: 250px;
  228. }
  229. }
  230. .material {
  231. display: flex;
  232. justify-content: center;
  233. margin-top: 20px;
  234. margin-right: 100px;
  235. .text {
  236. display: inline-block;
  237. width: 170px;
  238. text-align: right;
  239. }
  240. .el-input {
  241. width: 250px;
  242. }
  243. }
  244. .poundNo {
  245. display: flex;
  246. justify-content: center;
  247. align-items: center;
  248. margin-top: 20px;
  249. margin-right: 100px;
  250. .text {
  251. display: inline-block;
  252. width: 170px;
  253. text-align: right;
  254. }
  255. .el-input {
  256. width: 250px;
  257. }
  258. }
  259. .block {
  260. display: flex;
  261. justify-content: center;
  262. align-items: center;
  263. margin-top: 20px;
  264. margin-right: 100px;
  265. .el-input {
  266. width: 250px;
  267. }
  268. .text {
  269. display: inline-block;
  270. width: 170px;
  271. text-align: right;
  272. }
  273. }
  274. .truckCalFirst {
  275. display: flex;
  276. justify-content: center;
  277. margin-top: 20px;
  278. margin-right: 100px;
  279. .text {
  280. display: inline-block;
  281. width: 170px;
  282. text-align: right;
  283. }
  284. .el-input {
  285. width: 250px;
  286. }
  287. }
  288. .truckCalSecond {
  289. display: flex;
  290. justify-content: center;
  291. margin-top: 20px;
  292. margin-right: 100px;
  293. .text {
  294. display: inline-block;
  295. width: 170px;
  296. text-align: right;
  297. }
  298. .el-input {
  299. width: 250px;
  300. }
  301. }
  302. .secondWeight {
  303. display: flex;
  304. justify-content: center;
  305. align-items: center;
  306. margin-top: 20px;
  307. margin-right: 100px;
  308. .text {
  309. display: inline-block;
  310. width: 170px;
  311. text-align: right;
  312. }
  313. .el-input {
  314. width: 250px;
  315. }
  316. }
  317. .firstWeight {
  318. display: flex;
  319. justify-content: center;
  320. align-items: center;
  321. margin-top: 20px;
  322. margin-right: 100px;
  323. .text {
  324. display: inline-block;
  325. width: 170px;
  326. text-align: right;
  327. }
  328. .el-input {
  329. width: 250px;
  330. }
  331. }
  332. .netWeight {
  333. display: flex;
  334. justify-content: center;
  335. align-items: center;
  336. margin-top: 20px;
  337. margin-right: 100px;
  338. .text {
  339. display: inline-block;
  340. width: 170px;
  341. text-align: right;
  342. }
  343. .el-input {
  344. width: 250px;
  345. }
  346. }
  347. }
  348. }
  349. }
  350. </style>