weightCheck.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <div class="center">
  3. <el-row>
  4. <el-col :span="12">
  5. <h2 class="bg-left titleup">{{ information }}检斤信息</h2>
  6. </el-col>
  7. <el-col :span="12" class="bg-right">
  8. <el-button class="bg-bottom" type="primary" size="small" @click="cancel"
  9. ><img
  10. width="6"
  11. height="10"
  12. style="vertical-align: bottom; margin-right: 3px"
  13. src="../../../public/img/lujing.png"
  14. alt=""
  15. />返回</el-button
  16. >
  17. </el-col>
  18. </el-row>
  19. <div class="substance">
  20. <ws-form>
  21. <div style="width: 50%; margin: 0 auto">
  22. <div class="title">基本信息</div>
  23. <ws-info-table>
  24. <ws-form-item label="编号" span="1" prop="number">
  25. <ws-input
  26. v-model="weighingList.number"
  27. placeholder="请输入编号"
  28. maxlength="100"
  29. disabled
  30. size="small"
  31. />
  32. </ws-form-item>
  33. <ws-form-item label="仓位号" span="1" prop="binNumber">
  34. <ws-input
  35. v-model="weighingList.binNumber"
  36. placeholder="请输入仓位号"
  37. maxlength="100"
  38. disabled
  39. size="small"
  40. />
  41. </ws-form-item>
  42. <ws-form-item label="客户" span="1" prop="customer">
  43. <ws-input
  44. v-model="weighingList.customer"
  45. placeholder="请输入客户"
  46. maxlength="100"
  47. disabled
  48. size="small"
  49. />
  50. </ws-form-item>
  51. <ws-form-item label="囤位号" span="1" prop="storageNumber">
  52. <ws-input
  53. v-model="weighingList.storageNumber"
  54. placeholder="请输入囤位号"
  55. maxlength="100"
  56. size="small"
  57. disabled
  58. />
  59. </ws-form-item>
  60. <ws-form-item label="车牌号" span="1" prop="carNumber">
  61. <ws-input
  62. v-model="weighingList.carNumber"
  63. placeholder="请输入车牌号"
  64. maxlength="100"
  65. size="small"
  66. disabled
  67. />
  68. </ws-form-item>
  69. <ws-form-item label="货名" span="1" prop="goodsName">
  70. <ws-input
  71. v-model="weighingList.goodsName"
  72. placeholder="请输入货名"
  73. maxlength="100"
  74. size="small"
  75. disabled
  76. />
  77. </ws-form-item>
  78. <!-- <div class="formitem"> -->
  79. <ws-form-item
  80. label="毛重(公斤)"
  81. span="1"
  82. prop="grossWeight"
  83. >
  84. <ws-input
  85. v-model="weighingList.grossWeight"
  86. placeholder="请输入毛重"
  87. maxlength="100"
  88. size="small"
  89. disabled
  90. />
  91. </ws-form-item>
  92. <el-button type="primary" :class="tpyeNo != 2?'':'css1'" @click="chongxin">重新获取</el-button>
  93. <ws-form-item
  94. label="皮重(公斤)"
  95. span="1"
  96. prop="tare"
  97. v-if="this.tpyeNo == 2"
  98. >
  99. <ws-input
  100. v-model="weighingList.tare"
  101. placeholder="请输入皮重"
  102. maxlength="100"
  103. size="small"
  104. :disabled="disabled"
  105. />
  106. </ws-form-item>
  107. <el-button type="primary" v-if="this.tpyeNo == 2">重新获取</el-button>
  108. <div class="formItem">
  109. <ws-form-item
  110. label="扣杂(公斤)"
  111. span="1"
  112. prop="buckleWeightRatio"
  113. v-if="this.tpyeNo == 2"
  114. >
  115. <ws-input
  116. v-model="weighingList.buckleMiscellaneous"
  117. placeholder="请输入扣杂"
  118. maxlength="100"
  119. size="small"
  120. :disabled="disabled"
  121. />
  122. </ws-form-item>
  123. <ws-form-item
  124. label="净重(公斤)"
  125. span="1"
  126. prop="netWeight"
  127. v-if="this.tpyeNo == 2"
  128. >
  129. <ws-input
  130. v-model="weighingList.netWeight"
  131. placeholder="请输入净重"
  132. maxlength="100"
  133. size="small"
  134. disabled
  135. />
  136. </ws-form-item>
  137. </div>
  138. </ws-info-table>
  139. <div class="but">
  140. <el-button @click="cancel" type="primary"
  141. >取消</el-button
  142. >
  143. <el-button @click="print" v-if="this.tpyeNo == 1" type="primary"
  144. >保存</el-button
  145. >
  146. <el-button @click="print" v-if="this.tpyeNo == 2" type="primary"
  147. >保存并打印</el-button
  148. >
  149. </div>
  150. </div>
  151. </ws-form>
  152. </div>
  153. </div>
  154. </template>
  155. <script>
  156. import { tare,grossWeight } from '@/model/houseSelfCollect/index'
  157. export default {
  158. data() {
  159. return {
  160. inspect: {},
  161. types: 1,
  162. information: '',
  163. weighingList: {},
  164. tpyeNo: '',
  165. disabled:false,
  166. relationId:"",
  167. }
  168. },
  169. activated() {
  170. this.tpyeNo = this.$route.query.tpyeNo
  171. this.weighingList.number = this.$route.query.number
  172. this.weighingList.binNumber = this.$route.query.binNumber
  173. this.weighingList.customer = this.$route.query.customer
  174. this.weighingList.storageNumber = this.$route.query.storageNumber
  175. this.weighingList.carNumber = this.$route.query.carNumber
  176. this.weighingList.goodsName = this.$route.query.goodsName
  177. this.weighingList.id = this.$route.query.id
  178. // this.weighingList.grossWeight = this.$route.query.grossWeight
  179. // this.weighingList.tare = this.$route.query.tare
  180. // this.weighingList.netWeight = this.$route.query.netWeight
  181. this.relationId = this.$route.query.relationId
  182. if(this.tpyeNo == 1){
  183. this.information = "毛重"
  184. }else if(this.tpyeNo == 2){
  185. this.information = "皮重"
  186. }
  187. },
  188. methods: {
  189. submit() {
  190. //皮重保存
  191. this.$confirm('确定保存检斤信息?', '提示', {
  192. confirmButtonText: '确定',
  193. cancelButtonText: '取消',
  194. type: 'warning',
  195. })
  196. .then(() => {})
  197. .catch(() => {
  198. return false
  199. })
  200. },
  201. chongxin(){
  202. if(this.tpyeNo == 2){
  203. return
  204. }
  205. console.log("dfsgfgdgdsgszdf")
  206. },
  207. cancel() {
  208. this.$router.push({ path: 'weighingManagement' })
  209. },
  210. print(){
  211. this.$confirm('确定保存检斤信息?', '提示', {
  212. confirmButtonText: '确定',
  213. cancelButtonText: '取消',
  214. type: 'warning',
  215. })
  216. .then(() => {
  217. if(this.tpyeNo == 1){
  218. this.weighingList.relationId = this.relationId
  219. grossWeight(this.weighingList)
  220. .toPromise()
  221. .then((response) => {
  222. this.$notify.success({
  223. title: '成功',
  224. message: '保存成功',
  225. })
  226. this.$router.go(-1)
  227. })
  228. .catch((response) => {
  229. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  230. })
  231. }else if(this.tpyeNo == 2){
  232. tare(this.weighingList)
  233. .toPromise()
  234. .then((response) => {
  235. this.$notify.success({
  236. title: '成功',
  237. message: '保存成功',
  238. })
  239. this.$router.go(-1)
  240. })
  241. .catch((response) => {
  242. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  243. })
  244. }
  245. })
  246. .catch(() => {
  247. return false
  248. })
  249. },
  250. commit() {
  251. //毛重保存
  252. this.$confirm('确定保存检斤信息?', '提示', {
  253. confirmButtonText: '确定',
  254. cancelButtonText: '取消',
  255. type: 'warning',
  256. })
  257. .then(() => {})
  258. .catch(() => {
  259. return false
  260. })
  261. },
  262. },
  263. }
  264. </script>
  265. <style lang="scss" scoped>
  266. .center {
  267. background: #f6f7fc;
  268. }
  269. .ws-info-table {
  270. border: none;
  271. }
  272. .ws-info-table .el-form-item {
  273. width: 50%;
  274. border: none;
  275. }
  276. .formItem {
  277. width: 100%;
  278. display: inline;
  279. }
  280. // .ws-info-table .widthChange {
  281. // width: 51%;
  282. // }
  283. /deep/.ws-info-table .el-form-item .el-form-item__label {
  284. width: 30%;
  285. text-align: center;
  286. background: #ffffff;
  287. font-size: 14px;
  288. color: #8890b1;
  289. }
  290. /deep/.ws-info-table .el-form-item .el-form-item__content {
  291. border: none;
  292. }
  293. .title {
  294. font-size: 16px;
  295. font-weight: 600;
  296. margin: 10px;
  297. }
  298. .titleup {
  299. position: relative;
  300. }
  301. .title::before {
  302. content: '';
  303. display: inline-block;
  304. width: 5px;
  305. height: 15px;
  306. background: #8890b1;
  307. margin-right: 5px;
  308. }
  309. .substance {
  310. background: #ffffff;
  311. width: 100%;
  312. border-radius: 4px;
  313. margin: 0 auto;
  314. padding-top: 20px;
  315. }
  316. /deep/.el-table .el-table__header .cell,
  317. .el-table .el-table__body .cell {
  318. text-align: center;
  319. }
  320. /deep/.el-table--enable-row-transition .el-table__body td {
  321. text-align: center;
  322. }
  323. .bg-left {
  324. padding-left: 30px;
  325. }
  326. .bg-right {
  327. padding-right: 10px;
  328. text-align: right;
  329. }
  330. .bg-bottom {
  331. margin: 15px 0px;
  332. }
  333. .titleup {
  334. position: relative;
  335. }
  336. .titleup::before {
  337. content: '';
  338. display: inline-block;
  339. width: 5px;
  340. height: 30px;
  341. background: #5473e8;
  342. position: absolute;
  343. left: 0;
  344. }
  345. .but {
  346. text-align: center;
  347. margin: 20px auto;
  348. }
  349. .css1{
  350. opacity: 0;
  351. }
  352. </style>