detail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="stockInDetail pagePadding">
  3. <div style="width: 100%" v-if="powers.some((i) => i == '007')">
  4. <!-- <div class="detail-page-title">
  5. <span class="title">入库单编号:{{ queryId }}</span>
  6. </div>-->
  7. <el-tabs v-model="activeTabs">
  8. <el-tab-pane label="业务详情" name="1">
  9. <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
  10. <el-collapse-item title="入库单信息" name="0">
  11. <show-data-table
  12. :newTime="newTime"
  13. v-if="newTime !== ''"
  14. :sitem="sitem"
  15. :columns="ShowDataTableColumns"
  16. >
  17. <template slot="company">
  18. <span>{{ sitem.company }}</span>
  19. <el-popover placement="top" width="300" trigger="hover">
  20. <ul>
  21. <li>
  22. <span>购买方公司编号:</span>
  23. <span>{{ sitem.companyNo }}</span>
  24. </li>
  25. </ul>
  26. <i class="el-icon-warning-outline fr" slot="reference"></i>
  27. </el-popover>
  28. </template>
  29. <template slot="wsm">
  30. <span>{{ sitem.wsm_name }}</span>
  31. <el-popover placement="top" width="300" trigger="hover">
  32. <ul>
  33. <li>
  34. <p>仓库名称编号 : {{ sitem.wsm_code }}</p>
  35. <p>仓库负责人 : {{ sitem.contactor_name }}</p>
  36. </li>
  37. </ul>
  38. <i class="el-icon-warning-outline fr" slot="reference"></i>
  39. </el-popover>
  40. </template>
  41. <template slot="status">
  42. <el-tag
  43. :size="'mini'"
  44. :type="sitem.status == '0' ? 'warning' : ''"
  45. v-text="
  46. (statusOptions.find((item) => item.value == sitem.status) || {})
  47. .label || '--'
  48. "
  49. ></el-tag>
  50. </template>
  51. <template slot="order_type">
  52. <el-tag
  53. :size="'mini'"
  54. v-text="
  55. (
  56. cg_order_type_options.find(
  57. (item) => item.id == sitem.order_type
  58. ) || {}
  59. ).label || '--'
  60. "
  61. ></el-tag>
  62. </template>
  63. <template slot="sendtype">
  64. <span>
  65. {{
  66. sitem.sendtype + "" == "1"
  67. ? "公司自提"
  68. : sitem.sendtype + "" === "2"
  69. ? "供应商包邮"
  70. : "--"
  71. }}
  72. </span>
  73. </template>
  74. </show-data-table>
  75. </el-collapse-item>
  76. <el-collapse-item title="商品信息" name="2" v-if="sitem">
  77. <show-goods-data-table
  78. :newTime="newTime"
  79. v-if="newTime !== ''"
  80. :type="sitem.order_type"
  81. :skucode="sitem.skuCode"
  82. :spucode="sitem.spuCode"
  83. :iscgd="isCgd"
  84. />
  85. </el-collapse-item>
  86. <el-collapse-item
  87. title="入库验收"
  88. name="3"
  89. v-if="status == '1' && ppowers.some((i) => i == '1') && !isSupertube"
  90. >
  91. <wsm-in
  92. v-if="newTime !== '' && canInStock"
  93. :id="queryId"
  94. :newTime="newTime"
  95. :modelSitem="{}"
  96. :sitem="sitem"
  97. @refresh="initData()"
  98. />
  99. <el-alert v-else type="warning" :title="'当前节点只能由仓库管理员 ' + sitem.contactor_name + ' 操作'" :closable="false" show-icon />
  100. </el-collapse-item>
  101. </el-collapse>
  102. </el-tab-pane>
  103. <el-tab-pane label="审批记录" name="2">
  104. <process-time-line
  105. v-if="newTime !== ''"
  106. :newTime="newTime"
  107. :type="'RKD'"
  108. :orderCode="queryId"
  109. />
  110. </el-tab-pane>
  111. <el-tab-pane label="流程图" name="4">
  112. <flow-chart process_id="2" type="RKD" :orderCode="queryId" />
  113. </el-tab-pane>
  114. </el-tabs>
  115. </div>
  116. <div v-else>
  117. <no-auth></no-auth>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. import asyncRequest from "@/apis/service/purchaseIn/purchaseOrder";
  123. import ShowDataTableColumns from "./components/ShowDataTableColumns";
  124. import { cg_order_type_options } from "@/assets/js/statusList";
  125. import { statusOptions } from "./columns"; //表格列参数
  126. import resToken from "@/mixins/resToken";
  127. import wsmIn from "./components/wsm-in";
  128. import { mapGetters } from "vuex";
  129. export default {
  130. name: "wsmInOrderDetail",
  131. mixins: [resToken],
  132. components: { wsmIn },
  133. computed: {
  134. ...mapGetters(["isSupertube", "userInfo"]),
  135. isCgd(){
  136. const { order_type, order_source } = this.sitem || {};
  137. if(order_source === "7" && order_type === "4"){
  138. return false
  139. }
  140. if(order_source === "9" && order_type === "3"){
  141. return false
  142. }
  143. return true
  144. },
  145. canInStock() {
  146. const { contactor } = this.sitem || {};
  147. const { id } = this.userInfo || {};
  148. console.log(contactor, id);
  149. if (!contactor || !id) return false;
  150. return String(contactor) === String(id);
  151. },
  152. powers() {
  153. const { btnList } = this.$store.getters;
  154. const tran =
  155. btnList.find(item => item.menu_route == "wsmInOrderDetail") || {};
  156. const { action } = tran ?? {};
  157. return action ?? [];
  158. },
  159. ppowers() {
  160. const { roleProcess } = this.$store.getters;
  161. const tran = roleProcess.find(i => i.process_type === "RKD") || {};
  162. const { action } = tran ?? {};
  163. return action ?? [];
  164. }
  165. },
  166. data() {
  167. return {
  168. activeTabs: "1",
  169. ShowDataTableColumns: ShowDataTableColumns,
  170. activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
  171. cg_order_type_options,
  172. sitem: null,
  173. status: "",
  174. statusOptions,
  175. newTime: "",
  176. loading: false,
  177. queryId: ""
  178. };
  179. },
  180. mounted() {
  181. this.status = "";
  182. this.queryId = this.$route.query.id;
  183. this.initData();
  184. },
  185. methods: {
  186. getNewTime() {
  187. this.newTime = new Date().valueOf();
  188. },
  189. async setStatus(status, message, remark) {
  190. let model = {
  191. wsm_in_code: this.queryId,
  192. remark: remark || "",
  193. status: status
  194. };
  195. const res = await asyncRequest.orderinstatus(model);
  196. this.loading = false;
  197. if (res && res.code === 0) {
  198. this.$notify.success({
  199. title: message + "成功!",
  200. message: ""
  201. });
  202. this.initData();
  203. } else if (res && res.code >= 100 && res.code <= 104) {
  204. await this.logout();
  205. } else {
  206. this.$message.warning(res.message);
  207. }
  208. },
  209. async examForm(e) {
  210. if (!this.loading) {
  211. let type =
  212. e.state + "" === "1"
  213. ? this.sitem.return_num + "" === "0"
  214. ? "4"
  215. : "5"
  216. : "2";
  217. await this.setStatus(type, "提交入库方审核", e.remark);
  218. }
  219. },
  220. async initData() {
  221. const res = await asyncRequest.orderininfo({ wsm_in_code: this.queryId });
  222. if (res && res.code === 0 && res.data) {
  223. this.sitem = res.data;
  224. const { status, can, wsm_in_code } = this.sitem;
  225. this.status = status;
  226. if (can && can.length > 0) {
  227. this.sitem.class_cat = "";
  228. can.forEach((x, i) => {
  229. this.sitem.class_cat += i === 0 ? x.name : "/" + x.name;
  230. });
  231. }
  232. this.getNewTime();
  233. } else if (res && res.code >= 100 && res.code <= 104) {
  234. await this.logout();
  235. } else {
  236. this.$message.warning(res.message);
  237. }
  238. }
  239. }
  240. };
  241. </script>