index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <div class="page-container column-container">
  3. <!-- 搜索区 -->
  4. <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
  5. <el-form-item label="产品描述:" prop="productDescription">
  6. <el-input v-model="queryParams.productDescription" placeholder="请输入产品描述" style="width: 144px" clearable
  7. @keyup.enter="handleQuery" />
  8. </el-form-item>
  9. <el-form-item label="入库部门:" prop="deptId">
  10. <el-select-v2 v-model="deptId" :options="deptList" placeholder="请选择入库部门" style="width: 100px"
  11. @change="handleQuery" />
  12. </el-form-item>
  13. <el-form-item label="入库类别:" prop="type">
  14. <el-select v-model="queryParams.type" placeholder="请选择入库类别" style="width: 100px" @change="handleQuery">
  15. <el-option v-for="item in inbound_type" :key="item.value" :label="item.label" :value="item.value" />
  16. </el-select>
  17. </el-form-item>
  18. <el-form-item label="转运托盘码:" prop="transferCode">
  19. <el-input v-model="queryParams.transferCode" placeholder="请输入转运托盘码" clearable @keyup.enter="handleQuery"
  20. style="width: 100px" />
  21. </el-form-item>
  22. <el-form-item label="创建时间:">
  23. <el-date-picker v-model="queryParams.startTime" type="date" value-format="YYYY-MM-DD" :editable="false"
  24. clearable placeholder="请选择开始时间" style="width: 145px" @change="handleDateChange" />
  25. <span>到</span>
  26. <el-date-picker v-model="queryParams.endTime" type="date" value-format="YYYY-MM-DD" :editable="false" clearable
  27. placeholder="请选择结束时间" style="width: 145px" @change="handleDateChange" />
  28. </el-form-item>
  29. <el-form-item label="入库单号:" prop="inboundNumber">
  30. <el-input v-model="queryParams.inboundNumber" placeholder="请输入入库单号" style="width: 100px" />
  31. </el-form-item>
  32. <el-form-item label="反检出库单号:" prop="reSelectOutgoingOrderNumber">
  33. <el-input v-model="queryParams.reSelectOutgoingOrderNumber" placeholder="请输入反检出库单号" style="width: 100px" />
  34. </el-form-item>
  35. <el-form-item label="入库状态:" prop="status">
  36. <el-select v-model="queryParams.status" placeholder="请选择入库类别" style="width: 144px" @change="handleQuery">
  37. <el-option v-for="item in product_storage_status" :key="item.value" :label="item.label" :value="item.value" />
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  42. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  43. </el-form-item>
  44. </el-form>
  45. <!-- 功能按钮区 -->
  46. <div class="list-btns-container">
  47. <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['business:inboundOrder:add']">新增</el-button>
  48. </div>
  49. <!-- 列表区 -->
  50. <el-table v-loading="loading" :data="inboundOrderList" size="small" border height="100%"
  51. @selection-change="handleSelectionChange">
  52. <el-table-column type="selection" width="55" align="center" />
  53. <el-table-column label="产品描述" align="center" prop="productDescription" width="220" />
  54. <el-table-column label="入库单号" align="center" prop="inboundNumber" />
  55. <el-table-column label="入库部门" align="center" prop="deptName" />
  56. <el-table-column label="转运码" align="center" prop="transferCode" />
  57. <el-table-column label="入库类别" align="center" prop="type">
  58. <template #default="scope">
  59. <dict-tag :options="inbound_type" :value="scope.row.type + ''"></dict-tag>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="入库总量" align="center" prop="inboundTotalNum" />
  63. <el-table-column label="存储区域" align="center" prop="storageArea">
  64. <template #default="scope">
  65. <dict-tag :options="storage_area" :value="scope.row.storageArea + ''"></dict-tag>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="是否打印" align="center" prop="isPrint">
  69. <template #default="scope">
  70. {{ scope.row.isPrint == 1 ? '是' : '否' }}
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="入库状态" align="center" prop="status">
  74. <template #default="scope">
  75. <dict-tag :options="product_storage_status" :value="scope.row.status + ''"></dict-tag>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
  79. <el-table-column label="反检出库单号" align="center" prop="reSelectOutgoingOrderNumber" />
  80. <el-table-column label="客户" align="center" prop="companyAlias" />
  81. <el-table-column label="客户编码" align="center" prop="companyCode" />
  82. <el-table-column label="保管员姓名" align="center" prop="storageNickName" />
  83. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240">
  84. <template #default="scope">
  85. <el-button link type="primary" size="small" icon="Download" @click="handlePrint(scope.row)"
  86. v-hasPermi="['business:inboundOrder:export']">打印</el-button>
  87. <el-button v-if="checkEdit(scope.row)" link type="primary" size="small" icon="Edit"
  88. @click="handleUpdate(scope.row, true)">修改</el-button>
  89. <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row, false)"
  90. v-hasPermi="['business:inboundOrder:query']">详情</el-button>
  91. <el-button v-if="checkRemove(scope.row)" link type="danger" size="small" icon="Delete"
  92. @click="handleDelete(scope.row)">删除</el-button>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. <!-- 分页 -->
  97. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  98. v-model:limit="queryParams.pageSize" @pagination="getList" />
  99. <!-- 表单 -->
  100. <inboundOrder-form ref="inboundOrderRef" :get-list="getList"></inboundOrder-form>
  101. </div>
  102. </template>
  103. <script setup name="InboundOrder">
  104. import { listInboundOrder, delInboundOrder, exportInboundOrderPdf, setPrint, getDeptList as getDept } from "@/api/business/inboundOrder";
  105. import inboundOrderForm from "./form"
  106. const { proxy } = getCurrentInstance()
  107. const { inbound_type } = proxy.useDict("inbound_type");
  108. const { storage_area } = proxy.useDict("storage_area");
  109. const { product_storage_status } = proxy.useDict("product_storage_status");
  110. const { product_production_category } = proxy.useDict("product_production_category");
  111. import auth from '@/plugins/auth'
  112. /** 字典数组区 */
  113. /** 查询 对象 */
  114. const inboundOrderList = ref([]);
  115. const loading = ref(true);
  116. const ids = ref([])
  117. const single = ref(true);
  118. const multiple = ref(true);
  119. const isDispatch = ref(false)
  120. const total = ref(0);
  121. const deptId = ref('0')
  122. /**工段 */
  123. const deptList = ref([]);
  124. /** 入库类型 */
  125. const typeList = ref([]);
  126. /** 查询对象 */
  127. const queryParams = ref({
  128. pageNum: 1,
  129. pageSize: 10,
  130. type: null,
  131. deptName: null,
  132. inboundTime: null,
  133. inboundNumber: null,
  134. companyAlias: null,
  135. companyCode: null,
  136. storageUserName: null,
  137. storageNickName: null,
  138. packageResourceGroupName: null,
  139. packageResourceGroupLineNo: null,
  140. productCode: null,
  141. productType: null,
  142. isSubItem: null,
  143. inputUserName: null,
  144. inputNickName: null,
  145. inboundTotalNum: null,
  146. storageArea: null,
  147. labelNumber: null,
  148. transferCode: null,
  149. originalTransferCode: null,
  150. isPrint: null,
  151. reSelectOutgoingOrderNumber: null,
  152. boxNumber: null,
  153. factoryWarehouse: null,
  154. unit: null,
  155. packageType: null,
  156. status: null,
  157. isAllInbound: null,
  158. })
  159. /*********************** 方法区 ****************************/
  160. /** 查询生产入库列表 */
  161. function getList() {
  162. loading.value = true;
  163. queryParams.value.deptId = deptId.value == '0' ? null : deptId.value;
  164. listInboundOrder(queryParams.value).then(response => {
  165. inboundOrderList.value = response.rows;
  166. total.value = response.total;
  167. loading.value = false;
  168. });
  169. }
  170. /** 打印按钮操作 */
  171. function handlePrint(row) {
  172. exportInboundOrderPdf({ id: row.id }).then(_ => {
  173. console.log('已打印完毕')
  174. setPrint({ id: row.id, isPrint: 1 }).then(() => {
  175. getList();
  176. })
  177. })
  178. }
  179. function getDeptList() {
  180. getDept().then(response => {
  181. console.log(response.data);
  182. deptList.value = response.data.rows;
  183. isDispatch.value = response.data.others.isDispatch;
  184. if (isDispatch.value) {
  185. deptList.value.unshift({ label: "全部", value: "0" });
  186. }
  187. deptId.value = deptList.value[0].value;
  188. getList()
  189. });
  190. }
  191. /** 搜索按钮操作 */
  192. function handleQuery() {
  193. queryParams.value.pageNum = 1;
  194. getList();
  195. }
  196. /** 重置按钮操作 */
  197. function resetQuery() {
  198. proxy.resetForm("queryRef");
  199. queryParams.value.startTime = null
  200. queryParams.value.endTime = null
  201. deptId.value = deptList.value[0].value;
  202. handleQuery();
  203. }
  204. // 多选框选中数据
  205. function handleSelectionChange(selection) {
  206. ids.value = selection.map(item => item.id);
  207. single.value = selection.length != 1;
  208. multiple.value = !selection.length;
  209. }
  210. /** 新增按钮操作 */
  211. function handleAdd() {
  212. proxy.$refs.inboundOrderRef.open()
  213. }
  214. /** 修改按钮操作 */
  215. function handleUpdate(row, edit) {
  216. // const id = row.id || ids.value
  217. proxy.$refs.inboundOrderRef.open(row, edit)
  218. }
  219. /** 删除按钮操作 */
  220. function handleDelete(row) {
  221. const _ids = row.id || ids.value;
  222. proxy.$modal.confirm('是否确认删除选中的数据项?').then(function () {
  223. return delInboundOrder(_ids);
  224. }).then(() => {
  225. getList();
  226. proxy.$modal.msgSuccess("删除成功!");
  227. }).catch(() => { });
  228. }
  229. /** 导出按钮操作 */
  230. function handleExport() {
  231. proxy.download('business/inboundOrder/export', {
  232. ...queryParams.value
  233. }, `inboundOrder_${new Date().getTime()}.xlsx`)
  234. }
  235. function checkEdit(row) {
  236. // 未打印 判断权限
  237. // 已打印 判断权限
  238. // 已出库 不可编辑
  239. if (row.status >= 1) {
  240. return false
  241. } else if (row.isPrint == 1) {
  242. if (auth.hasPermi("business:inboundOrder:francise:edit")) {
  243. return true
  244. } else {
  245. return false
  246. }
  247. } else if (auth.hasPermi("business:inboundOrder:edit")) {
  248. return true
  249. }
  250. return false
  251. }
  252. function checkRemove(row) {
  253. // 未打印 判断权限
  254. // 已打印 判断权限
  255. // 已出库 不可编辑
  256. if (row.status >= 1) {
  257. return false
  258. } else if (row.isPrint == 1) {
  259. if (auth.hasPermi("business:inboundOrder:francise:remove")) {
  260. return true
  261. } else {
  262. return false
  263. }
  264. } else if (auth.hasPermi("business:inboundOrder:remove")) {
  265. return true
  266. }
  267. return false
  268. }
  269. getDeptList()
  270. /** 修改查询时间 */
  271. function handleDateChange(value) { }
  272. function handleDeptChange() { }
  273. // getList();
  274. </script>