buts.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <div class="buts">
  3. <div class="but">
  4. <el-button type="blur" @click="accountVerify">客户部验证</el-button>
  5. <el-button type="blur" @click="storageVerify">仓储部验证</el-button>
  6. </div>
  7. <el-dialog
  8. title="批量检测系统"
  9. :visible.sync="hasDialog"
  10. width="50%">
  11. <template v-if="step === 'one'">
  12. <div class="dialog-msg">
  13. <p>产地中英文已查找完成,请检查,并选择是否替换?</p>
  14. <p>【确定】替换</p>
  15. <p>【取消】不替换,并重新检查</p>
  16. </div>
  17. <div slot="footer" class="dialog-footer">
  18. <el-button @click="cancelClick">取 消</el-button>
  19. <el-button type="blur" @click="stepOne('two')">确 定</el-button>
  20. </div>
  21. </template>
  22. <template v-if="step === 'two'">
  23. <div class="dialog-msg">
  24. <p>本次报关币种:【 <span v-text="sheetInfo.currency"/> 】,请确认币种是否正确?</p>
  25. <p>【确定】一致</p>
  26. <p>【取消】不一致,手动修改!</p>
  27. </div>
  28. <div slot="footer" class="dialog-footer">
  29. <el-button @click="cancelClick">取 消</el-button>
  30. <el-button type="blur" @click="jumpStep('three')">确 定</el-button>
  31. </div>
  32. </template>
  33. <template v-if="step === 'three'">
  34. <div class="dialog-msg">
  35. <p>您选择的币种为【<span v-text="sheetInfo.currency"/>】</p>
  36. </div>
  37. <div slot="footer" class="dialog-footer">
  38. <el-button type="blur" @click="stepNine">确 定</el-button>
  39. </div>
  40. </template>
  41. <template v-if="step === 'four'">
  42. <div class="dialog-msg">
  43. <p>【净重 < 毛重】核对完成,请注意核对总净重、总毛重!</p>
  44. </div>
  45. <div slot="footer" class="dialog-footer">
  46. <el-button @click="cancelClick">取 消</el-button>
  47. <el-button type="blur" @click="jumpStep('five')">确 定</el-button>
  48. </div>
  49. </template>
  50. <template v-if="step === 'five'">
  51. <div class="dialog-msg">
  52. <p>核对完成,【单价 * 数量 = 总价】正确!</p>
  53. <p>数量总计为:<span v-text="sheetInfo.totalAmount"/></p>
  54. <p>箱数总计为:<span v-text="sheetInfo.totalCartonNum"/>箱</p>
  55. <p>净重总计为:<span v-text="sheetInfo.totalNetWeight"/>KG</p>
  56. <p>毛重总计为:<span v-text="sheetInfo.totalGrossWeight"/>KG</p>
  57. <p>总价总计为:<span v-text="sheetInfo.currency"/><span v-text="sheetInfo.totalPrice"/></p>
  58. <h3>请核对上述数据与《INVOICE》、《PACKING LIST》等原始资料是否一致!</h3>
  59. <p>【确定】一致</p>
  60. <p>【取消】不一致,请仔细核对明细,检查错误!</p>
  61. </div>
  62. <div slot="footer" class="dialog-footer">
  63. <el-button @click="cancelClick">取 消</el-button>
  64. <el-button type="blur" @click="stepSix('six')">确 定</el-button>
  65. </div>
  66. </template>
  67. <template v-if="step === 'six'">
  68. <div class="dialog-msg">
  69. <p>客户【<span v-text="delivery.companyName"/>】在我司系统的成交方式为【<span v-text="delivery.transactionMode"/>】,请核对并选择此次报关的【<span>成交方式</span>】:</p>
  70. </div>
  71. <div slot="footer" class="dialog-footer" style="text-align: center">
  72. <el-button type="blur" @click="stepSeven(true, 'seven')">F O B</el-button>
  73. <el-button type="blur" @click="stepSeven(false, 'seven')">C I F</el-button>
  74. </div>
  75. </template>
  76. <template v-if="step === 'seven'">
  77. <div class="dialog-msg">
  78. <p>【<span v-text="sheetInfo.commissionCompany"/>】此次报关的成交方式:【<span v-text="sheetInfo.transactionMode"/>】</p>
  79. </div>
  80. <div slot="footer" class="dialog-footer">
  81. <el-button type="blur" @click="jumpStep('eight')">确 定</el-button>
  82. </div>
  83. </template>
  84. <template v-if="step === 'eight'">
  85. <div class="dialog-msg">
  86. <p>批量检测完成!本检测只是初步检测!请与客户提供的《INVOICE》、《PACKING LIST》等原始资料进行核对!着重核对商品名称、型号、品牌、产地!</p>
  87. </div>
  88. <div slot="footer" class="dialog-footer">
  89. <el-button type="blur" @click="stepOver">确 定</el-button>
  90. </div>
  91. </template>
  92. <template v-if="step === 'nine'">
  93. <div class="dialog-msg">
  94. <p>序号:</p>
  95. <p><span v-for="item in weightErr" v-text="item"/></p>
  96. <p>这些表格的毛重、净重存在异常情况!请仔细核对明细,检查错误!</p>
  97. </div>
  98. <div slot="footer" class="dialog-footer">
  99. <el-button type="blur" @click="cancelClick">确 定</el-button>
  100. </div>
  101. </template>
  102. </el-dialog>
  103. </div>
  104. </template>
  105. <script>
  106. export default {
  107. name: 'ButsView',
  108. props: ['errMsg'],
  109. data() {
  110. return {
  111. hasDialog: false,
  112. step: 'five',
  113. updateMsg: '',
  114. weightErr: [],
  115. delivery: {}
  116. }
  117. },
  118. computed: {
  119. sheetInfo () {
  120. return this.$store.state.severSheet.details.data.content
  121. }
  122. },
  123. methods: {
  124. // 取消验证
  125. cancelClick () {
  126. this.hasDialog = false
  127. setTimeout(function() {this.step = 'one'}, 300)
  128. },
  129. // 验证跳转
  130. jumpStep (type) {
  131. this.step = type
  132. },
  133. // 客户部验证信息
  134. accountVerify () {
  135. this.hasDialog = true
  136. this.step = 'one'
  137. },
  138. // 客户部验证信息one
  139. stepOne (type) {
  140. let params = new FormData
  141. params.append('id', this.$route.params.id)
  142. let config = {
  143. headers: {'Content-Type': 'multipart/form-data'}
  144. }
  145. this.$http.post('/CommissionSheet/updateProducingArea', params, config)
  146. .then(response => {
  147. if (response.data.success) {
  148. this.$store.commit('severSheet/REQUEST_DETAILS_SUCCESS', response.data)
  149. this.step = type
  150. } else {
  151. this.$message({
  152. message: response.data.message,
  153. type: 'warning'
  154. })
  155. }
  156. })
  157. .catch(() => {
  158. this.$message.error('请检查网络是否正常')
  159. })
  160. },
  161. // 客户部验证信息nine
  162. stepNine () {
  163. this.weightErr = []
  164. let list = this.sheetInfo.commissionSheetDetail
  165. console.log(list)
  166. for (let i = 0; i < list.length; i++) {
  167. if (list[i].grossWeight >= 0 && list[i].netWeight >= 0 && (list[i].netWeight >= list[i].grossWeight)) {
  168. this.weightErr.push(list[i].detno)
  169. }
  170. }
  171. console.log(this.weightErr)
  172. this.weightErr.length !== 0 ? this.step = 'nine' : this.step = 'four'
  173. },
  174. // 客户部验证信息six
  175. stepSix (type) {
  176. this.$http.get('/customer/enuu', {params: {enuu: this.sheetInfo.commissionCompanyEnuu}})
  177. .then(res => {
  178. if (res.data.success) {
  179. this.delivery = res.data.content
  180. this.step = type
  181. } else {
  182. this.$message({
  183. message: res.data.message,
  184. type: 'warning'
  185. })
  186. }
  187. })
  188. .catch(() => {
  189. this.$message.error('请检查网络是否正常!')
  190. })
  191. },
  192. // 客户部验证信息seven
  193. stepSeven (key, type) {
  194. let params = new FormData()
  195. params.append('id', this.$route.params.id)
  196. params.append('transactionMode', key ? 'fob' : 'cif')
  197. let config = {
  198. headers: {'Content-Type': 'multipart/form-data'}
  199. }
  200. this.$http.post('/CommissionSheet/transactionMode/update', params, config)
  201. .then(res => {
  202. if (res.data.success) {
  203. this.$store.commit('severSheet/REQUEST_DETAILS_SUCCESS', res.data)
  204. this.step = type
  205. } else {
  206. this.$message({
  207. message: res.data.message,
  208. type: 'warning'
  209. })
  210. }
  211. })
  212. .catch(() => {
  213. this.$message.error('请检查网络是否正常!')
  214. })
  215. },
  216. // 客户部验证完成
  217. stepOver () {
  218. this.updateMsg = '产地中英文替换,本次报关币种' + this.sheetInfo.currency + ','
  219. this.updateMsg += '净重小于毛重核对完成,完成统计信息核对,成交方式为' + this.sheetInfo.transactionMode + ', 完成检测'
  220. let params = new FormData
  221. params.append('id', this.$route.params.id)
  222. params.append('status', 'success')
  223. params.append('operatorMessage', this.updateMsg)
  224. let config = {
  225. headers: {'Content-Type': 'multipart/form-data'}
  226. }
  227. this.$http.post('/CommissionSheet/customService/pass', params, config)
  228. .then(response => {
  229. if (response.data.success) {
  230. this.hasDialog = false
  231. this.step = 'one'
  232. this.$message({
  233. message: '客服部验证信息已发送成功',
  234. type: 'success'
  235. })
  236. } else {
  237. this.$message({
  238. message: response.data.message,
  239. type: 'warning'
  240. })
  241. }
  242. })
  243. .catch(() => {
  244. this.$message.error('请检查网络是否正常')
  245. })
  246. },
  247. // 仓储部验证信息
  248. storageVerify () {
  249. let params = new FormData
  250. params.append('id', this.$route.params.id)
  251. params.append('json', JSON.stringify(this.errMsg))
  252. params.append('status', 'success')
  253. let config = {
  254. headers: {'Content-Type': 'multipart/form-data'}
  255. }
  256. this.$http.post('/CommissionSheet/storageValidate', params, config)
  257. .then(response => {
  258. if (response.data.success) {
  259. this.$message({
  260. message: '仓储部验证信息已发送成功',
  261. type: 'success'
  262. })
  263. } else {
  264. this.$message({
  265. message: response.data.message,
  266. type: 'warning'
  267. })
  268. }
  269. })
  270. .catch(() => {
  271. this.$message.error('请检查网络是否正常')
  272. })
  273. }
  274. }
  275. }
  276. </script>
  277. <style lang="scss" type="text/scss" scoped>
  278. .buts{
  279. padding:50px;
  280. .dialog-msg{
  281. padding-left:25px;
  282. p{
  283. margin-bottom:15px;
  284. font-size: 16px;
  285. line-height: 25px;
  286. color:#333;
  287. span{
  288. font-weight: bold;
  289. margin:0 5px;
  290. }
  291. }
  292. }
  293. }
  294. </style>