customer_sales_details.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <div>
  3. <el-page-header content="详情" style=" padding: 20px 20px 0 20px;" @back="handleBack" />
  4. <sales-header ref="header" />
  5. <sales-table :data-list="dataList" :column="column" @handleSelection="handleSelection">
  6. <template #events>
  7. <el-button
  8. v-if="(details.status == 1 &&details.stockType == 1 )"
  9. type="primary"
  10. size="mini"
  11. @click="handleInform(2)"
  12. >通知发货</el-button>
  13. <el-button v-if="(details.status == 2 && details.stockType == 1)" size="mini" @click="handleSendRevoke(1)">撤销发货</el-button>
  14. <el-button v-if="(details.status == 1 && details.stockType == 2)" type="primary" size="mini" @click="handleSignIn(4)">
  15. 签收
  16. </el-button>
  17. </template>
  18. </sales-table>
  19. <el-card style="margin: 0 20px">
  20. <zj-table :is-drop="true" :columns="examineColumns" :table-data="examineData" />
  21. </el-card>
  22. <LogisticsTabs v-if="Object.keys(details).length && details.status !== 1 " :details="details" :return-show="false" style="margin:20px;" :gong-dan-id="details.gongDanId" :details-id="detailsId" :jiaxian-order-id="details.jiaxianOrderId" />
  23. <sales-dialog
  24. :dialog-visible="dialogVisible"
  25. :customer-number="customerNumber"
  26. :func="getDialogList"
  27. @confirm="confirm"
  28. />
  29. </div>
  30. </template>
  31. <script>
  32. import SalesDialog from '@/components/SalesDialog/SalesDialog'
  33. import SalesHeader from '@/components/SalesHeader/SalesHeader'
  34. import SalesTable from '@/components/SalesTable/SalesTable'
  35. import { addFrontOrder, getFrontOrderDetail, sbumitFrontOrder, signIn, setSendRevoke } from '@/api/sales'
  36. import { getcustomerFrontList } from '@/api/stock'
  37. import LogisticsTabs from '@/components/LogisticsTabs'
  38. export default {
  39. name: 'WarehouseForm',
  40. components: {
  41. SalesHeader,
  42. SalesTable,
  43. SalesDialog,
  44. LogisticsTabs
  45. },
  46. props: ['detailsId', 'pageType'],
  47. data() {
  48. return {
  49. dialogVisible: false,
  50. customerNumber: '',
  51. dataList: [],
  52. details: {},
  53. selection: [],
  54. flag: 1,
  55. column: [
  56. {
  57. prop: 'materialName',
  58. label: '产品名称',
  59. width: '180'
  60. },
  61. {
  62. prop: 'materialCode',
  63. label: '物料编码',
  64. width: '180'
  65. },
  66. {
  67. prop: 'specification',
  68. label: '规格型号',
  69. width: '300'
  70. },
  71. // {
  72. // prop: 'stockQty',
  73. // label: '库存数量',
  74. // width: '180'
  75. // },
  76. {
  77. prop: 'qty',
  78. label: '数量',
  79. width: '180'
  80. },
  81. // {
  82. // prop: 'volume',
  83. // label: '体积',
  84. // width: '180'
  85. // },
  86. // {
  87. // prop: 'totalVolume',
  88. // label: '总体积',
  89. // width: '180'
  90. // },
  91. {
  92. prop: 'notes',
  93. label: '备注'
  94. }
  95. ],
  96. activities: [
  97. {
  98. content: '活动按期开始',
  99. color: '#0bbd87',
  100. timestamp: '2018-04-15'
  101. },
  102. {
  103. content: '通过审核',
  104. timestamp: '2018-04-13'
  105. },
  106. {
  107. content: '创建成功',
  108. timestamp: '2018-04-11'
  109. }
  110. ],
  111. isFront: null,
  112. examineData: []
  113. }
  114. },
  115. computed: {
  116. examineColumns() {
  117. return [
  118. {
  119. columnAttributes: {
  120. label: '审核信息',
  121. prop: 'barCode'
  122. }
  123. },
  124. {
  125. columnAttributes: {
  126. label: '审核人',
  127. prop: 'barCode'
  128. }
  129. },
  130. {
  131. columnAttributes: {
  132. label: '审核时间',
  133. prop: 'barCode'
  134. }
  135. },
  136. {
  137. columnAttributes: {
  138. label: '备注',
  139. prop: 'barCode'
  140. }
  141. }
  142. ]
  143. }
  144. },
  145. created() {
  146. this.isFront = JSON.parse(localStorage.getItem('supply_user')).isFront
  147. if (this.detailsId) {
  148. getFrontOrderDetail({ id: this.detailsId }).then(res => {
  149. this.details = res.data
  150. this.dataList = res.data.orders
  151. this.$refs.header.screenForm = res.data
  152. this.$refs.header.screenForm.disabled = true
  153. this.$refs.header.screenForm.provinceId = res.data.province
  154. this.$refs.header.screenForm.cityId = res.data.city
  155. this.$refs.header.screenForm.areaId = res.data.area
  156. this.$refs.header.screenForm.streetId = res.data.street
  157. this.$refs.header.screenForm.stockType = res.data.stockType
  158. })
  159. }
  160. },
  161. methods: {
  162. getDialogList(p) {
  163. return getcustomerFrontList(...p)
  164. },
  165. confirm(selected) {
  166. // console.log(selected)
  167. this.dataList = selected
  168. this.$refs.header.screenForm.customerName = this.dataList[0].customerName
  169. this.$refs.header.screenForm.customerNumber = this.dataList[0].customerNumber
  170. this.customerNumber = this.dataList[0].customerNumber
  171. this.dialogVisible = false
  172. },
  173. handleDel(item, index) {
  174. this.dataList.splice(index, 1)
  175. },
  176. delChange() {
  177. this.dataList.forEach((k, i) => {
  178. this.selection.forEach((l, e) => {
  179. if (k.id === l.id) {
  180. this.dataList.splice(i, 1)
  181. this.selection.splice(e, 1)
  182. }
  183. })
  184. })
  185. },
  186. handleSelection(data) {
  187. this.selection = data
  188. },
  189. handelSubmit() {
  190. this.dataList.forEach(k => {
  191. k.id = ''
  192. k.directFlag = k.flag
  193. })
  194. const params = {
  195. ...this.$refs.header.screenForm,
  196. orders: this.dataList
  197. }
  198. addFrontOrder(params).then(res => {
  199. this.$successMsg('新增成功')
  200. this.handleBack()
  201. this.$forceUpdate()
  202. })
  203. },
  204. handelSigning() {},
  205. handleInform(status = 2) {
  206. sbumitFrontOrder({ id: this.$refs.header.screenForm.id, status }).then(res => {
  207. this.$successMsg('发货通知')
  208. this.handleBack()
  209. })
  210. },
  211. handleSignIn(status) {
  212. this.$confirm('请确定,订单产品客户已完成签收,一旦签收则不能撤销', '提示', {
  213. confirmButtonText: '确定',
  214. cancelButtonText: '取消',
  215. type: 'warning'
  216. }).then(res => {
  217. signIn({ id: this.$refs.header.screenForm.id, status }).then(res => {
  218. this.$successMsg('签收')
  219. this.handleBack()
  220. })
  221. }).catch(() => {
  222. })
  223. },
  224. handleSendRevoke(status) {
  225. setSendRevoke({ id: this.$refs.header.screenForm.id, status }).then(res => {
  226. this.$successMsg('撤销发货')
  227. this.handleBack()
  228. })
  229. },
  230. handleBack() {
  231. this.$emit('close')
  232. }
  233. }
  234. }
  235. </script>
  236. <style scoped></style>