index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <div class="page-container column-container">
  3. <!-- <el-row :gutter="24" style="padding: 16px">
  4. <el-col :span="8">
  5. <div class="dashboard-total-item">
  6. <div><img :src="totalIcon2" /></div>
  7. <div class="dashboard-total-item-label">
  8. <span>待生产计划数</span>
  9. <span>5000</span>
  10. </div>
  11. </div>
  12. </el-col>
  13. <el-col :span="8">
  14. <div class="dashboard-total-item">
  15. <div><img :src="totalIcon3" /></div>
  16. <div class="dashboard-total-item-label">
  17. <span>投产中生产计划数</span>
  18. <span>5000</span>
  19. </div>
  20. </div>
  21. </el-col>
  22. <el-col :span="8">
  23. <div class="dashboard-total-item">
  24. <div><img :src="totalIcon3" /></div>
  25. <div class="dashboard-total-item-label">
  26. <span>本周完成计划数</span>
  27. <span>5000</span>
  28. </div>
  29. </div>
  30. </el-col>
  31. </el-row> -->
  32. <!-- 搜索区 -->
  33. <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
  34. <el-form-item label="计划单号:">
  35. <el-input placeholder="请输入计划单号" @keydown.enter.prevent @keyup.enter="handleQuery" clearable
  36. v-model.trim="queryParams.productionPlanNo" style="width: 160px" />
  37. </el-form-item>
  38. <!-- <el-form-item label="状态:">
  39. <el-select-v2 v-model="queryParams.status" clearable filterable :options="plan_status" placeholder="全部状态" @change="handleQuery" style="width: 120px" />
  40. </el-form-item> -->
  41. <el-form-item>
  42. <el-button type="info" icon="Search" @click="handleQuery">搜索</el-button>
  43. <el-button type="primary" icon="Switch" @click="handleSyncP2Plan"
  44. v-hasPermi="['business:productionPlan:query']">同步P2生产计划</el-button>
  45. </el-form-item>
  46. </el-form>
  47. <!-- 列表区 -->
  48. <div class="el-table-container">
  49. <div class="el-table-inner-container">
  50. <el-table v-loading="loading" :data="productionPlanList" height="100%">
  51. <el-table-column type="index" label="行号" width="50" align="center"></el-table-column>
  52. <el-table-column label="客户简称" prop="companyAlias" width="150" align="center" />
  53. <el-table-column label="生产计划单号" prop="productionPlanNo" width="110" align="center" />
  54. <el-table-column label="序号" width="60" prop="lineNumber" align="center" />
  55. <el-table-column label="产品描述" prop="productDescription" align="center" />
  56. <el-table-column label="图纸版本" prop="technologyVersion" width="70" align="center" />
  57. <el-table-column label="总投产量" prop="productionQuantity" width="80" align="center" />
  58. <el-table-column label="总批数" prop="totalLotNumber" width="80" align="center" />
  59. <el-table-column label="单批量" prop="oneLotQuantity" width="80" align="center" />
  60. <el-table-column label="尾批量" prop="lastLotQuantity" width="80" align="center" />
  61. <el-table-column label="批号状态" prop="lotCodeStatusCode" width="100" align="center">
  62. <template #default="scope">
  63. <dict-tag :options="lot_code_status_code" :value="scope.row.lotCodeStatusCode" />
  64. </template>
  65. </el-table-column>
  66. <!-- <el-table-column label="批号状态" prop="lotCodeStatusCode" width="60" align="center" /> -->
  67. <el-table-column label="累计投产量" prop="pickUpQuantity" width="80" align="center" />
  68. <el-table-column label="累计投产批数" prop="lotTotalNumber" width="90" align="center" />
  69. <el-table-column label="库位" prop="storageLocation" width="80" align="center" />
  70. <el-table-column label="是否废品回用" prop="" width="90" align="center">
  71. <template #default="scope">
  72. {{ scope.row.planType == 'HY' ? '是' : '否' }}
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="领料部门" prop="requisitionDepartmentName" align="center" fixed="right">
  76. <template #default="scope">
  77. <span>{{ scope.row.requisitionDepartmentName }}</span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="下达日期" prop="issueDate" width="120" align="center" />
  81. <!-- <el-table-column label="完成批次" width="100" align="center">
  82. <template #default="scope">
  83. {{ '0 / ' + scope.row.totalLotNumber }}
  84. </template>
  85. </el-table-column> -->
  86. <!-- <el-table-column label="操作" width="80" align="center">
  87. <template #default="scope">
  88. <el-button link type="primary" icon="View" @click="handleAdd(scope.row)">查看</el-button>
  89. </template>
  90. </el-table-column> -->
  91. </el-table>
  92. </div>
  93. </div>
  94. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  95. v-model:limit="queryParams.pageSize" @pagination="getList" />
  96. <!-- 表单 -->
  97. <!-- <productionPlan-form ref="productionPlanRef" :get-list="getList"></productionPlan-form> -->
  98. </div>
  99. </template>
  100. <script setup name="ProductionPlan">
  101. import { getP2Plan } from '@/api/business/p2.js'
  102. import { getConfigKey } from '@/api/system/config'
  103. import { listProductionPlanDetail } from '@/api/business/productionPlanDetail.js'
  104. import totalIcon2 from '@/assets/images/dashboard-total-icon-2.png'
  105. import totalIcon3 from '@/assets/images/dashboard-total-icon-3.png'
  106. import useSettingsStore from "@/store/modules/settings";
  107. const dataSource = useSettingsStore().dataSource;
  108. import { ref } from 'vue'
  109. const { proxy } = getCurrentInstance()
  110. /** 字典数组区 */
  111. /** 查询 对象 */
  112. const productionPlanList = ref([])
  113. const loading = ref(true)
  114. const total = ref(2)
  115. const { plan_status } = proxy.useDict('plan_status')
  116. const { lot_code_status_code } = proxy.useDict('lot_code_status_code')
  117. /** 查询对象 */
  118. const queryParams = ref({
  119. productionPlanNo: '',
  120. planStatus: '',
  121. pullP2PlanDetails: false,
  122. pageNum: 1,
  123. pageSize: 10
  124. })
  125. onMounted(() => {
  126. getList()
  127. })
  128. /**************************** 方法区 ****************************/
  129. /** 查询生产计划列表 */
  130. function getList() {
  131. loading.value = true
  132. if(!dataSource){
  133. getP2Plan(queryParams.value).then((res) => {
  134. productionPlanList.value = res.rows
  135. total.value = res.total
  136. loading.value = false
  137. queryParams.value.pullP2PlanDetails = false
  138. })
  139. }else{
  140. console.log("切换数据源")
  141. }
  142. }
  143. /** 搜索按钮操作 */
  144. function handleQuery() {
  145. queryParams.value.pageNum = 1
  146. getList()
  147. }
  148. /**
  149. * 同步P2生产计划
  150. */
  151. const handleSyncP2Plan = () => {
  152. getConfigKey('switch_data_source').then(res =>{
  153. if(res.msg == 'true'){
  154. proxy.$modal.msgSuccess('切换数据源成功')
  155. }else{
  156. queryParams.value.pullP2PlanDetails = true
  157. getList()
  158. }
  159. })
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. .dashboard-total-item {
  164. display: flex;
  165. align-items: center;
  166. font-size: 16px;
  167. height: 120px;
  168. background-color: #f2f2f2;
  169. border-radius: 10px;
  170. >div:first-child {
  171. display: flex;
  172. flex: 2;
  173. justify-content: center;
  174. align-items: center;
  175. }
  176. >div.dashboard-total-item-label {
  177. display: flex;
  178. flex: 3;
  179. flex-direction: column;
  180. justify-content: center;
  181. >span {
  182. display: block;
  183. width: 60%;
  184. text-align: center;
  185. &:first-child {
  186. font-size: 16px;
  187. margin-bottom: 4px;
  188. letter-spacing: 2px;
  189. }
  190. &:last-child {
  191. font-weight: bold;
  192. font-size: 24px;
  193. }
  194. }
  195. }
  196. }
  197. .dashboard-total-item>.dashboard-total-item-label>span:last-child {
  198. color: #444444;
  199. }
  200. .dashboard-total-item>.dashboard-total-item-label>span:last-child>span:first-child {
  201. margin-right: 8px;
  202. }
  203. .dashboard-total-item>.dashboard-total-item-label>span:last-child>span:last-child {
  204. color: #4367df;
  205. }
  206. .dashboard-total-item>.number-label {
  207. font-size: 40px;
  208. margin-left: 16px;
  209. font-weight: bold;
  210. color: #5a6ac3;
  211. }
  212. </style>