123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- <template>
- <div class="page-container column-container">
- <!-- 搜索区 -->
- <el-form
- class="list-search-container"
- :model="queryParams"
- ref="queryRef"
- :inline="true"
- >
- <el-form-item label="单据号:" prop="formCode">
- <el-input
- v-model="queryParams.formCode"
- placeholder="请输入单据号"
- style="width: 144px"
- clearable
- @keyup.enter="handleQuery"
- />
- </el-form-item>
- <el-form-item label="表单日期:" prop="formDate">
- <el-date-picker
- v-model="queryParams.formDate"
- type="date"
- style="width: 144px"
- clearable
- value-format="YYYY-MM-DD"
- placeholder="请选择表单日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="外协商名称:" prop="supplierName">
- <el-input
- v-model="queryParams.supplierName"
- placeholder="请输入关键字"
- style="width: 144px"
- clearable
- @keyup.enter="handleQuery"
- />
- </el-form-item>
- <el-form-item label="送货方式:" prop="deliveryMethod">
- <el-select
- v-model="queryParams.deliveryMethod"
- style="width: 144px"
- clearable
- placeholder="请选择"
- >
- <el-option
- v-for="dict in delivery_method"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="带箱方式:" prop="packagingMethod">
- <el-select
- v-model="queryParams.packagingMethod"
- style="width: 144px"
- clearable
- placeholder="请选择"
- >
- <el-option
- v-for="dict in packaging_method"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="Search" @click="handleQuery"
- >搜索</el-button
- >
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <!-- 功能按钮区 -->
- <div class="list-btns-container">
- <el-button
- type="primary"
- icon="Plus"
- @click="handleAdd"
- v-hasPermi="['business:outsource:add']"
- >
- 新增
- </el-button>
- <el-button
- type="danger"
- icon="Delete"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['business:outsource:remove']"
- >
- 删除
- </el-button>
- <el-button
- type="warning"
- icon="Download"
- :disabled="ids.length != 1"
- @click="handleExport"
- v-hasPermi="['business:outsource:export']"
- >
- 导出
- </el-button>
- <el-button
- type="warning"
- icon="Download"
- :disabled="ids.length != 1"
- @click="handlePrint"
- v-hasPermi="['business:outsource:export']"
- >
- 打印
- </el-button>
- </div>
- <!-- 渲染数据区 -->
- <div class="el-table-container">
- <div class="el-table-inner-container">
- <el-table
- v-loading="loading"
- :data="orderList"
- size="small"
- border
- height="100%"
- @selection-change="handleSelectionChange"
- >
- <el-table-column type="selection" width="48" align="center" />
- <el-table-column
- label="外协单号"
- align="center"
- prop="formCode"
- width="120"
- />
- <el-table-column
- label="外协日期"
- align="center"
- prop="formDate"
- width="120"
- >
- <template #default="scope">
- {{ parseTime(scope.row.formDate, "{y}-{m}-{d}") }}
- </template>
- </el-table-column>
- <el-table-column
- label="外协商名称"
- align="center"
- prop="supplierName"
- width="320"
- />
- <el-table-column
- label="结算方式"
- align="center"
- prop="settlementType"
- width="120"
- >
- <template #default="scope">
- <dict-tag
- :options="settlement_type"
- :value="scope.row.settlementType"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="送货方式"
- align="center"
- prop="deliveryMethod"
- width="120"
- >
- <template #default="scope">
- <dict-tag
- :options="delivery_method"
- :value="scope.row.deliveryMethod"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="带箱方式"
- align="center"
- prop="packagingMethod"
- width="120"
- >
- <template #default="scope">
- <dict-tag
- :options="packaging_method"
- :value="scope.row.packagingMethod"
- />
- </template>
- </el-table-column>
- <el-table-column label="备注" align="center" prop="remark" />
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="200"
- >
- <template #default="scope">
- <el-button
- v-if="scope.row.isSubmit == 1"
- link
- type="warning"
- icon="Edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['business:outsource:edit']"
- >
- 编辑
- </el-button>
- <el-button
- link
- type="primary"
- icon="View"
- @click="handleView(scope.row)"
- v-hasPermi="['business:outsource:query']"
- >
- 查看
- </el-button>
- <el-button
- link
- type="danger"
- icon="Delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['business:outsource:remove']"
- >
- 删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- 分页 -->
- <pagination
- v-show="total > 0"
- :total="total"
- v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 表单 -->
- <order-form
- ref="orderRef"
- :get-list="getList"
- :delivery-method="delivery_method"
- :settlement-type="settlement_type"
- :packaging-method="packaging_method"
- />
- </div>
- </template>
- <script setup name="Order">
- import {
- listOrder,
- delOrder,
- exportOutsource,
- printOutsource,
- } from "@/api/business/outsourcedOrder";
- import orderForm from "./form";
- const { proxy } = getCurrentInstance();
- /** 字典数组区 */
- const { delivery_method } = proxy.useDict("delivery_method");
- const { settlement_type } = proxy.useDict("settlement_type");
- const { packaging_method } = proxy.useDict("packaging_method");
- const orderList = ref([]);
- const loading = ref(true);
- const del = ref(true); //选中数据是否可以删除
- const ids = ref([]);
- const single = ref(true);
- const multiple = ref(true);
- const total = ref(0);
- /** 查询对象 */
- const queryParams = ref({
- pageNum: 1,
- pageSize: 10,
- formCode: null,
- formDate: null,
- startTime: null,
- endTime: null,
- supplierName: null,
- deliveryMethod: null,
- packagingMethod: null,
- freightPrice: null,
- freightAmount: null,
- });
- /*********************** 方法区 ****************************/
- /** 查询外协单主
- 带箱方式,是整单的。如果换新箱子,明细中,都需要更换箱子列表 */
- function getList() {
- loading.value = true;
- listOrder(queryParams.value).then((response) => {
- orderList.value = response.rows;
- total.value = response.total;
- loading.value = false;
- });
- }
- /** 搜索按钮操作 */
- function handleQuery() {
- queryParams.value.pageNum = 1;
- getList();
- }
- /** 重置按钮操作 */
- function resetQuery() {
- proxy.resetForm("queryRef");
- handleQuery();
- }
- // 多选框选中数据
- function handleSelectionChange(selection) {
- ids.value = selection.map((item) => item.id);
- del.value = !selection.some((item) => item.isSubmit == 1);
- single.value = selection.length != 1;
- multiple.value = !selection.length;
- }
- /** 新增按钮操作 */
- function handleAdd() {
- proxy.$refs.orderRef.open();
- }
- /** 修改按钮操作 */
- function handleUpdate(row) {
- const id = row.id || ids.value;
- row.flag = true
- proxy.$refs.orderRef.open(row);
- }
- function handleView(row) {
- const id = row.id || ids.value;
- row.flag =false
- proxy.$refs.orderRef.open(row);
- }
- /** 删除按钮操作 */
- function handleDelete(row) {
- const _ids = row.id || ids.value;
- if (del.value) {
- proxy.$modal
- .confirm("是否确认删除选中的数据项?")
- .then(function () {
- return delOrder(_ids);
- })
- .then(() => {
- getList();
- proxy.$modal.msgSuccess("删除成功!");
- })
- .catch(() => {});
- } else {
- proxy.$modal.msgError("已提交单据,不能删除!");
- }
- }
- /** 导出按钮操作 */
- function handleExport() {
- exportOutsource({ id: ids.value[0] });
- }
- /** 导出按钮操作 */
- function handlePrint() {
- printOutsource({ id: ids.value[0] });
- }
- getList();
- </script>
|