|
|
@ -52,6 +52,13 @@ |
|
|
|
<template #actionMore> |
|
|
|
<template #actionMore> |
|
|
|
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button> |
|
|
|
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button> |
|
|
|
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button> |
|
|
|
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="handleBatchUpdateInstall" |
|
|
|
|
|
|
|
v-hasPermi="['clue:order:reset']" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
批量修改安装状态 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</Search> |
|
|
|
</Search> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -61,58 +68,88 @@ |
|
|
|
class="mt-10px" |
|
|
|
class="mt-10px" |
|
|
|
v-model:tableObject="tableObject" |
|
|
|
v-model:tableObject="tableObject" |
|
|
|
:tableColumns="allSchemas.tableColumns" |
|
|
|
:tableColumns="allSchemas.tableColumns" |
|
|
|
|
|
|
|
rowkey="signId" |
|
|
|
|
|
|
|
:expandRowKeys="expendRows" |
|
|
|
@get-list="getTableList" |
|
|
|
@get-list="getTableList" |
|
|
|
@get-checked-columns="getCheckedColumns" |
|
|
|
@get-checked-columns="getCheckedColumns" |
|
|
|
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
<el-table-column type="selection" width="60" /> |
|
|
|
<el-table-column type="expand"> |
|
|
|
<el-table-column type="expand"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<div class="p-10px flex justify-center"> |
|
|
|
<div class="p-10px flex justify-center"> |
|
|
|
<el-table :data="row.signProducts" stripe style="width: 900px"> |
|
|
|
<VueDraggable |
|
|
|
<el-table-column prop="productName" label="成交产品" /> |
|
|
|
target="tbody" |
|
|
|
<el-table-column prop="specsName" label="产品规格" width="100px" /> |
|
|
|
v-model="row.signProducts" |
|
|
|
<el-table-column prop="signNum" label="成交数量" width="90px" /> |
|
|
|
:animation="150" |
|
|
|
<el-table-column prop="remark" label="成交备注" /> |
|
|
|
@end="onDragEnd" |
|
|
|
<el-table-column label="发货状态" prop="sendState" width="90px"> |
|
|
|
style="width: 100%" |
|
|
|
<template #default="scope"> |
|
|
|
> |
|
|
|
<el-tag |
|
|
|
<el-table |
|
|
|
:type="scope.row.sendState == '待发货' ? 'danger' : 'success'" |
|
|
|
:data="row.signProducts" |
|
|
|
size="small" |
|
|
|
row-key="id" |
|
|
|
> |
|
|
|
stripe |
|
|
|
{{ scope.row.sendState }} |
|
|
|
style="width: 80%; margin: 0 auto" |
|
|
|
</el-tag> |
|
|
|
> |
|
|
|
</template> |
|
|
|
<el-table-column prop="productName" label="成交产品" /> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="specsName" label="产品规格" /> |
|
|
|
<el-table-column label="发货备注" width="100px"> |
|
|
|
<el-table-column prop="signNum" label="成交数量" width="90px" /> |
|
|
|
<template #default="scope"> |
|
|
|
<el-table-column prop="remark" label="成交备注" width="100px" /> |
|
|
|
<el-popover |
|
|
|
<el-table-column label="生产状态" width="160px"> |
|
|
|
placement="top" |
|
|
|
<template #default="scope"> |
|
|
|
width="500px" |
|
|
|
<el-switch |
|
|
|
trigger="click" |
|
|
|
v-model="scope.row.isProduced" |
|
|
|
v-if="scope.row.warehouseName && scope.row.sendRemark" |
|
|
|
:active-value="true" |
|
|
|
> |
|
|
|
:inactive-value="false" |
|
|
|
<template #reference> |
|
|
|
active-text="已生产" |
|
|
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button> |
|
|
|
inactive-text="待生产" |
|
|
|
</template> |
|
|
|
size="small" |
|
|
|
<div v-dompurify-html="scope.row.sendRemark"></div> |
|
|
|
@change="handleChangeProdoce(scope.row)" |
|
|
|
</el-popover> |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="100px"> |
|
|
|
<el-table-column label="发货状态" prop="sendState" width="90px"> |
|
|
|
<template #default="scope"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-button |
|
|
|
<el-tag |
|
|
|
type="primary" |
|
|
|
:type="scope.row.sendState == '待发货' ? 'danger' : 'success'" |
|
|
|
class="mr-10px" |
|
|
|
size="small" |
|
|
|
link |
|
|
|
> |
|
|
|
:disabled="scope.row.sendState == '已发货'" |
|
|
|
{{ scope.row.sendState }} |
|
|
|
style="padding: 0; margin-left: 0" |
|
|
|
</el-tag> |
|
|
|
v-hasPermi="['clue:order:send']" |
|
|
|
</template> |
|
|
|
@click="handleDelivery(scope.row)" |
|
|
|
</el-table-column> |
|
|
|
> |
|
|
|
<el-table-column label="发货备注" width="100px"> |
|
|
|
发货 |
|
|
|
<template #default="scope"> |
|
|
|
</el-button> |
|
|
|
<el-popover |
|
|
|
</template> |
|
|
|
placement="top" |
|
|
|
</el-table-column> |
|
|
|
width="500px" |
|
|
|
</el-table> |
|
|
|
trigger="click" |
|
|
|
|
|
|
|
v-if="scope.row.warehouseName && scope.row.sendRemark" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<template #reference> |
|
|
|
|
|
|
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<div v-dompurify-html="scope.row.sendRemark"></div> |
|
|
|
|
|
|
|
</el-popover> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" width="100px"> |
|
|
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
class="mr-10px" |
|
|
|
|
|
|
|
link |
|
|
|
|
|
|
|
:disabled="scope.row.sendState == '已发货'" |
|
|
|
|
|
|
|
style="padding: 0; margin-left: 0" |
|
|
|
|
|
|
|
v-hasPermi="['clue:order:send']" |
|
|
|
|
|
|
|
@click="handleDelivery(scope.row)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
发货 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
</VueDraggable> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
@ -217,6 +254,8 @@ import DialogDelivery from './DialogDelivery.vue' |
|
|
|
|
|
|
|
|
|
|
|
import { removeNullField } from '@/utils' |
|
|
|
import { removeNullField } from '@/utils' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
|
|
|
|
import { ElMessageBox, ElOption, ElSelect } from 'element-plus' |
|
|
|
|
|
|
|
import { VueDraggable } from 'vue-draggable-plus' |
|
|
|
|
|
|
|
|
|
|
|
const userOptions = ref([]) |
|
|
|
const userOptions = ref([]) |
|
|
|
const allUserOptions = ref([]) |
|
|
|
const allUserOptions = ref([]) |
|
|
@ -362,6 +401,96 @@ const deliveryDialog = ref() |
|
|
|
function handleDelivery(row) { |
|
|
|
function handleDelivery(row) { |
|
|
|
deliveryDialog.value.open(row) |
|
|
|
deliveryDialog.value.open(row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const batchIds = ref([]) |
|
|
|
|
|
|
|
function handleSelectionChange(val) { |
|
|
|
|
|
|
|
batchIds.value = val.map((it) => it.signId) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const selectedValue = ref(undefined) |
|
|
|
|
|
|
|
const installOptions = [ |
|
|
|
|
|
|
|
{ label: '待安装', value: 1 }, |
|
|
|
|
|
|
|
{ label: '已安装', value: 2 }, |
|
|
|
|
|
|
|
{ label: '无需安装', value: 3 } |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const select = () => |
|
|
|
|
|
|
|
h( |
|
|
|
|
|
|
|
ElSelect, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
modelValue: selectedValue.value, |
|
|
|
|
|
|
|
placeholder: '新状态', |
|
|
|
|
|
|
|
'onUpdate:modelValue': (val) => { |
|
|
|
|
|
|
|
selectedValue.value = val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
() => |
|
|
|
|
|
|
|
installOptions.map((item) => { |
|
|
|
|
|
|
|
return h(ElOption, { label: item.label, value: item.value }) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleBatchUpdateInstall() { |
|
|
|
|
|
|
|
if (batchIds.value.length) { |
|
|
|
|
|
|
|
ElMessageBox({ |
|
|
|
|
|
|
|
title: '是否确认修改安装状态?', |
|
|
|
|
|
|
|
message: select, |
|
|
|
|
|
|
|
showCancelButton: true, |
|
|
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
|
|
cancelButtonText: '取消' |
|
|
|
|
|
|
|
}).then(async (action) => { |
|
|
|
|
|
|
|
// 处理用户点击确定或取消按钮后的逻辑 |
|
|
|
|
|
|
|
if (action == 'confirm') { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
// 发起修改状态 |
|
|
|
|
|
|
|
await SignApi.updateInstallStatus(batchIds.value, selectedValue.value) |
|
|
|
|
|
|
|
message.success('修改成功') |
|
|
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
|
|
await getTableList() |
|
|
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
// 取消后,进行恢复按钮 |
|
|
|
|
|
|
|
console.log(err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
message.info('请选择表格行') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function handleChangeProdoce(row) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
// 修改状态的二次确认 |
|
|
|
|
|
|
|
await message.confirm('确认要修改生产状态吗?') |
|
|
|
|
|
|
|
// 发起修改状态 |
|
|
|
|
|
|
|
await SignApi.updateProduceStatus({ |
|
|
|
|
|
|
|
signId: row.signId, |
|
|
|
|
|
|
|
id: row.id, |
|
|
|
|
|
|
|
isProduced: row.isProduced |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
message.success('修改成功') |
|
|
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
|
|
getTableList() |
|
|
|
|
|
|
|
} catch { |
|
|
|
|
|
|
|
// 取消后,进行恢复按钮 |
|
|
|
|
|
|
|
row.isProduced = !row.isProduced |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const expendRows = ref([]) |
|
|
|
|
|
|
|
async function onDragEnd(ev) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
expendRows.value = [ev.data.signId] |
|
|
|
|
|
|
|
const list = tableObject.value.tableList.find((it) => it.signId == ev.data.signId).signProducts |
|
|
|
|
|
|
|
await SignApi.updateProduceSort(list.map((it) => it.id)) |
|
|
|
|
|
|
|
message.success('修改成功') |
|
|
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
|
|
getTableList() |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
console.log(error) |
|
|
|
|
|
|
|
getTableList() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style> |
|
|
|
<style lang="scss" scoped></style> |
|
|
|